如何通过DevOps将Liquid Map文件上传至Azure现有集成账户?
可以通过Azure DevOps直接上传Liquid Map到现有集成账户
当然可以,完全不用把Liquid Map硬塞进ARM模板里(那种转义和长文件处理确实坑),下面是两种简单可靠的方法:
方法一:用Azure CLI任务
在Azure DevOps Pipeline里添加「Azure CLI」任务,配置好目标订阅后,直接运行命令上传本地的Liquid文件:
az integration-account map create \ --resource-group <你的资源组名> \ --name <集成账户名> \ --map-name <要创建/更新的Map名称> \ --map-type Liquid \ --content-path $(Build.SourcesDirectory)/<你的Liquid文件路径,比如Maps/order-transform.liquid>
如果是更新已有Map,把create换成update即可。这种方式直接读取文件内容,完全不用处理转义字符,长文件也能轻松搞定。
方法二:用Azure PowerShell任务
如果更习惯PowerShell,添加「Azure PowerShell」任务,执行以下命令:
Set-AzIntegrationAccountMap ` -ResourceGroupName <你的资源组名> ` -Name <集成账户名> ` -MapName <要创建/更新的Map名称> ` -MapType Liquid ` -ContentPath $(Build.SourcesDirectory)/<你的Liquid文件路径>
同样,直接指向本地文件,无需手动转义。
这两种方法都能直接把Liquid Map文件上传到现有集成账户,比嵌ARM模板高效得多。
内容的提问来源于stack exchange,提问作者wilson_smyth
相关产品推荐
相关产品推荐

