Azure / azure-cli

Azure Command-Line Interface
MIT License
3.96k stars 2.94k forks source link

Tag update command not escaping resource id when it contains parentheses #18078

Open TeamDman opened 3 years ago

TeamDman commented 3 years ago

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name

az tag update --resource-id "/subscriptions/redacted/resourceGroups/redacted/providers/Microsoft.OperationsManagement/solutions/WireData2(CORE-CACN-LAW)" --operation "delete" --tags "Cost-center=0"

Errors:

--operation was unexpected at this time.
C:\Users\User\Downloads\Azure%20Cloud%20Operations\Operations Scripts\TagManagement-v2>  "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\\..\python.exe" -IBm azure.cli tag update --resource-id /subscriptions/redacted/resourceGroups/redacted/providers/Microsoft.OperationsManagement/solutions/WireData2(CORE-CACN-LAW) --operation delete --tags Cost-center=0

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Expected Behavior

Tags should be updated successfully.
Presumably, the internal invocation of python should be quoting the resource id parameter?

Environment Summary

Windows-10-10.0.18362-SP0
Python 3.8.9
Installer: MSI

azure-cli 2.23.0

Additional Context

yonzhan commented 3 years ago

ARM

ghost commented 3 years ago

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

Issue Details
### **This is autogenerated. Please review and update as needed.** ## Describe the bug **Command Name** ``` az tag update --resource-id "/subscriptions/redacted/resourceGroups/redacted/providers/Microsoft.OperationsManagement/solutions/WireData2(CORE-CACN-LAW)" --operation "delete" --tags "Cost-center=0" ``` **Errors:** ``` --operation was unexpected at this time. C:\Users\User\Downloads\Azure%20Cloud%20Operations\Operations Scripts\TagManagement-v2> "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\\..\python.exe" -IBm azure.cli tag update --resource-id /subscriptions/redacted/resourceGroups/redacted/providers/Microsoft.OperationsManagement/solutions/WireData2(CORE-CACN-LAW) --operation delete --tags Cost-center=0 ``` ## To Reproduce: Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information. - Find a resource with a paren in the resourceId - Try and use the `az tag update` command on the resource ## Expected Behavior Tags should be updated successfully. Presumably, the internal invocation of python should be quoting the resource id parameter? ## Environment Summary ``` Windows-10-10.0.18362-SP0 Python 3.8.9 Installer: MSI azure-cli 2.23.0 ``` ## Additional Context
Author: TeamDman
Assignees: zhoxing-ms
Labels: `ARM`, `Service Attention`
Milestone: S188
zhoxing-ms commented 3 years ago

@Grayer123 Could you please help to have a look at this issue~

mxrss2 commented 3 years ago

this is breaking my stuff interogating the az lock show command I get this result.


C:\Users\mike\.work\.projects\work\infra-pre-refactor>echo Failed to load python executable.
Failed to load python executable.
{
  "azure-cli": "2.27.0",
  "azure-cli-core": "2.27.0",
  "azure-cli-telemetry": "1.0.6",
  "extensions": {
    "account": "0.2.1",
    "azure-devops": "0.20.0",
    "desktopvirtualization": "0.1.1",
    "log-analytics": "0.2.2",
    "resource-graph": "2.1.0",
    "subscription": "0.1.4"
  }
}