簡體   English   中英

具有Azure DevOps Git配置的DataFactory的Azure ARM模板部署

[英]Azure ARM Template deployment of DataFactory with Azure DevOps Git configuration

我正在嘗試部署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”:“ [變量('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')]"
            }
        }
    ]
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM