hashicorp / go-azure-sdk

An opinionated Go SDK for Azure Resource Manager
Mozilla Public License 2.0
33 stars 41 forks source link

Issue with `Network@2023-02-01`: generated Resource ID case issue of `applicationGatewayWebApplicationFirewallPolicies` #538

Closed wuxu92 closed 1 year ago

wuxu92 commented 1 year ago

Is there an existing issue for this?

Community Note

Service Used

Network

API Versions Used

2022-09-01, 2022-11-01 and 2023-02-01

Description

the ApplicationGatewayWebApplicationFirewallPolicies segment starts with UpperCase but the generated SDK ID() method is lower-cased. Is this a by-design?

https://github.com/hashicorp/go-azure-sdk/blob/0ce40a779dcb50dff4dacc5c3c3bc2745fe01bfb/resource-manager/network/2023-02-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go#L101

swagger definition:

https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/webapplicationfirewall.json#L122-L127

    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}": {
      "get": {
        "tags": [
          "WebApplicationFirewallPolicies"
        ],
        "description": "Retrieve protection policy with specified name within a resource group.",
        "operationId": "WebApplicationFirewallPolicies_Get",

References

No response

tombuildsstuff commented 1 year ago

@wuxu92 yes, per the ARM Specification Resource ID Keys are supposed to be camelCased, therefore hashicorp/pandora fixes any data issues such that these are normalized to be camelCased rather than TitleCased or lowercased - as such this is working as intended.

If a resource has shipped within Terraform using the incorrect Resource ID then we'll need to include a State Migration to account for updating this from the older format to the newer format - and ensure that Read functions parsing this Resource ID are parsing this case-insensitively.