1
votes

I am attempting to deploy an Azure DataFactory resource and configure it to use Azure DevOps Git for source control. The Azure Devops organization, repository and collaboration branch all exist.

When I deploy the template, the DataFactory resource is created but it is not wired up to source control. My account has access to the Azure DevOps organization and I can manually wire up source control

I am using the following template:

{
    "contentVersion": "1.0.0.0",
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "variables": {
        "repoConfiguration": {
            "accountName": "my-account",
            "collaborationBranch": "dev",
            "lastCommitId": "",
            "projectName": "Azure",
            "repositoryName": "golaat",
            "rootFolder": "/",
            "tenantId": "",
            "type": "FactoryVSTSConfiguration"
        }
    },
    "resources": [
        {
            "type": "Microsoft.DataFactory/factories",
            "apiVersion": "2018-06-01",
            "name": "my-resource-golaat8-adf",
            "location": "eastus2",
            "identity": {
              "type": "SystemAssigned"
            },
            "properties": {
              "repoConfiguration": "[variables('repoConfiguration')]"
            },
            "resources": []
          }
        ]
}
1

1 Answers

0
votes

You need to get the repoConfiguration from variables as following:

"repoConfiguration": "[variables('repoConfiguration')]"

Do not miss the Square Brackets. I tried at my side and got a success.

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "name": {
            "defaultValue": "myv2datafactory",
            "type": "String"
        },
        "location": {
            "defaultValue": "East US",
            "type": "String"
        },
        "apiVersion": {
            "defaultValue": "2018-06-01",
            "type": "String"
        },
        "gitAccountName": {
            "type": "String"
        },
        "gitRepositoryName": {
            "type": "String"
        },
        "gitBranchName": {
            "defaultValue": "master",
            "type": "String"
        },
        "gitRootFolder": {
            "defaultValue": "/",
            "type": "String"
        },
        "gitProjectName": {
            "type": "String"
        }
    },
    "variables": {
        "repoConfiguration": {
            "type": "FactoryVSTSConfiguration",
            "accountName": "[parameters('gitAccountName')]",
            "repositoryName": "[parameters('gitRepositoryName')]",
            "collaborationBranch": "[parameters('gitBranchName')]",
            "rootFolder": "[parameters('gitRootFolder')]",
            "projectName": "[parameters('gitProjectName')]"
        }
    },
    "resources": [
        {
            "type": "Microsoft.DataFactory/factories",
            "apiVersion": "[parameters('apiVersion')]",
            "name": "[parameters('name')]",
            "location": "[parameters('location')]",
            "identity": {
                "type": "SystemAssigned"
            },
            "properties": {
                "repoConfiguration": "[variables('repoConfiguration')]"
            }
        }
    ]
}