-
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
Azure API Resource Group casing change calling for resource replacement #8289
Comments
hey @i-m-wisch Thanks for opening this issue. Whilst this API treats the Resource Group name as case-insensitive in the Request URI - it should be case-sensitive in the response - so unfortunately this is a bug in the Azure API here (as such I've tagged this with "upstream-microsoft") - once that's fixed Terraform should pick this up automatically. Thanks! |
Hi @tombuildsstuff, in my support case with Microsoft, they are not backing down from their stance that resource names are case-insensitive, and referenced this page Resource Name Rules.
They are stating that the sudden change from actual case, to lower, only in the Subnet and VNet Resource ID responses are "expected behavior", and that they "expect management tools to comply with the documented behavior of the platform.", referring to the Terraform AzureRM provider. |
@i-m-wisch unfortunately that's not strictly true - the Azure API's (per the ARM Specification, and the ARM Team) are supposed to follow Postel's Law, that is, it should accept any case but return the canonical casing (e.g. accept As such unfortunately this is an issue within the Networking API that needs to be resolved - since this is being tracked in Azure/azure-rest-api-specs#6641 I'm going to close this issue in favour of that one - would you mind subscribing to that for updates? Thanks! |
@tombuildsstuff Something changed in the 2.48 release of the AzureRM provider. Testing with both 2.48 and 2.49 the resource group names come back in the correct camel case:
With 2.47 prior we are seeing the lower case resource group names and no changes. |
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 👉 [email protected]. Thanks! |
Community Note
Terraform (and AzureRM Provider) Version
Started with:
Terraform v0.12.28
provider.azurerm v1.44.0
Also Tested with:
Terraform v0.12.28
provider.azurerm v2.25.0
Affected Resource(s)
azurerm_virtual_network_peering
Terraform Configuration Files
Example portion of the module definition
Debug Output
Panic Output
Expected Behavior
Terraform treats the Resource Group Name as case insensitive just like the Azure API, and sees there are no changes required for the pre-existing virtual_network_peering resources.
Actual Behavior
Terraform wants to replace all virtual_network_peering resources because the API is now returning the Resource Group Name in the remote_virtual_network_id as lower case. This id is provided by the azurerm_virtual_network data source.
Steps to Reproduce
Have virtual_network_peerings that pre-date the change.
terraform plan
to gather required changes orterraform apply
to update the infrastructure.Important Factoids
References
Resource Group Name is case insensitive in the URI:
https://docs.microsoft.com/en-us/rest/api/resources/resources/get#uri-parameters
API Issue on if this should be the case:
Azure/azure-rest-api-specs#6641
The text was updated successfully, but these errors were encountered: