question

MCMR-1355 avatar image
0 Votes"
MCMR-1355 asked azure-cxp-api edited

Finding Azure permissions needed for Powershell cmdlets

I'm trying to use Runbooks to automate things in Azure but I keep running into 'Insufficient privileges' errors for the runas user the Automation Account is using.
Is there any documentation on what permissions the cmdlets need? I've not been able to find anything and have wasted hours of effort playing a very frustrating guessing game.

azure-ad-authentication
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SamCogan avatar image
0 Votes"
SamCogan answered

First of, the permissions aren't related to the commands you are running in PS, they are down to the actions you are taking in Azure. Permissions would be the same if you were doing this in the portal, CLI or PS.

Finding the permissions you need is a real pain. Some products have this documented fairly well, such as this example from Azure Monitor, so that is the first place to try, the docs. If that doesn't work out then your only option is to go through all the available permissions to find the ones you think look like what you need. You can do this in the portal, just go to the IAM (RBAC) tab on any resource, then go to roles, then pick a role, and select permissions. In here you can see all the available permissions and look for what you need.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.