首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Arm模板(Bicep):合并appsettings时的循环依赖(list函数)

Arm模板(Bicep):合并appsettings时的循环依赖(list函数)
EN

Stack Overflow用户
提问于 2021-04-30 14:11:23
回答 1查看 192关注 0票数 1

我正在尝试通过二头肌文件更新应用程序服务的AppSettings。

在我的二头肌模板中执行此操作时:

代码语言:javascript
复制
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
}

...I在部署二头肌文件时出现循环依赖错误:

代码语言:javascript
复制
"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.'."

有没有办法在不出现依赖错误的情况下做到这一点?

EN

回答 1

Stack Overflow用户

发布于 2021-05-03 18:27:08

尝试使用模块。二头肌模块本质上是嵌套部署。在顶层文件(即main)中,提取当前值并将其作为object类型的参数传递给子模块(appsettings),然后执行合并和更新。提示是将更新部署在不同的模块中,而不是读取当前值。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67328994

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档