Azure Arm模板(Bicep):合并appsettings时的循环依赖项(列表函数)

Azure Arm模板(Bicep):合并appsettings时的循环依赖项(列表函数),azure,circular-dependency,arm-template,infrastructure-as-code,azure-bicep,Azure,Circular Dependency,Arm Template,Infrastructure As Code,Azure Bicep,我正在尝试通过bicep文件更新应用程序服务的应用程序设置 在我的二头肌模板中执行此操作时: var currentAppSettings = list('Microsoft.Web/sites/appServiceName/config/appsettings', '2018-11-01') var newAppSettings = { test: 'testValue' } var mergedAppSettings = union(currentAppSettings, newAp

我正在尝试通过bicep文件更新应用程序服务的应用程序设置

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

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
}
…部署bicep文件时出现循环依赖项错误:

"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模块本质上是嵌套部署。在顶层文件(即main)中,提取当前值并将其作为object类型的参数传递给子模块(appsettings),然后执行合并和更新。
线索是将更新部署到与读取当前值不同的模块中。

是的,这是可行的,我们同时找到了相同的解决方案。无论如何谢谢你!