git - 使用 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”:“[变量('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')]"
}
}
]
}
推荐阅读
- java - SOLID_FOREGROUND 无法解析或不是字段
- json - 使用 beta API 创建新会议时出现“onlinemeeting 不能为空”错误
- php - 当任何新数据保存或更新时向用户发送桌面通知:php、Drupal7
- bitbucket - 如何防止在 Bitbucket Markdown 中链接到 Jira?
- drupal - 如何在 Drupal 8 中自定义/样式/主题自定义内容类型的输出?
- r - 以退出状态 0 停止 R 脚本
- google-bigquery - bigquery MERGE DML 与相关子查询
- mongodb - Mongodb查询$agregate $group $count等好友
- elasticsearch - 在弹性搜索中突出显示术语问题
- java - 如何在 JPA 规范中按字段区分计数查询?