Hi ,
Thanks for reaching out to Microsoft Q&A.
The error indicates that the service principal does not have sufficient permissions to perform the requested action (Microsoft.web/sites/functions/read
) on the Azure Function app. Even though you mentioned granting permissions at the resource group level, there are a few areas to verify and potential adjustments you can make:
- Check Role Assignment Scope
- Ensure the service principal has the correct role assignment at the appropriate scope.
- Use the Azure Role Assignments blade or
az role assignment list
command to confirm the following: - The service principal is assigned the necessary role at the resource group, subscription, or specific resource level.
- Roles to verify:
- Contributor or
- Custom role with permissions for
Microsoft.Web/*
.
listkeys/action
can lead to errors during deployments."Microsoft.Web/sites/read", "Microsoft.Web/sites/functions/read", "Microsoft.Web/sites/functions/write", "Microsoft.Web/sites/functions/listkeys/action"
- Confirm the Azure CLI/SDK credentials or tokens being used in the GitLab runner reflect the updated permissions: If permissions were granted recently, refresh tokens:
az account clear az login
Private Endpoint Configuration
- Ensure the GitLab Runner (deployed externally) has proper network access to the Function App's private endpoint.
- The GitLab Runner needs connectivity to the Function App's DNS through the private endpoint.
- Verify if your Azure DNS Private Zone is configured and linked to the Virtual Network used by the GitLab Runner.
Common Missing Permissions
Ensure the following permissions are explicitly added if using a custom role:
-
Microsoft.Web/sites/functions/read
-
Microsoft.Web/sites/functions/write
-
Microsoft.Web/sites/functions/listkeys/action
Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.