我试图传递链接模板的构建工件路径,但它抛出以下错误。
InvalidContentLink: The provided content link 'Microsoft.WindowsAzure.ResourceStack.Frontdoor.Data.Entities.Deployments.DeploymentTemplateContentLink' is invalid or not supported. Content link must be an absolute URI not referencing local host or UNC path.
详细信息:
我在文件夹 list 中有构建工件。我有一个 token 替换任务来替换 list 中的文件,如下所示 -> manifest/swagger.json。然后我有一项部署任务,其中有一个主模板和链接模板。主模板我能够提供诸如 $(Pipeline.Workspace)/Manifest/Changes/master.json 之类的链接,其中我有链接模板路径的参数,并且我正在传递类似 $(Pipeline.Workspace)/Manifest 的路径/Changes/Artifact/something.json。
链接模板的链接是否始终必须是存储帐户示例中的 URL。如果是这样的话,现在我们的项目中不需要存储帐户,有没有其他方法可以实现这一点?
更新: 虽然我是从参数传递它,但我直接提供示例以使上下文清晰。
{
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[concat('$(Pipeline.Workspace)/Manifest/Changes/linkedtemplates', '/initial.api.template.json')]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"ServiceName": {
"value": "[parameters('ServiceName')]"
}
}
}
最佳答案
您无法使用管道工件,您需要一个可公开访问的 URL。这就是示例使用存储帐户的原因。
When referencing a linked template, the value of uri can't be a local file or a file that is only available on your local network. Azure Resource Manager must be able to access the template. Provide a URI value that downloadable as http or https.
关于azure - 我可以将构建工件的 URL 传递给链接的 ARM 模板部署吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65251035/