microsoft / vscode-docker

Docker Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker
Other
1.19k stars 508 forks source link

Azure Container Registry - connects to defualt tenant, not selected tenant - cannot view specific tenant's subscriptions #4147

Closed G-man83 closed 7 months ago

G-man83 commented 8 months ago

Does this occur consistently? Yes

Issue:

My Azure account is associated with multiple tenants, but the Docker extension only lists the subscriptions in the "default" tenant, even after I use Azure: Select tenant.

Repro steps:

  1. Execute Azure: Sign out
  2. Azure Account is signed out image
  3. Docker extension ACR is still connected. I'm signed out of Azure at this point therefore I expect it to sign out as well, since it uses the Azure Account extensions under the hood. I refreshed it as well to ensure it is still connected. image
  4. Docker Registries: Disconnect -> Azure.
  5. Azure: Sign in to my organization account
  6. Azure: Select tenant - select the tenant that my subscriptions are in
  7. Confirm that the Azure extension lists my subscriptions in the selected tenant.
  8. Docker Registries: Connect Registry... -> Azure Container Registry
  9. Expand Azure registries in the Docker extension.
  10. It is still only showing the subscriptions in another tenant, not the tenant that I selected.

Expected:

I am expecting to see the subscriptions in the selected tenant under the Azure registries.

Version: 1.27.0 OS: win32 OS Release: 10.0.19045 Product: Visual Studio Code Product Version: 1.83.1 Language: en

bwateratmsft commented 8 months ago

Regarding the sign-out, in Docker extension version 1.27 we switched away from the Azure Account extension (which will be deprecated at some point soon) to use the built-in Microsoft authentication provided by VSCode. The only way to sign out is to use the accounts menu on the bottom left.

As for the tenant, there is still some work ongoing to make it so the Azure Resources extension and Docker extension consistently show the same information.

bwateratmsft commented 8 months ago

As a workaround @G-man83, you can roll back to extension version 1.26.0 by running the command "Extensions: Install Specific Version of Extension...", choosing Docker, and then 1.26.0.

G-man83 commented 8 months ago

Extensions: Install Specific Version of Extension...

Thanks, @bwateratmsft. The workaround has worked 😄

bwateratmsft commented 8 months ago

Added the Documentation label as this will have doc impact.

bwateratmsft commented 7 months ago

@G-man83 the Azure Resources extension version 0.8.0 has been published now. This version contains a command, "Azure: Sign in to Directory..." that should allow you to sign in to alternate tenants. Please try it out with Docker extension version 1.28.0 and let me know if it works.

Basically, the Azure Resources extension is becoming an optional add-on that controls two things--subscription filtering and tenant sign in. Sort of taking the place of the Azure Account extension. Technically it's not required for most users so we didn't want to make it an extension dependency.

You can read more about the transition to built-in auth here: https://github.com/Microsoft/vscode-azureresourcegroups#move-to-built-in-vs-code-authentication