Open ludimax opened 3 months ago
I am also running into the same issue.
Hi @ludimax , the provider will try to list the resource provider registration in the subscription in order to
1) register certain resource provider , this is controlled by skip_provider_registration
inside provider block
2) enable enhanced validation for resource provider, this can be controlled by ARM_PROVIDER_ENHANCED_VALIDATION
env variable, which defaults to true
Seems after the PR https://github.com/hashicorp/terraform-provider-azurerm/pull/26630/files#diff-5a6fd8b8e9a3c349fc532826972d39b180350c4b1f5c9cf4c5b9e0bb31afec21R27, list resource provider only skips if RP registration and enhanced validation are not both disabled, so in conclusion, you need to set both skip_provider_registration=false
and the env variable ARM_PROVIDER_ENHANCED_VALIDATION=false
to avoid this error.
But you mentioned the provider alias az_iaas
is not used, I suggest to comment or remove the provider block from Terraform config file.
Thanks.
I do not think adding an env variable is a sensible solution but rather a costly workaround. I suppose there is a good reason that var's default value is set to TRUE and have been working for all us for many years.
Is there an existing issue for this?
Community Note
Terraform Version
1.9.3
AzureRM Provider Version
3.114.0
Affected Resource(s)/Data Source(s)
provider block
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
This alias not being used, in this case it fails because the identity that does do the actual TF plan, has no permissions on that specific subscription.
Actual Behaviour
Alias is used, in our case wil give an error because there's no permissions to that subscription
Steps to Reproduce
Important Factoids
No response
References
No response