You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.
Error: creating Custom Domain (Subscription: "***"
│ Resource Group Name: "***"
│ Static Site Name: "***"
│ Custom Domain Name: "***"): polling after CreateOrUpdateStaticSiteCustomDomain: unexpected status 403 (403 Forbidden) with error: AuthorizationFailed: The client '***' with object id '***' does not have authorization to perform action 'Microsoft.Web/locations/operationResults/read' over scope '/subscriptions/***/providers/Microsoft.Web/locations/***/operationResults/***' or the scope is invalid. If access was recently granted, please refresh your credentials.
│
│ with module.static_web_app.azurerm_static_web_app_custom_domain.main[0],
│ on .terraform/modules/static_web_app/mymodules/SWA/main.tf line XX, in resource "azurerm_static_web_app_custom_domain""main":
│ XX: resource "azurerm_static_web_app_custom_domain""main" {
│
│ creating Custom Domain (Subscription:
│ "***"
│ Resource Group Name: "***"
│ Static Site Name: "***"
│ Custom Domain Name: "***"): polling after
│ CreateOrUpdateStaticSiteCustomDomain: unexpected status 403 (403 Forbidden)
│ with error: AuthorizationFailed: The client
│ '***' with object id
│ '***' does not have authorization to
│ perform action 'Microsoft.Web/locations/operationResults/read' over scope
│ '/subscriptions/***/providers/Microsoft.Web/locations/***/operationResults/***'
│ or the scope is invalid. If access was recently granted, please refresh
│ your credentials.
╵
##[error]Error: The process '/opt/agent
Expected Behaviour
Add a custom domain on an existing Static Web App (managed by Terraform) behind a private endpoint.
The user executing it is owner on the RG.
Actual Behaviour
The Terraform apply failed with this error but the Custom Domain is correctly created.
So by running the plan again we see the error :
│ Error: A resource with the ID "/subscriptions/***/resourceGroups/***/providers/Microsoft.Web/staticSites/***/customDomains/***" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_static_web_app_custom_domain" for more information.
Steps to Reproduce
No response
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered:
@jcamu The first error you saw indicates your SP running the terraform lack of the role Microsoft.Web/locations/operationResults/read. While as you've mentioned you are running as the subscription owner, then I'd suggest you to retry and see if it is a systematic issue. If yes, please reach out to Azure support team to see why.
For the second error, that happens since your first apply has successfully sent the create request for the custom domain resource, it just failed during polling. As the error message indicated, please import the resource and run terraform plan to see if everything is working. Alternatively, you can re-create it by tainting this resource via terraform taint, and run terraform apply again.
Thanks for the reply. I have indeed retried with same error.
The error is necessarily from Azure ? It can't be from the Terraform module ?
Manually i can create from the portal this custom domain with a user having owner right on the RG. (The SP run as RG owner)
The second error was just to illustrate that the creation was a success.
Is there an existing issue for this?
Community Note
Terraform Version
1.9.0
AzureRM Provider Version
4.5.0
Affected Resource(s)/Data Source(s)
azurerm_static_web_app_custom_domain
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Add a custom domain on an existing Static Web App (managed by Terraform) behind a private endpoint.
The user executing it is owner on the RG.
Actual Behaviour
The Terraform apply failed with this error but the Custom Domain is correctly created.
So by running the plan again we see the error :
│ Error: A resource with the ID "/subscriptions/***/resourceGroups/***/providers/Microsoft.Web/staticSites/***/customDomains/***" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_static_web_app_custom_domain" for more information.
Steps to Reproduce
No response
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: