Creation of management group is failed when using azurerm with Service Principal authentication schema due to 403 error in GET request of management group after received its "Succeeded" status #7465
Labels
Milestone
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_management_group
Terraform Configuration Files
Debug Output
https://gist.github.com/oleksandrkudin/d7fb8026797bfde5287a54617ba4eb8a
Panic Output
Expected Behavior
Management Group is created and resource added to Terraform state
Actual Behavior
Management Group is created in Azure as resource as well as "Succeeded" creation status received successfully but after this last GET HTTP request perfomed by azurerm for final verification is failed with 403 (Forbidden) code and so whole management group creation process is failed with next Terraform error.
Terraform error:
Fragment from DEBUG (sucessfull "Succeeded" creation status + 403 error code for GET request after this)
Making manual
GET https://management.azure.com/providers/Microsoft.Management/operationResults/create/managementGroups/dr11-h-mg?api-version=2018-03-01-preview
request by using last received access_token from Terraform DEBUG output returns 200 OK and management group description.Steps to Reproduce
terraform init
terraform apply
Important Factoids
azurerm_management_group.top_mg
is failed, but sometimesazurerm_management_group.top_mg
is created but one of nested to top_mg management group is failed. 1 of 5terraform apply
attempts may be successful without any errors.References
The text was updated successfully, but these errors were encountered: