azure cli commands automatically appends git-bash path in the parameter that contains forward slash
See original GitHub issue
az feedback
auto-generates most of the information requested below, as of CLI version 2.0.62
Describe the bug While executing a azure cli command (in bash shell) that expects parameter called --scope with fully qualified name. When i pass the parameter value which starts with forward slash e.g. ‘/subscriptions/70c-xyz-35ac-/resourceGroups/rg-test-001/…’ during execution time the actual value is replaced with ‘C:/program files/Git/subscriptions/70c-xyz-35ac-/resourceGroups/rg-test-001/…’, due to this additional path in front of the param value, the command is throwing exception like Property id at path ‘properties.scopes[0]’ is invalid…
To Reproduce
az monitor metrics alert create
–name “dbalert-highCPU-001”
–scopes “/subscriptions/xyz/resourceGroups/rg-test-001/providers/Microsoft.DBforPostgreSQL/servers/psql-test”
–condition “avg cpu_percent > 90”
–description “High CPU”
–window-size 5m
–evaluation-frequency 1m
Expected behavior No additional path should be appended in front of the parameter value during CLI execution in bash shell.
Environment summary OS version - Windows 10 Shell Type - Bash on Windows
Additional context
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top GitHub Comments
This is a known issue of Git Bash that it translates a resource ID like
/subscriptions/xyz/resourceGroups/rg-test-001/providers/Microsoft.DBforPostgreSQL/servers/psql-test
to a Windows path, thus corrupting Azure CLI commands. (https://github.com/Azure/azure-cli/issues/6545#issuecomment-644025439)Please see Use Azure CLI with Git Bash for more details.
Thanks for the workaround…