Authorization error when trying to list secrets in Azure Container Apps

PS 150 Reputation points
2024-06-19T09:07:10.27+00:00

We are getting below mentioned authorization error when trying to list secrets using Azure golang sdk.

RESPONSE 403: 403 Forbidden
ERROR CODE: AuthorizationFailed
--------------------------------------------------------------------------------
{
  "error": {
    "code": "AuthorizationFailed",
    "message": "The client 'xxxx' with object id 'xxxx' does not have authorization to perform action 'Microsoft.App/containerApps/listSecrets/action' over scope '/subscriptions/xxxx/resourceGroups/xxxx/providers/Microsoft.App/containerApps/xxxx' or the scope is invalid. If access was recently granted, please refresh your credentials."
  }
}
--------------------------------------------------------------------------------

Can anyone suggest the specific role that needs to be added to list secrets?

I have added system-assigned managed identity to the Azure Container app.
The system assigned identity Reader role at the Resource group scope

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
323 questions
{count} votes