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 login and az --version very slow #27796

Closed
oshihirii opened this issue Nov 8, 2023 · 3 comments
Closed

az login and az --version very slow #27796

oshihirii opened this issue Nov 8, 2023 · 3 comments
Assignees
Labels
Account az login/account Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone

Comments

@oshihirii
Copy link

Describe the bug

Same issue described here:

#9852

I run:

az login

It returns:

A web browser has been opened at https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`.

My browser opens, I enter in my credentials, the browser message is "You have logged into Microsoft Azure!".

The message in the terminal stays the same, i.e:

A web browser has been opened at https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`.

When I run this in another terminal, nothing happens:

func azure functionapp publish MyFunctionAppName

This was initially going to be a bug report about az login not working, but it actually does work, if I leave the az login for several minutes.

Related command

az login and az --version

Errors

No errors

Issue script & Debug output

I am not running a script

Expected behavior

I expected that when browser shows login success, the terminal will show that az login completed successfully and I am logged in.

Environment Summary

even running az --version takes a very long time, it took about 2 minutes to return:

$ az --version
azure-cli                         2.53.1

core                              2.53.1
telemetry                          1.1.0

Dependencies:
msal                            1.24.0b2
azure-mgmt-resource             23.1.0b2

Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\ME\.azure\cliextensions'

Python (Windows) 3.10.10 (tags/v3.10.10:aad5f6a, Feb  7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

Additional context

No response

@oshihirii oshihirii added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Nov 8, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Account az login/account labels Nov 8, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 8, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Nov 8, 2023

Thank you for opening this issue, we will look into it.

@oshihirii
Copy link
Author

oshihirii commented Nov 8, 2023

FYI, func start is also taking a couple of minutes to output the local function endpoint URLs.

func azure functionapp publish myFunctionApp also takes several minutes to run.

@yonzhan yonzhan added this to the Backlog milestone Nov 8, 2023
@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Nov 8, 2023
@jiasli
Copy link
Member

jiasli commented Nov 8, 2023

az login finds all tenants and subscriptions that the signed-in account has access to. The process can be slow if you have a bad network connection. You may add --debug to see what az login is doing internally.

If the account can access multiple tenants, you may specify --tenant <tenant_id> in az login to limit the scope of subscription finding so that only subscriptions under the specified tenant is retrieved.

There is a feature request #14933 for adding --subscription to az login in order to bypass subscription finding.

az --version finds the latest version information from GitHub (#27437). It can be slow if you have a bad network connection. You may use az version as an alternative as this command doesn't make any network request.

As for func (Azure Functions Core Tools), it is not maintained by Azure CLI. You may report your issue to https://github.com/Azure/azure-functions-core-tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Account az login/account Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants