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
Compute and Network services return resource IDs with different casing #8283
Comments
If I understand correctly, the issue you are experiencing is that the VM IDs that comes back from VM list and the VM IDs that are associated with the NICs have different casing. Is that right? The global |
I tested by getting VM info using az vm list and NIC by az network nic list. The fact is that the resource ID gives case-sensitive differently Below is from az vm list:
and below is from az network nic list
Look at the resource group name. With this issue, when looking up NIC using VM ID it returns null. |
A workaround (perharp specific to my case to query private IP address) is to go with NIC resource ID and networkProfile property as follows:
It returned expected result without case-sensitive issue |
Thanks @thuansoldier. I'll keep this issue open as the services should ideally be returning consistent casing for resource IDs. |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @aznetsuppgithub |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @mjconnection, @Drewm3 |
The name of the resource groups returned through a VM List operation will always be upper-cased. This is the currently designed and expected behavior for VM List when no resource group is provided. When a resource group is provided then the response will use the casing of the resource group that was provided in the API. The Resource URIs are not case sensitive. So when comparing any two resource URIs to determine if they are the same resource, then we recommend using a to_upper() or to_lower() function to get consistent casing of the URIs before the compare. Azure does not support two URIs that are exactly the same except for casing. |
Describe the bug
When running
az network nic list --query "[?virtualMachine.id=='<ID>']"
the CLI processes case-sensitive.To Reproduce
You'd need to look up Private IP Address by VM ID
Expected behavior
It should not handle case-sensitive.
Environment summary
Azure CLI version 2.0.43
The text was updated successfully, but these errors were encountered: