ewingjm / development-hub

A continuous integration solution for Power Apps.
MIT License
35 stars 8 forks source link

Signing in to Azure DevOps across tenants #69

Closed tdashworth closed 3 years ago

tdashworth commented 3 years ago

This is more of an FYI to share my experience while setting up Development Hub.

The Problem

To set the scene, I have a work account that I use to access our Azure DevOps project while I have a development account that I use to access the dev/extract/CI environments. Development Hub is installed in the Dev environment which requires a Connection to the Azure DevOps organisation.

The problem I faced was when creating the Azure DevOps Connection, it would automatically sign me in with my development account, not let me select or sign-in to a different account. No matter how many times clicked "Switch Account", it always completes the sign-in without any user input.

The Solution

To resolve this, specifically for Azure DevOps, I found that if you sign in to https://visualstudio.microsoft.com/ with the correct account then the automatic sign-in during the creation of the Connection will pick up that account instead.

If you ensure you are not signed in to https://visualstudio.microsoft.com/, the Connection should ask for your details rather than automatically signing in but I've found this inconsistent.

A further problem I faced was that my work account has access to serval tenants and the organisation that I needed access to was not within the default selected tenant. The hierarchy is as follows:

To change the tenant, navigate to https://app.vsaex.visualstudio.com/me and use the dropdown on the left to change the tenant. This will trigger a new sign-in for this tenant and should be done before you create the Azure DevOps Connection.

On a final note, I originally tried a different approach where I signed in to the Azure DevOps project (https://dev.azure.com/{organisation}) but this didn't change anything. The visual studio approach seems more consistent to me.