我使用带有PowerShell的azure Runbook,并希望从我的github存储库部署模板。我尝试过命令:
New-AzureRmResourceGroupDeployment -ResourceGroupName' rg01' -TemplateUri - $ templateuricode
($ templateuricode包含指向github json文件的url链接)
但收到错误 - "无法从' https://github.com/myfolder/myproject/blob/下载内容 test.json&#39 ;.跟踪ID是' 0216a103-a683-461e-ae9d-785d9f6efc4c'。请 有关使用详情,请参阅https://aka.ms/arm-deploy。
答案 0 :(得分:1)
我解决了这个问题,您需要在github中选择RAW按钮,然后将您的JSON文件复制到该链接并将其放在-TemplateUri
之后例如New-AzureRmResourceGroupDeployment -ResourceGroupName' test' -TemplateUri"在这里放置来自github的链接"
答案 1 :(得分:0)
问题很可能是因为github需要TLS 1.2,你可以在部署之前使用这个命令解决这个问题:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12