Skip to content

Ghosts in the Azure DevOps machine

Reading Time: 3 minutes

Whilst preparing to present an Azure DevOps based training day at SQLBits I encountered an interesting problem, which I nicknamed ‘Ghosts in the Azure DevOps machine’. Mostly due to the theme of this years SQLBits conference which was classic arcade games.

For our training day I had setup an Azure DevOps organization and setup the billing before the event. So that we could add all the attendees to the same Azure DevOps organization.

We wanted to add all the attendees to the same organization so that they could view the Data Platform projects we had in place. Plus, the special Wiki that we had setup for them, which included various exercises.

In addition, I decided not to add the organization to an Azure Active Directory. So that we could cleanly remove users afterwards.

401 error

What should happen when you add a new user in Azure DevOps is that when you add a new user, they get an email. From there they click on the link in the email and join the new organization.

However, whilst testing adding new users before our training day, we discovered that some of them got a 401 error when they clicked on the link in the email to join the organization. Like the one below.

401 error trying to access Azure DevOps organization
401 error trying to access Azure DevOps organization

At first, I found it frustrating as there did not appear to be a set pattern. It worked for some accounts and not others.

Whilst waiting for a response from Microsoft I kept on investigating. After a while I found out that there were two potential fixes for this. One for those with personal accounts and one for those with work accounts.

Because it took me a while to figure this out, I have decided to share these fixes in this post to help others.

Ghosts in the Azure DevOps machine for personal accounts

If you get the 401 error whilst using a personal email account for Azure DevOps follow the below steps:

  1. Open up Azure DevOps as normal in one tab, then in another new tab and type in URL for the organization which you want to join. For example, https://dev.azure.com/{ORGANIZATION NAME}.
  2. When you get the 401 error go back into your original tab click on your account manager in the top right-hand corner. Select ‘Switch Directory‘.
Select Switch Directory in account manager in Azure DevOps
Select Switch Directory in account manager
  1. Afterwards, select the first ‘Default Directory’ entry that you see.
Select first Default Directory in Azure DevOps
Select first Default Directory
  1. If it says ‘Welcome to Azure DevOps’ ignore that screen. Instead, go to your new tab that has the URL of the new organization and press ‘Refresh’. Your new organization should appear.
  2. If the above steps do not work than repeat above steps with any other Default Directories your account has access to until it works.

Ghosts in the Azure DevOps machine for work accounts

If you get the 401 error whilst using a personal email account for Azure DevOps follow the below steps:

  1. Open up Azure DevOps in Private/Incognito mode.
  2. Enter the https://dev.azure.com and log back into Azure DevOps.
  3. If the new organization does not appear on the left-hand side straight away open up a new tab and enter the URL for the new organization. For example, https://dev.azure.com/{ORGANIZATION NAME}. You should then have access to your new organization.

Final words

I hope my tips on how to fix ‘Ghosts in the Azure DevOps machine’ helps some of you.

In addition, I would like to personally thank Sander Stad, Kay Cordewener and Gregor Suttie for helping me test the issues with personal and work accounts. Without these tests I would never have figured out how to resolve these two separate issues before SQLBits.

On that note, those who attended our SQLBits training day will be pleased to know that I have now uploaded the slides. So that the SQLBits team can make them available,

Of course, if you have any comments or queries about this post feel free to reach out to me.

Published inAzure DevOps

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *