使用Azure DevOps Git配置的DataFactory的Azure ARM模板部署 [英] Azure ARM Template deployment of DataFactory with Azure DevOps Git configuration

查看:0
本文介绍了使用Azure DevOps Git配置的DataFactory的Azure ARM模板部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试部署Azure DataFactory资源并将其配置为使用Azure DevOps Git进行源代码管理。Azure DevOps组织、存储库和协作分支都存在。

当我部署模板时,创建了DataFactory资源,但它没有连接到源代码管理。我的帐户可以访问Azure DevOps组织,并且我可以手动连接源代码管理

我使用的模板如下:

{
    "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": []
          }
        ]
}

推荐答案

您需要从变量中获取repoConfiguration,如下所示:

"repoConfiguration":"[Variables(‘repoConfiguration’)]"

不要错过方括号。我在我身边试了试,并取得了成功。

{
    "$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')]"
            }
        }
    ]
}

这篇关于使用Azure DevOps Git配置的DataFactory的Azure ARM模板部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆