git - 如何引用存储在 VSTS 或 Azure DevOps Git Repo 中的链接 ARM 模板?

标签 git azure-devops azure-resource-manager

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/

相关文章:

ruby-on-rails - 如何让 Heroku 在临时服务器上构建我的开发分支?

azure - 使用 ARM 模板将用户添加到 SQL Azure 数据库

powershell - 新-AzureRmResourceGroupDeployment : "Deployment ' xxx' could not be found"

Linux 硬链接(hard link) (ln) 和 GIT

java - 从源 (Git) 提取单个文件

git - 如何恢复已暂存文件的更改,将更改保留到暂存时的状态?

azure-devops - VSO 构建未运行

Azure 数据流创建/管理身份关系 key

azure - 通过 Azure DevOps Pipelines 部署 DACPAC 时出错

azure - 在 ARM 中使用事件中心主题类型创建事件网格订阅