I’m encountering an AuthorizationFailed
error when trying to list secrets for a static site using Terraform v1.8.0 and Azurerm provider v3.105.0. The error message is as follows:
Error: listing secrets for Static Site: (Name “mbr-portal-cfga-tst-us-c-webapp” / Resource Group “mbr-portal-tst-us-c-rg”): web.StaticSitesClient#ListStaticSiteSecrets: Failure responding to request: StatusCode=403 — Original Error: autorest/azure: Service returned an error. Status=403 Code=”AuthorizationFailed” Message=”The client ” with object id ” does not have authorization to perform action
Steps to Reproduce:
- Upgrade to Terraform v1.8.0 and Azurerm provider v3.105.0.
- Attempt to list secrets for a static site using Terraform.
- Encounter the above authorization error.
Troubleshooting Steps Taken:
- Verified the service principal or managed identity being used by Terraform.
- Ensured the correct role (e.g.,
Contributor
) is assigned to the client ID. - Verified the role assignment using Azure CLI.
- Reapplied Terraform configuration after making manual changes to permissions.
Despite these steps, the error persists.
Expected Behavior:
Terraform should list the static site secrets without encountering an authorization error.
Actual Behavior:
Terraform throws a 403 AuthorizationFailed
error while attempting to list static site secrets.
Additional Context:
The issue began after upgrading to Terraform v1.8.0 and Azurerm provider v3.105.0. Prior versions did not exhibit this behavior.
.
References
- Azure Role-Based Access Control (RBAC) Documentation
- Terraform AzureRM Provider Documentation
- Azure CLI Documentation