ARM 模板允许您使用“templateLink”属性引用另一个“链接的”ARM 模板。我想在 Azure DevOps (VSTS) 中使用原始 git uri 来执行此操作。我可以使用 github 执行此操作,如下所示:
"resources": [
{
"apiVersion": "2017-05-10",
"name": "linkedTemplate",
"type": "Microsoft.Resources/deployments",
"properties": {
"mode": "incremental",
"templateLink": {
"uri": "https://raw.githubusercontent.com/lw/BaseARMTemplates/master/ARM.json"",
"contentVersion": "1.0.0.0"
},
}
}
]
最佳答案
最佳做法是使用带有 sas token 的存储帐户来检索模板。这将允许您安全地引用您的模板 ( https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-powershell-sas-token )。
如果您可以在 url 中传递 auth(仅获取请求),则可以使用任何安全存储。或者您可以创建一个 azure 函数,将您的请求代理到私有(private)存储并检索模板(显然是一种 hack)。
关于git - 如何引用存储在 VSTS 或 Azure DevOps Git Repo 中的链接 ARM 模板?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53841649/