A Tale of Too Many Azure/Microsoft Logins

Michael Gearhardt
3 min readApr 9, 2021

I guess I’ll just jump in on this one… I’ve been dying recently after our organization (Fathym) shifted to multi-level authentication. The issue, I was being prompted to login to my dev tools (Visual Studio 2019 and Azure Storage Explorer) what seemed like daily, and what was worse is that I was having to sign in 5–7 times each time I needed to sign in. After dealing with it way to long, I decided, enough.

Setting out to find a solution to the problem, I worked with our system administrator a little, but we couldn’t find the issue. It occurred to me that VS Code was not giving me this issue, and was setup to use device code authentication. so the pondering… Can Visual Studio and Azure Storage Explorer be setup to use device code authentication too? Or maybe something else that leverages the system browser?

Changing Visual Studio 2019 to Use System Browser

If your getting prompted to login way to many times in Visual Studio 2019, the first thing to try is switching over to the System Web Browser rather than the embedded one.

System Web Browser option to fix too many logins issue
  1. Open Visual Studio 2019
  2. Open Tools > Options from the top toolbar
  3. Select the Accounts option under Environment
  4. Change the drop down selection for Add/Reauthenticate
  5. Select Azure Service Authentication > Account Selection
  6. If it shows a link to ‘re-authenticate’ below the Choose an account drop down, click that link and authentication will happen in the chosen form. If it does not show the link, the next time you lose your session the new form will be used.
  7. Close the options window and enjoy the coding without too many login prompts.
Reauthenticate Azure user

If this still does not solve your problem, instead of System Web Browser choose the Device Code option and try signing in again (steps 5–7 above):

Device Code option to fix too many logins issue

Changing Azure Storage Explorer to use Device Code

If your getting prompted to login way to many times in Azure Storage Explorer, the fix is close to the same, except there is no System Web Browser option, just the Device Code flow.

Device Code option to fix too many logins issue
  1. Open Azure Storage Explorer
  2. Select the Settings cog from the left Activity bar or under Edit > Settings
  3. Scroll down to the bottom of the Settings window, to the second to last section ‘Sign In’
  4. I enabled the MAL (Preview) in hopes that alone would fix the issue, it did not, so check the Use device code flow sign-in option.
  5. If it shows that you need to re-authenticate, then do so and the device code flow will get you going. If it does not show that you need to re-authenticate, do so the next time it does.
  6. Close the Settings window and enjoy without too many login prompts.

--

--