我正在尝试使用嵌套模板中的loop添加一些自定义条目,以供函数应用程序应用程序设置。

问题描述 投票:0回答:1

任何想法为什么?

我已经为函数应用创建了嵌套模板,并且与您上面尝试过的要求相同。

I在下面还获得了相同的无效输出检查。

azure azure-functions azure-resource-manager
1个回答
0
投票
  • 然后,我只是编辑了模板中“属性”参数的值。当您在“属性”对象中使用“复制”函数时,您需要确保对象的结构保持有效。

  • properties

    对象不应具有“复制”字段。而不是将“复制”函数移至“属性”对象之外。

{ "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "functionAppName": { "type": "String", "metadata": { "description": "The name of the Function App." } } }, "resources": [ { "type": "Microsoft.Web/sites/config", "apiVersion": "2020-06-01", "name": "[concat(parameters('functionAppName'), '/appsettings')]", "copy": [ { "name": "Ghost", "count": 3 } ], "properties": { "FUNCTIONS_EXTENSION_VERSION": "~4", "WEBSITE_NODE_DEFAULT_VERSION": "6.5.0", "WEBSITE_RUN_FROM_PACKAGE": "1", "FUNCTIONS_WORKER_RUNTIME": "powershell", "FUNCTIONS_WORKER_RUNTIME_VERSION": "~7", "OperationalLogType": "OperationalRecord", "AuditLogType": "AuditRecord", "appSettings": [ { "name": "[concat('customentry-', copyIndex('appSettingsLoop'))]", "value": "CustomValue" } ] } } ] }

enter image description here

功能将应用于整个资源块,包括“属性”对象。
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.