[az ad sp create-for-rbac] Command doesn't work in git bash on windows, works fine on cmd
See original GitHub issue
az feedback
auto-generates most of the information requested below, as of CLI version 2.0.62
Related command
az ad sp create-for-rbac --name="sp-test" --role="Contributor" --scopes="/subscriptions/<subscription_id>" --sdk-auth --only-show-errors
Describe the bug Running the command above on Git Bash terminal fails with the error shown below. The exact same command works when run in regular cmd terminal.
To Reproduce
- On a windows machine with Git For Windows installed, open a Git Bash terminal
- Run the command:
az ad sp create-for-rbac --name="sp-test" --role="Contributor" --scopes="/subscriptions/<subscription_id>" --sdk-auth --only-show-errors
Expected behavior The command works the same, whatever the terminal.
Environment summary
Freshly installed Azure CLI on a Windows 10 machine.
az --version
azure-cli 2.42.0
core 2.42.0
telemetry 1.0.8
Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\sinedied\.azure\cliextensions'
Python (Windows) 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:37:59) [MSC v.1933 32 bit (Intel)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context On a 3h workshop where we’re using Azure CLI to provision the whole infrastructure, this is the only command not working on a git Bash terminal. Here’s the workshop for context: https://azure.github.io/aca-java-runtimes-workshop/#creating-an-azure-service-principal
Issue Analytics
- State:
- Created a year ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
When I run az ad sp create-for-rbac --sdk-auth > my.azureauth ...
By default, this command assigns the 'Contributor' role to the service principal at the subscription scope.
Read more >github api does not work in git bash, but in cmd it does
Hello when I am testing the github api in Git Bash everything works fine until I use this command:
Read more >Using secrets from Azure Key Vault in a pipeline
A service principal is automatically created by Azure Pipeline when you connect to an ... az ad sp create-for-rbac -n ServicePrincipalName.
Read more >Git on the command line - GitLab Docs
To execute Git commands on your computer, you must open a terminal (also known as command prompt, command shell, and command line). Here...
Read more >Working with Git Bash Commands - phoenixNAP
An easy tutorial on how to use the Git Bash terminal in Windows. Git Bash emulates the Unix bash shell, providing a command-line...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No, it only works in Git Bash.
Thanks for the workaround suggestion. Does this work on all platforms?