microsoft / vscode-azureresourcegroups

VS Code extension for managing Azure resources.
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureresourcegroups
MIT License
52 stars 28 forks source link

Improve tenant selection for cloud shell #857

Closed alexweininger closed 4 months ago

alexweininger commented 4 months ago

The diff is misleading. There aren't that many changes here. I think because of the whitespace changes...

I'll do my best to explain what's going on here:

The Azure Account behavior was to get all authenticated tenants that have >0 subscriptions and let the user pick if there's more than one. The current behavior is to get all tenants and let the user pick if there's more than one. I'd like to make the experience mimic that of Azure Account.

The new behavior is the same as Azure Account, however a shortcut step 1. has been added that wasn't present before.

  1. We list all tenants, if we find only one, we select it.
  2. If they have multiple tenants, we check which are authenticated and have at least one subscription, if there's only one, we select it. (If there are zero, we still select the first tenant because later it'll show they need to setup their account if they have no subs)
  3. If we get here, it means they have multiple authenticated tenants, we ask the user to select one.

In the future we might want to simplify this and just check if the tenant is authenticated and not if it has subscriptions. But for now I want to keep the experience unchanged from Azure Account to avoid any unnecessary UX changes for users.

nturinski commented 4 months ago

The diff is misleading. There aren't that many changes here. I think because of the whitespace changes...

https://github.com/microsoft/vscode-azureresourcegroups/pull/857/files?diff=split&w=1

alexweininger commented 4 months ago

The diff is misleading. There aren't that many changes here. I think because of the whitespace changes...

https://github.com/microsoft/vscode-azureresourcegroups/pull/857/files?diff=split&w=1

This doesn't change it for me. I think it's because I added a new level of indentation because there's an extra if statement.