Hi @Revital Blum,
Thanks for reaching out on Microsoft Q&A.
I understand your concern about seeing inconsistent casing in the Azure API responses for some subnets. Let me clarify how this works.
Resource and resource group names in Azure are case-insensitive, so whether you see /subnets/PORTLAND-SUB-1
or /subnets/portland-sub-1
, both resolve to the same subnet. This is documented in Azure Resource Naming Rules:
When using various APIs to retrieve the name for a resource or resource group, the returned value may have different casing than what you originally specified for the name. The returned value may even display different case values than what is listed in the valid characters table. Always perform a case-insensitive comparison of names.
The reason you’re seeing uppercase only for certain subnets is likely because of how they were first created or referenced. Different Azure resource providers serialize names slightly differently—for example, the NetworkSecurityGroups API may return the casing that was originally used when the subnet–NSG association was created, while the VirtualNetworks API shows the casing persisted in the VNet definition.
There’s no functional impact here, but if you need consistency for automation, the recommended approach is to normalize casing in your code.
Always perform a case-insensitive comparison of names.
As suggested, you can either make the entire resource ID lower case or upper case and further pass the new value to subsequent functions/application within your code.
Reference: Sensitivity Issue with Resource ID in Azure SDK API Calls
Kindly let us know if the above helps or you need further assistance on this issue.