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 cli login redirects to 'https://login.windows-ppe.net' instead of 'login.micosoftonline.com' #20883

Closed
jaeyonglee8687 opened this issue Dec 31, 2021 · 3 comments
Assignees
Labels

Comments

@jaeyonglee8687
Copy link

I have tried to sign in to my azure account via 'az login' command, and it opens a window redirecting me to 'https://login.windows-ppe.net' instead of 'login.micosoftonline.com'.

I used the same credential to login, 'jaeyonglee@microsoft.com', but it brings a different set of subscriptions; Cloud name 'dogfood' that are not under my actual azure production account. I see that 'https://login.windows-ppe.net' is navigating me to 'Microsoft dogfood' authentification process.
image

I've tried to directly sign in with the tenant ID, which is blocked.
image

When I try to see the list of subscriptions via Cloud Shell on Azure, I can see all subscriptions I have.
This results in a weird behavior in VS code,

  • Using Azure extension in VSC and I am able to see all my subscriptions.
  • When I try to list the subscriptions via cli, then it shows different subscription

image

Is there any way I can change the default behavior?

@ghost ghost added the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Dec 31, 2021
@jiasli
Copy link
Member

jiasli commented Dec 31, 2021

This is because you registered dogfood cloud before and switched to it.

To use public Azure, please run

az cloud set --name AzureCloud

For more info, see https://docs.microsoft.com/en-us/cli/azure/manage-clouds-azure-cli

@jiasli jiasli self-assigned this Dec 31, 2021
@jiasli jiasli added the Cloud label Dec 31, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Dec 31, 2021
@jiasli jiasli added this to the Jan 2022 (2022-02-08) milestone Dec 31, 2021
@jaeyonglee8687
Copy link
Author

@jiasli Problem solved! Would be nice if there were some guidance to hint at this solution. I spent quite some time googling this issue, but couldn't really get the answer (probably because I am not familiar with this, but I also asked other 2 engineers, but this issue was not familiar with them at all as well).

@jiasli
Copy link
Member

jiasli commented Jan 4, 2022

Azure CLI by default does use AzureCloud, thus https://login.micosoftonline.com to log in.

The user must

  1. manually register dogfood with az cloud register
  2. switch to it with az cloud set

for it to take effect.

Adding guidance or hint for something the user deliberately did would make the terminal output too crowded in my opinion. It's like I turned on auto-hold in my car, and the display hints me to turn it off, right?

@chasewilson

@yonzhan yonzhan closed this as completed Jan 29, 2022
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