如何解决手臂模板二头肌:合并应用设置时的循环依赖列表功能
我正在尝试通过二头肌文件更新应用服务的 AppSettings。
在我的二头肌模板中执行此操作时:
var currentAppSettings = list('Microsoft.Web/sites/appServiceName/config/appsettings','2018-11-01')
var newAppSettings = {
test: 'testValue'
}
var mergedAppSettings = union(currentAppSettings,newAppSettings)
resource appServiceConfig 'Microsoft.Web/sites/config@2018-11-01' = {
name: 'appServiceName/appSettings'
properties: mergedAppSettings
}
...部署二头肌文件时出现循环依赖错误:
"Deployment template validation failed: 'Circular dependency detected on resource: '/subscriptions/293d7347-b26f-4413-9986-d61717aaff26/resourceGroups/WSAPlayground/providers/Microsoft.Web/sites/playground-fitxp-backend-euw-wa/config/appSettings'. Please see https://aka.ms/arm-template/#resources for usage details.'."
有没有办法在不出现依赖错误的情况下做到这一点?
解决方法
尝试使用模块。 Bicep 模块本质上是嵌套部署。在顶级文件(即主文件)中提取当前值并将它们作为类型对象的参数传递给子模块(appsettings),然后执行合并和更新。 线索是在与读取当前值不同的模块中部署更新。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。