使用Azure DevOps Git配置部署数据工厂的Azure ARM模板
我正在尝试部署Azure DataFactory资源并将其配置为使用Azure DevOps Git进行源代码控制。Azure Devops组织、存储库和协作分支都存在 当我部署模板时,会创建DataFactory资源,但它没有连接到源代码管理。我的帐户可以访问Azure DevOps组织,我可以手动连接源代码管理 我正在使用以下模板:使用Azure DevOps Git配置部署数据工厂的Azure ARM模板,git,azure,azure-resource-manager,azure-data-factory-2,azure-deployment,Git,Azure,Azure Resource Manager,Azure Data Factory 2,Azure Deployment,我正在尝试部署Azure DataFactory资源并将其配置为使用Azure DevOps Git进行源代码控制。Azure Devops组织、存储库和协作分支都存在 当我部署模板时,会创建DataFactory资源,但它没有连接到源代码管理。我的帐户可以访问Azure DevOps组织,我可以手动连接源代码管理 我正在使用以下模板: { "contentVersion": "1.0.0.0", "$schema": "https://schema.management.azu
{
"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')]"
}
}
]
}
您需要按照以下方式从变量中获取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')]"
}
}
]
}
我更正了
[变量('repoConfiguration')]
周围缺少的方括号;这实际上是文章中示例代码中的一个输入错误,而不是我的实际示例。您能否通过查看Azure Data Factory Author GUI来确认您的存储库实际上已连接到源代码控制?当我看我的时,它根本没有连接。我纠正了[变量('repoConfiguration')]
周围缺少的方括号;这实际上是文章中示例代码中的一个输入错误,而不是我的实际示例。您能否通过查看Azure Data Factory Author GUI来确认您的存储库实际上已连接到源代码控制?当我看我的时,它根本没有连接。