Closed xtianus79 closed 3 years ago
Are you seeing anything when run az account list
? It is possible that the credential used to login has no subscriptions.
Terminal client type should not matter.
Please reactivate with more details
Hi @yugangw-msft , I'm facing the same message here. Can you help me, please? I'm trying to use the client from an Azure CentOS VM.
"az account list" outputs:
Please run "az login" to access your accounts. []
"az login" outputs:
To sign in, use a web browser to open the page https://aka.ms/devicelogin and enter the code 10CHARCODE to authenticate. # I go to the browser and authenticate then the cli shows: Unexpected polling state invalid_request
The client works from my notebook, but I needed to use the cli from an Azure VM.
CLI Version: What version of the CLI and modules are installed? (Use az --version) Answer here: azure-cli (2.0.24)
OS Version: What OS and version are you using? Answer here: CentOS Linux release 7.4.1708 (Core)
Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows) Answer here: bash
Thanks
We would also be highly interested in the solution if there is one ...
thanks!
This is the same with #6095
Ah, if it is a dupe I will close it again.
Same error - I signed up to Free trial subscription. I can login from browser, and Account Center indicates I have 1 subscription active ('Free trial').
But AZ Cli (installed in Opensuse Tumbleweed using sudo zypper) and using bash shell from 'portal.azure.com' - both report the same error: 'Please run az login to setup account'
@bytesemantics, could you run az login --debug
and share the result to me jiasli at microsoft.com?
At the same time, could you check if there is anything in ~/.azure/azureProfile.json
?
I was tempted to ask for this issue to be closed. I was using Chrome, and having read a linked ticket talking about Chrome and MFA issues, I thought I'd try Firefox. Logged in successfully in Firefox and noticed the Auth flow was different to chrome.
Restarted Chrome and logged in successfully.
I can understand this may not be easy to replicate - But from an end users perspective (particularly someone who is evaluating Azure as an alternate to GCP/AWS) - this is not something we should experience and Tech team need to solve it.
Glad to know it is solved.
Usually, this is caused by outdated AAD cache in Chrome. In such case, az login
will show a warning then continue with the next tenant or exit, instead of raising an error:
As it is hard to reproduce, it is also difficult for us to get the server-side error. It'll be great if you can share the warning message when you see it. It will help us refine the client-side message. Thanks!
I get this error and using firefox does not fix it. I also am not allowed to share logs.
@JCCChris, could you try cleaning the browser cache? If the issue persists, do you mind sharing the --debug
log to jiasli at microsoft.com?
Using incognito mode worked. It seems like a problem with microsoft identity with cacheing unrelated to chrome or firefox. Both were affected. On previous attempts in both browsers, it did not ask for multifactor authentication.
Hi @JCCChris, does clearing the browser cache fix this issue? I believe clearing the cache does the same thing as using incognito mode.
In my case after logging in with az login --allow-no-subscriptions
I was able to log in successfully and see my users details with az account list
I was tempted to ask for this issue to be closed. I was using Chrome, and having read a linked ticket talking about Chrome and MFA issues, I thought I'd try Firefox. Logged in successfully in Firefox and noticed the Auth flow was different to chrome.
Restarted Chrome and logged in successfully.
I can understand this may not be easy to replicate - But from an end users perspective (particularly someone who is evaluating Azure as an alternate to GCP/AWS) - this is not something we should experience and Tech team need to solve it.
Yes. This works. I tried it on Firefox incognito mode.
Is there a normal solution to this bug?
This is a showstopper, a red flag item. Everything depends on this, IaaC everything.
@bkoprivica, please open a new issue and share more info by filling the issue template.
It's surprising how after more than 4 years, microsoft has still not fixed this issue/bug. I've lost 3 hours of work time tonight and the issue has still not gone away. I have cleared my cache and tried all the other "fixes" suggested, yet here I still am like Groundhogs Day. Lawd!!!!!
Petition to stop someone closing an issue unless they have clearly posted the steps to resolve the issue. (In the same issue tracker) The commentary on these sorts of issues is always someone posting I will escalate to who ever and then coming back to post I will close the issue. Long gone are the days when it was customary for the user who reported the issue to be the one to confirm that it has been fixed. This bug is still there today using az cli version 2.39.0 , after so many years yet someone has put a close badge on it and probably got paid to do so.
FWIW -- I was having the same problem in an Azure VM. Turned out it was user error. I was using Ctrl+C to copy the device code from my ssh session which, of course, stops the az login process while copying the code. So, az login wasn't listening for the response and the login process didn't complete.
Im having this issue as well. When I attempt to run 'dotnet run --interactive' I am receiving the error "Could not run xxx. Maybe your Azure credential needs a refresh with 'az login'". I then input 'az login' which redirects me to the azure login page on my browser, I login and my az account list runs in the terminal. I then run 'dotnet run -interactive' again and am met with the same error "Could not run xxx. Maybe your Azure credential needs a refresh with 'az login'".
Any recommendations would be appreciated.
Description
when trying to use az login and then running a cli command I get this
I keep getting this error Please run 'az login' to setup account.
I have signed in 100 times
this might be the cause by I am using hyper
Environment summary
Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
installed via Ubuntu for windows
CLI Version: What version of the CLI and modules are installed? (Use
az --version
)Answer here: 2.0.18-1
OS Version: What OS and version are you using?
Answer here: windows 10
Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here: Ubuntu upgraded to 16 bash.exe