microsoft / vscode-tools-for-ai

Azure Machine Learning for Visual Studio Code, previously called Visual Studio Code Tools for AI, is an extension to easily build, train, and deploy machine learning models to the cloud or the edge with Azure Machine Learning service.
Other
321 stars 91 forks source link

v0.44 disables users to sign in with other account #2266

Closed tokleine closed 5 months ago

tokleine commented 5 months ago

Expected Behavior

Previously (up until v0.42) the extension utilized the Azure Account extension to provide the identity and sign-in. When signing in to Azure with a different users (e.g. in a coporate setting, where normal permissions and cloud permissions are split), the Azure Account extension successfully signs you in (with e.g. Device Code) and you can access your subscriptions and the contained Azure ML resources.

Actual Behavior

With the new windows-based sign-in, the extension silently overrides the Azure Account sign-in and the user is confronted with the (inexistent) permissions/resources for Azure ML. It also not displayed which identity is used to reach the Azure ML resources.

Steps to Reproduce the Problem

  1. Sign in with Azure Account extension, e.g. cloudUser@domain.com --> success (visible at bottom of vsc window)
  2. Search for Azure ML workspaces --> fails since windows-logged-in-user@domain.com has no permissions on resource

Specifications

Reading the version history of the extension we find: Version 0.44.0 Release date: January 10th, 2023 Changing the authentication method from Azure Account extension to the built-in Microsoft Authentication provider for Visual Studio Code. Users may have to log in again to their accounts. Our apologies for the inconvenience.

Would it be possible to make this behavior optional? Or at least let users know? For my specific corporate context v>0.42 is essentially unusable.

tokleine commented 5 months ago

Ok, so I figured out my issue.

My company had chosen MS Edge as the default browser (and Edge used Automatic Profile Switching) which caused all my cloudUser logins to redirect to my windows user.

I then turned of the auto profile switching for edge (edge://settings/profiles/multiProfileSettings), this includes two steps:

  1. Turn off "Account based profile switching"
  2. add a website (e.g. portal.azure.com) to the "Choose preferred profile for sites" and select Action "Don't switch"

However, this sadly didnt solve my issue. The Azure ML VSCode extension still automatically logged me into my windows user, even when using my cloudUser profile in Edge.

The solution, finally, was

  1. to use Google Chrome as my default browser (windows key -> default apps -> Web Broswer)
  2. then I logged out of all accounts in VSCode (using the profile icon at the bottom left of VSCode)
  3. sign into my cloudUser account in Chrome
  4. sign into my cloudUser account in VSCode (using the profile icon -> "Turn on Cloud Changes...")
  5. sign into the Azure ML extension, which now opens a sign-in prompt in Chrome

I hope this can help other (corporate) users to fix their issues :-)