Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTPError: 400 Client Error: Bad Request for url: http://localhost:50342/oauth2/token #12559

Closed
OrionGG opened this issue Mar 12, 2020 · 2 comments
Assignees
Labels
Milestone

Comments

@OrionGG
Copy link

OrionGG commented Mar 12, 2020

Describe the bug

Command Name
az ad sp create-for-rbac

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 206, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 608, in execute
    raise ex
cli/core/commands/__init__.py, ln 666, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
...
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-1071-azure-x86_64-with-debian-stretch-sid
Python 3.6.5

azure-cli 2.2.0

Additional Context

@yungezz
Copy link
Member

yungezz commented Mar 12, 2020

HI @OrionGG could you pls share context ? from exception, it's talking to localhost and get msi token

@yungezz yungezz added this to the S168 milestone Mar 12, 2020
@arrownj
Copy link
Contributor

arrownj commented Apr 21, 2020

Hi @OrionGG , is this run in Cloud Shell ? If yes, this should be a known issue of Cloud Shell. There are several similar issues before. You can reference #9345 to get a workaround solution. Normally, you need run az login. I will close this issue first, if you have other problems, you can reopen it. Thanks

@arrownj arrownj closed this as completed Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants