-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource group incorrect case sensitivity on terraform apply on azurerm_app_configuration_key forces replacement #24999
Comments
Hello,
So, it appeared somewhere in between these 2 versions. |
@masterphenix Thanks for filing this issue which seems introduced from #24023, but this is API issue in the cause, see Azure/azure-rest-api-specs#24337. I'm working on fixing this issue, you need to have an ignore_changes block to workaround it for now.
|
Hello @wuxu92 , thank you for taking the time to look into this, and for the provided workaround |
I think this this issue is wider than just resourcegroup vs resourceGroup. I have also seen it with dnszone vs dnsZone. Fundamentally, if I copy an ID string from portal.azure.com and use it in my terraform, it should work AS COPIED. I should not have to edit any part of it to comply with azurerm's weird case sensitivity rules. If the problem is that portal.azure.com give different values in different places, then azurerm should not be using case sensitive matching! This issue has ranged from just irritating (with dnszone vs dnsZone, terraform at least gave me an intelligible error telling exactly what the problem was) to blocking when the error message told me that I did not have the rights necessary to destroy and recreate a security rule. It turned out that the problem was not my permissions, but azurerm seeing resourcegroup as different from resourceGroup and so deciding that it needed to destroy and recreate, when in reality the change I was trying to apply should have been a no-op! Either turn off case sensitivity or validate ALL case sensitivity rues against portal.azure.com! |
Also, I have to disagree with the tag of |
Whilst typically we try and align the two - Terraform Resources aren't guaranteed to use the same Resource ID as an Azure Resource ID - the canonical source for the Resource ID for a Terraform Resource is in the Unfortunately the Azure Portal changes casing all the time - and despite Microsoft's messaging to the contrary, there's plenty of Azure APIs which are case sensitive too - which means making things case-insensitive would actually make the problem worse in some cases (and would make those issues extremely hard to diagnose for users). The guidance from the ARM Team around casing has changed multiple times over the years, and as such has been implemented inconsistently across different endpoints across different API versions of different Services - as such unfortunately whilst the Azure APIs are supposed to be case-insensitive during Requests and case-sensitive in Responses (e.g. submit In terms of an upstream issue to track that issue within the Azure API, it's linked a few comments up. In order to workaround this, we now define a Type for each Resource ID within Whilst we have more plans around casing, unfortunately until the entire Provider is using As such whilst we've got more plans around casing once the Provider is fully onto |
@tombuildsstuff Thank you for the detailed response! That is helpful. I have added my $0.02 to the issue linked above as well. After reading through your discussion above, I now agree that the issue is And I am sure it is just as frustrating for you as it is for me! |
Is there an existing issue for this?
Community Note
Terraform Version
1.7.4
AzureRM Provider Version
3.93.0
Affected Resource(s)/Data Source(s)
azurerm_app_configuration_key
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
No changes should be detected, the resource should not be destroyed and recreated
Actual Behaviour
Terraform apply wants to recreate the azurerm_app_configuration_key
Steps to Reproduce
terraform init
terraform apply # first apply creates resources successfully
terraform apply # all subsequent apply will try to replace the existing azurerm_app_configuration_key
Important Factoids
N/A
References
No response
The text was updated successfully, but these errors were encountered: