question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 cli_path_issue

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
jiaslicommented, Jul 13, 2020

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.

1reaction
spatialmancommented, Jul 13, 2020

Thanks for the workaround…

Read more comments on GitHub >

github_iconTop Results From Across the Web

az tag command does not work in Visual Studio Code bash ...
Hello,. The Azure cli tag (az tag) command does not work for me in Visual Studio Code's (VSC) bash shell. I think Git...
Read more >
Azure CLI in Git Bash - Stack Overflow
Sometimes commands in windows git bash need .cmd appended. ... I have my $PATH in ~/.bashrc include ~/bin and then I created a...
Read more >
azure-cli 2.23.0 - PyPI
After installation, use the az configure command to help setup your environment. $ az configure. For usage and help content, pass in the...
Read more >
Git for Windows v2.19.1 Release Notes - GitHub Pages
If you specify command-line options starting with a slash, POSIX-to-Windows path conversion will kick in converting e.g. " /usr/bin/bash.exe ...
Read more >
User and Workspace Settings - Visual Studio Code
To open the Settings editor, use the following VS Code menu command: ... You can also have more than one root folder in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found