Cannot create service principal
See original GitHub issueThis is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az ad sp create-for-rbac
I ran this and got the below error. The 2 variables referenced did indeed have the correct value:
ARM_CLIENT_SECRET=$(az ad sp create-for-rbac
–name http://ansible-sp-$UNIQUE_ID
–role Contributor
–scopes “/subscriptions/$ARM_SUBSCRIPTION_ID”
–query password
–output tsv)
Errors:
400 Client Error: Bad Request for url: http://localhost:50342/oauth2/token
Traceback (most recent call last):
python3.6/site-packages/knack/cli.py, ln 215, in invoke
cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 654, in execute
raise ex
cli/core/commands/__init__.py, ln 718, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
cli/core/commands/__init__.py, ln 709, in _run_job
cmd_copy.exception_handler(ex)
...
python3.6/site-packages/msrestazure/azure_active_directory.py, ln 486, in get_msi_token
result.raise_for_status()
python3.6/site-packages/requests/models.py, ln 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://localhost:50342/oauth2/token
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- Put any pre-requisite steps here…
az ad sp create-for-rbac --name {} --role {} --scopes {} --query {} --output {}
Expected Behavior
Environment Summary
Linux-4.15.0-1089-azure-x86_64-with-debian-stretch-sid
Python 3.6.10
Installer: DEB
azure-cli 2.7.0
Additional Context
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
cannot create service principal from Azure Portal once it's ...
The issue is I, as a global admin/Applicaion admin, cannot "Create Service Principal" once its deleted.
Read more >Could not create a service principal with the right permissions
1 Answer 1 ... Your login account should has Owner or Contributor role for your subscription. You could check it on Azure Portal....
Read more >Create a Service Principal to create and manage other ...
First, you need to create the 'administrator' service principal. I'm using the built-in Owner role for this, but you would be wise to...
Read more >Create a Microsoft Azure service principal
By default, an Microsoft Azure service principal has the Contributor role. The Contributor role cannot assign policy to a resource group. Assign the...
Read more >Configuring a User or Service Principal to manage Azure ...
Azure Active Directory permissions ... Now that you have created and authenticated an Application / Service Principal pair, you will need to grant...
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
Thanks @djcornutt . This is a known issue in Cloudshell due to #11749. Cloudshell team is working on it. A workaround is to run
az login
again.Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @maertendMSFT.