I have an Azure DevOps pipeline that is using the task AzureFunctionApp@1 to deploy a function app.
The pipeline is using a Service Connection with a principal called devops-intg-nurseryfees-nonprod. If I check the IAM blade for the resource group of the function app, I can see that the principal has a Current role assignment of a custom role that contains an action of Microsoft.Web/sites/*
However, when the devops task runs, I get the following error:
Failed to fetch App Service 'func-nurseryFees-dev-001' details. Error: The client 'svc-principal-guid' with object id 'svc-principal-guid' does not have authorization to perform action 'Microsoft.Web/sites/read' over scope '/subscriptions/subscription-guid/resourceGroups/rg-nurseryFees-dev-001/providers/Microsoft.Web/sites/func-nurseryFees-dev-001' or the scope is invalid. If access was recently granted, please refresh your credentials. (CODE: 403)
Any ideas?