Closed rohrerb closed 5 years ago
9 times out of 10 you end up with...
1 error occurred:
* module.version-windows-com.azurerm_shared_image_version.version: 1 error occurred:
* azurerm_shared_image_version.version: Error waiting for the creation of Shared Image Version "1.0.1" (Image "Windows" / Gallery "global_image_gallery" / Resource Group "Global"): azure.BearerAuthorizer#WithAuthorization: Failed to refresh the Token for request to https://management.azure.com/subscriptions/7d559a72-xxxx-xxxx-xxxx-5ca5b14a25e7/providers/Microsoft.Compute/locations/uksouth/capsOperations/c29a9c25-xxxx-xxxx-xxxx-6bcef62f9ea9?api-version=2018-06-01: StatusCode=0 -- Original Error: Manually created ServicePrincipalToken does not contain secret material to retrieve a new access token
hi @rohrerb
Thanks for opening this issue :)
Deployments for azurerm_shared_image_version can take 30 minutes to a hour due to terraform waiting for the image replication to complete. Is it possible for terraform to create he resource and complete without waiting for replication to multiple regions.
Terraform intentionally waits (ignoring bugs) for a resource to be fully provisioned so that it's possible to chain resources together (to for instance, create a Virtual Machine then add it to a Load Balancer) - as such unfortunately that's not an approach we'd taken.
Taking a look into this, the root cause of this appears to be https://github.com/hashicorp/go-azure-helpers/issues/22 which I'm going to close this in favour of. In addition once version 2.0 of the Azure Provider becomes available you'll be able to use custom timeouts for resources to set a timeout as needed.
Thanks!
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!
Community Note
Description
Deployments for
azurerm_shared_image_version
can take 30 minutes to a hour due to terraform waiting for the image replication to complete. Is it possible for terraform to create he resource and complete without waiting for replication to multiple regions.New or Affected Resource(s)
azurerm_shared_image_version
Example Terraform Configuration