Hi ,
Thanks for reaching out to Microsoft Q&A.
The deployment is failing because your account does not have the permissions to:
Assign roles (Microsoft.Authorization/roleAssignments/write
)
Create or update App Service Plans (Microsoft.Web/serverfarms/write
)
Create or update App Services (Microsoft.Web/sites/write
)
Update App Service settings (Microsoft.Web/sites/config/write
)
In Azure, these actions require Contributor or Owner permissions at the subscription or resource group level (and in the case of role assignments, you also need User Access Administrator rights).
Admin should:
- Grant you the required roles at the right scope
- Scope: Either at the subscription level or at the specific resource group (
apim-resource
) where you are deploying. - Roles required:
- Contributor - lets you create/update resources like App Service Plans, App Services, configs.
- User Access Administrator - lets you assign roles during the deployment.
- Scope: Either at the subscription level or at the specific resource group (
- Contributor - required to create/update Azure resources during the ARM template deployment.
- User Access Administrator - required because your template is also creating role assignments for service principals. Without this, deployment will fail even if you have Contributor.
Option 1 -> Azure Portal
- Go to Azure Portal > Subscriptions > select the subscription you are using.
- In the left menu, click Access control (IAM).
- Click Add > Add role assignment.
- Search for and assign:
- Contributor role to your user (
******@aem.eco
) - User Access Administrator role to your user
- Contributor role to your user (
- Set Scope to:
- Subscription level (best if you will do multiple deployments), or
- Resource group level (
apim-resource
) if they want to limit your access.
Option 2 -> Using Powershell
Please 'Upvote'(Thumbs-up) and 'Accept' as answer if the reply was helpful. This will be benefitting other community members who face the same issue.