Skip to content
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

Private DNS RecordSet: ResourceGroup name has wrong case #6641

Open
patst opened this issue Jul 16, 2019 · 11 comments
Open

Private DNS RecordSet: ResourceGroup name has wrong case #6641

patst opened this issue Jul 16, 2019 · 11 comments
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Network - DNS Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@patst
Copy link

patst commented Jul 16, 2019

While working on a new terraform resource for a private DNS Zone A record ( hashicorp/terraform-provider-azurerm#3849 ) I stumbled across an issue with upper case resource group names.

Step to reproduce:

  • create a resource group named tesT
  • create a private DNS zone in this resource group ('testdomain.com')
  • create an A record in the private DNS zone. ('test')
  • API request: https://management.azure.com/subscriptions//resourceGroups/tesT/providers/Microsoft.Network/privateDnsZones/testdomain.com/A/test.testdomain.com?api-version=2018-09-01

The API response for the A record resource is like:

{
   "id":"\/subscriptions\/<subscription>\/resourceGroups\/test\/providers\/Microsoft.Network\/privateDnsZones\/testdomain.com\/A\/test",
   "name":"test.testdomain.com",
   "type":"Microsoft.Network\/privateDnsZones\/A",
   "etag":"bfe9801a-698e-4835-a9b5-8cd31bd3e12c",
   "properties":{
      "metadata":{

      },
      "fqdn":"test.mtestdomain.com.",
      "ttl":300,
      "aRecords":[
         {
            "ipv4Address":"10.10.10.10"
         }
      ],
      "isAutoRegistered":false
   }
}

The problem is the lower case in the id attribute for the resource group test

Expected Behaviour:

Having an id with resource group name tesT.
This is the behaviour when creating a recordset for the normal DNS zones.

@tombuildsstuff
Copy link
Contributor

@shahabhijeet any update on when this'll be fixed?

@akning-ms akning-ms added Network - DNS Service Attention Workflow: This issue is responsible by Azure service team. labels Mar 12, 2020
@ghost
Copy link

ghost commented Mar 12, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @aznetsuppgithub.

@rohinkoul
Copy link

This is expected behavior. ARM resource names are not case sensitive and application code must not rely on the case of the resourcename or resource group name.

@tombuildsstuff
Copy link
Contributor

@rohinkoul unfortunately other ARM API's can be case sensitive, meaning that unless every API and every client treat all URI's as case insensitive (which they don't), then by definition every client has to treat these as case sensitive.

It's worth mentioning that both RFC 2616 and RFC 7230 define that both URI's and Components should be treated as case-sensitive by clients - so I believe this wants fixing to match the industry best practice here?

Thanks!

@sunilkh31
Copy link

Please refer : https://docs.microsoft.com/en-us/rest/api/resources/resources/update

resourceGroupName path True
string
The name of the resource group for the resource. The name is case insensitive.

Regex pattern: ^[-\w._()]+$

ARM Resource Group Name in ARM URI is case insensitive. If you have noticed an Azure Service not abiding with this please let us know.

@lilyjma lilyjma added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Jun 16, 2020
@rohinkoul
Copy link

rohinkoul commented Jul 9, 2020

@lilyjma Please close this as won't fix. As mentioned above resourceGroup names are not case sensitive.

@tombuildsstuff
Copy link
Contributor

@rohinkoul the HTTP Specification - namely RFC7230, section 2.7.3 (and indirectly RFC 2616) state that:

The scheme and host are case-insensitive and normally provided in lowercase; all other components are compared in a case-sensitive manner.

Ultimately whilst a service itself may opt to be case-insensitive for Request URI's - per the HTTP Specification, references to URI's (e.g. in Responses) should be case-sensitive.

As such I believe this bug is valid and should remain open until this API complies with the HTTP Specification?

Thanks!

@tombuildsstuff
Copy link
Contributor

@rohinkoul for reference here's a link to the Azure API Documentation where it's clarified this is a bug in the API:

Additionally, we MUST preserve the casing provided by the user. That means we should return back the most recently specified casing to the client (and we MUST not normalize / return back a toupper/tolower form of the resource group or resource name, for example).

As such - is there a timeframe for when these casing bugs will be fixed?

Thanks!

@tombuildsstuff
Copy link
Contributor

It's worth noting this also appears to affect the Virtual Network Peering API's: hashicorp/terraform-provider-azurerm#8289

@rohinkoul
Copy link

@karravi-msft could you take a look and if necessary add this to our backlog.

@wuxu92
Copy link

wuxu92 commented Dec 11, 2023

Hi @rohinkoul @karravi-msft Any update on this? It has been years since last update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Network - DNS Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

8 participants