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

az ad app permission admin-consent gives 400 Client Error: Bad Request #60171

Closed
kumarg25 opened this issue Aug 3, 2020 · 5 comments
Closed

Comments

@kumarg25
Copy link

kumarg25 commented Aug 3, 2020

[Enter feedback here]
Trying to create AAD integrated cluster [following - https://docs.microsoft.com/en-us/azure/aks/azure-ad-integration-cli] however, when I ran az ad app permission admin-consent --id $serverApplicationId I am getting below error:-

az ad app permission admin-consent --id $serverApplicationId
The command failed with an unexpected error. Here is the traceback:

400 Client Error: Bad Request for url: http://localhost:50342/oauth2/token
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 215, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 654, in execute
raise ex
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 718, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 709, in _run_job
cmd_copy.exception_handler(ex)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/role/commands.py", line 69, in graph_err_handler
raise ex
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 688, in _run_job
result = cmd_copy(params)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 325, in call
return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/init.py", line 776, in default_command_handler
return op(**command_args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/role/custom.py", line 907, in admin_consent
send_raw_request(cmd.cli_ctx, 'post', url, resource='74658136-14ec-4630-ad9b-26e160ff0fc6')
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/util.py", line 770, in send_raw_request
token_info, _, _ = profile.get_raw_token(resource)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/_profile.py", line 643, in get_raw_token
creds = self._get_token_from_cloud_shell(resource)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/_profile.py", line 391, in _get_token_from_cloud_shell
auth = MSIAuthenticationWrapper(resource=resource)
File "/opt/az/lib/python3.6/site-packages/msrestazure/azure_active_directory.py", line 592, in init
self.set_token()
File "/opt/az/lib/python3.6/site-packages/msrestazure/azure_active_directory.py", line 598, in set_token
self.scheme, _, self.token = get_msi_token(self.resource, self.port, self.msi_conf)
File "/opt/az/lib/python3.6/site-packages/msrestazure/azure_active_directory.py", line 486, in get_msi_token
result.raise_for_status()
File "/opt/az/lib/python3.6/site-packages/requests/models.py", line 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


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@TomGeske
Copy link
Contributor

TomGeske commented Aug 3, 2020

This is a known issue in cloud shell. Can you try to re-run on your local machine?

/Azure/azure-cli#9345

@kumarg25
Copy link
Author

kumarg25 commented Aug 4, 2020

@TomGeske thank you for the help. Let me try it and I will update you

@Karishma-Tiwari-MSFT
Copy link
Member

@kumarg25 Did it resolve your issue? Let us know. Thanks.

@kumarg25
Copy link
Author

kumarg25 commented Aug 6, 2020

@Karishma-Tiwari-MSFT Yes, running the commands from local machine worked.

@Karishma-Tiwari-MSFT
Copy link
Member

Thanks for sharing the update.
We will now close this issue. If there are further questions regarding this matter, please tag me in a comment. I will reopen it and we will gladly continue the discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants