Permissions To Change Azure Vm Local Admin Password Using App Registration
I found THIS answer where author shows how to change local admin password on the VM. I'm wondering what can I do to make this request call using App Registration account in Active
Solution 1:
Set https://login.microsoftonline.com/{teannt id}
as the authority
and https://management.azure.com/.default
as the scope
.
For permission, since Application permission for Azure rest API in app registration is not available (it's gray out), we can assign RBAC role to the App Registration account for the VM. Detailed steps here.
Find the VM -> Access Control -> Add -> Add role assignment -> select a role (for example Contributor) and enter the name of your App Registration.
As you found, after that you have to change URL to the following: https://management.azure.com/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachines/%s/extensions/enablevmaccess?api-version=2020-12-01
.
Post a Comment for "Permissions To Change Azure Vm Local Admin Password Using App Registration"