I have around 100 Azure Web Apps and Azure Functions which I created using Azure PowerShell and CLI, now I need to assign Owner Access to these Web Apps to users (Separate users for each Web Apps)
I am unable to find any sample for this, most sample are pointing to Assigning Resource Group Level Access, but not to the Specific Resource.
The task is achievable in the Azure Portal, just need the PowerShell or CLI command to assign users owner or contributor rights to these specific resources.
If possible please provide a sample command
For Power Shell, you could use
New-AzureRmRoleAssignment
to do this.For example.
or
Note: You could get your user object ID with cmdlet
get-azureaduser
.Azure CLI
You could use
az role assignment create
to do this.For example.
Note: If your user is Azure AD user, you could use
az ad user list
to get user's object id. If your user is a service principal, you could useaz ad sp list
to get object id.