【问题标题】:How can you deploy ARM templates from Github using azure runbooks?如何使用 azure runbook 从 Github 部署 ARM 模板?
【发布时间】:2018-04-10 10:35:37
【问题描述】:

我正在使用带有 powershell 的 azure runbook,并希望从我的 github 存储库中部署一个模板。我试过命令:

New-AzureRmResourceGroupDeployment -ResourceGroupName 'rg01' -TemplateUri -$templateuricode

($templateuricode 包含指向 github json 文件的 url 链接)

但出现错误 - “无法从 'https://github.com/myfolder/myproject/blob/ 下载内容 测试.json'。跟踪 ID 为“0216a103-a683-461e-ae9d-785d9f6efc4c”。请 使用详情见https://aka.ms/arm-deploy

【问题讨论】:

    标签: azure github


    【解决方案1】:

    我解决了,您需要在 github 中选择 RAW 按钮,然后复制该链接并将其放在 -TemplateUri 之后。

    例如 New-AzureRmResourceGroupDeployment -ResourceGroupName 'test' -TemplateUri "将来自 github 的链接放在此处"

    【讨论】:

      【解决方案2】:

      问题很可能在于 github 需要 TLS 1.2,您可以在部署之前使用此命令解决:

      [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
      

      【讨论】:

      • 我会在 New-AzureRmResourceGroupDeployment 命令之前将上述内容插入到 powershell 中吗?
      • 是的,查看错误文本,这很可能是问题的根源
      • 我刚试过,同样的错误------------ ---。 New-AzureRmResourceGroupDeployment:InvalidContentLink:无法从“github.com/myproject/test.json”下载部署内容。跟踪 ID 为“739e35d3-8c72-4be1-b3ff-66c990a45689”。使用详情请查看aka.ms/arm-deploy
      猜你喜欢
      • 1970-01-01
      • 2017-12-19
      • 1970-01-01
      • 2019-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多