Closed Romiko closed 1 month ago
The cause is from another module.
Hi @Romiko ,
Thank you for taking time to report this issue!
The cause is from another module.
Does this mean that you have found the cause? The azapi_resource is able to create the resource in one PUT request, the tags should be in the request body if specified in the config.
I'll close this issue as there's no response and it seems to be fixed. Feel free to reopen this issue if there's any question.
If we try to create a resource group in a subscription with an Azure Policy requiring mandatory tags for the resource group, it will fail. Seems Azapi is doing a two stage create / update. Possible fix is to apply tags upon creation?
Workaround - Use AzureRM instead of Azap.
[error]Bash wrote one or more lines to the standard error stream.
[error]2024-05-09T23:11:30.191Z [ERROR] provider.terraform-provider-azapi_v1.13.1: Response contains error diagnostic: tf_provider_addr=registry.terraform.io/Azure/azapi tf_resource_type=azapi_resource @caller=github.com/hashicorp/terraform-plugin-go@v0.22.1/tfprotov6/internal/diag/diagnostics.go:58 diagnostic_detail="creating/updating Resource: (ResourceId "/subscriptions/xyz/resourceGroups/rg-xyz-test-001" / Api Version "2021-04-01"): PUT https://management.azure.com/subscriptions/xyz/resourceGroups/rg-xyz-test-001
RESPONSE 403: 403 Forbidden ERROR CODE: RequestDisallowedByPolicy