Giter Club home page Giter Club logo

Comments (2)

jccasinger avatar jccasinger commented on May 29, 2024

I found the solution. Running az tag with --debug showed the $PATH variable was being prepended to the resource ID. Searching for "azure vsc path appearing in az cli resource-id" turned up the following:

  https://github.com/Azure/azure-cli/issues/14299       "azure cli commands automatically appends git-bash path in the parameter that contains forward slash"

...which in turn pointed me to:

  https://github.com/fengzhou-msft/azure-cli/blob/ea149713de505fa0f8ae6bfa5d998e12fc8ff509/doc/use_cli_with_git_bash.md  -  "Use Azure CLI with Git Bash"

This identified the problem as a known issue and explained how to remediate/mitigate. Here is the pertinent excerpt:

"Auto-translation of Resource IDs
On Git Bash, if you specify command-line options starting with a slash, POSIX-to-Windows path conversion will kick in. This causes an issue for passing ARM Resource IDs, like:

To disable the path conversion. You can set enviroment variable MSYS_NO_PATHCONV=1 or set it temporarily when a running command:"

MSYS_NO_PATHCONV=1 az vm show --ids "/subscriptions/00.../resourceGroups/my-rg/providers/Microsoft.Compute/virtualMachines/my-vm"

I tried prepending and it worked, as does putting export MSYS_NO_PATHCONV=1 in your script.

So it wasn't an Az CLI issue at all, but a Git Bash issue.

Adam

from vscode-azurecli.

chrmarti avatar chrmarti commented on May 29, 2024

Thanks, closing as resolved.

from vscode-azurecli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.