'Data Factory Cross Tenant with Azure Git Repo
We deploy out our infrastructure using ARM and configure the Git link as such:
Firstly a variable is configured:
"repoConfiguration": {
"type": "FactoryVSTSConfiguration",
"accountName": "[parameters('accountName')]",
"repositoryName": "[parameters('repositoryName')]",
"collaborationBranch": "[parameters('collaborationBranch')]",
"rootFolder": "[parameters('rootFolder')]",
"tenantId": "[parameters('repositoryTenantId')]",
"projectName": "[parameters('projectName')]"
},
and then that variable is used when provisioning the resource:
"type": "Microsoft.DataFactory/factories",
"name": "[variables('dataFactoryName')]",
"apiVersion": "2018-06-01",
"location": "[resourceGroup().location]",
"properties": {
"repoConfiguration": "[if(equals(parameters('environmentShort'), 'dev'), variables('repoConfiguration'), json('null'))]",
"publicNetworkAccess": "Disabled"
},
"identity": {
"type": "SystemAssigned"
},
Note that we are setting the Tenant ID for the tenant where Git resides.
Let's just say our emails for Git are: [email protected]
and for Azure (the other tenant): [email protected]
The problem is, the behaviour doesn't match this article from Microsoft.
The behaviour is as follows:
First we log on using our [email protected] email and verify via MFA. The we choose the appropriate subscription and Data Factory. Once that is logged in, we are presented with the following pop up which doesn't 100% match what is in the Appendix of the article:

From here, we get the popup to "Pick an account" and we select the [email protected] email and go through the usual MFA.
Once ADF loads up, we then have this issue where (and my assumption) it isn't handshaking with the two logins correctly:

When I click on anything in ADF e.g. the toolbox, ADF reverts to this:

Checking the repo setup, it is setup:

I'm at a loss on what could be the issue. Even when manually configuring Git, it works whilst the browser is open, but closing the browser and opening again yields the same issue.
We are also using a Self Hosted IR for ADF.
Solution 1:[1]
For anyone who encounters this issue, the cure is:
- Open Browser
- In the first tab, open Azure Devops and log in
- Open Azure Portal and log in using the other tenant account in the 2nd tab
- Open adf.azure.com in the 3rd tab. Log in using your "other tenant account" and when it tries to connect to git, it will ask you to select the desired account. Select the account that you have used for Azure Devops and cross tenancy should work fine between Data Factory and Azure Git
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Raymondo |
