When you are writing Azure automation script, the code may thrown exception or error with message like below.
'The client '093e9259-xxxx-xxxx-xxxx-xxxxxe6d6b67' with object id '093e9259-xxxx-xxxx-xxxx-9a5xxe6d6b67' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/write' over scope '/subscriptions/xx/resourcegroups/xx' or the scope is invalid. If access was recently granted, please refresh your credentials.'In my case, I was trying to create a resource group using C# code. In your case, error may be due to some other type of resource. But the general cause is same. As the error suggests that the service principal account that I am using, does not have authorization to perform write action on the specified resource type. To fix this error, all you have to do is, fix the permissions associated with your service principal account. To create resources in Azure subscription, your service principal account needs to have Contributor level role for that resource. In Azure portal goto Subscription node and then use Access Control node. Then use "Grant Access To This Resource" widget in main view and select the role you want to assign to this service principal.
How to fix Azure Automation Error - Insufficient Authorization
ADO.Net Dataservice Error: Request Error Server Encountered an error processing request
InheritInChildApplications cannot be set to false error with dnn
Use OpenDNS to set up safe internet access at home
How to measure Web Page performance with CPU throttling
Why I am not upgrading to iPhone 12 for now
Passing Exam AZ-204: Developing Solutions for Microsoft Azure
Alert and Confirm pop up using BootBox in AngularJS
AngularJS Grouped Bar Chart and Line Chart using D3
How to lock and unlock account in Asp.Net Identity provider
2021 © Byteblocks, ALL Rights Reserved. Privacy Policy | Terms of Use