简体   繁体   English

使用 ARM 模板创建 Azure Function 密钥失败

[英]Creating Azure Function Key using ARM template fails

I cannot figure out how to create azure function key for my function using ARM我不知道如何使用 ARM 为我的 function 创建 azure function 密钥

I am creating a child resource inside the function itself, so this resource block lives within the main resource block of the function.我在 function 本身内部创建了一个子资源,所以这个资源块位于 function 的主资源块中。

 "resources": [
        {
          "type": "Microsoft.Web/sites/functions/keys",
          "apiVersion": "2021-03-01",
          "name": "slapifd-dev",
          "properties": {
            "value": "xxxxxxx"
          }
        }
      ]

but I get this error message但我收到此错误消息

##[error]Deployment template validation failed: 'The template resource 'slapifd-dev' for type 'Microsoft.Web/sites/functions/keys' at line '1' and column '1633' has incorrect segment lengths. A nested resource type must have identical number of segments as its resource name. A root resource type must have segment length one greater than its resource name. Please see https://aka.ms/arm-template/#resources for usage details.'.

What am I missing here?我在这里错过了什么?

The 'name' property should be set with the nested resource names too, according to the resource type hierarchy.根据资源类型层次结构,“名称”属性也应设置为嵌套的资源名称。 In your scenario, the 'name' property should be {site name}/{function name}/{key name}.在您的场景中,“名称”属性应为{站点名称}/{函数名称}/{键名}。 For example: slapifd-dev/MyFunction/MyKey例如:slapifd-dev/MyFunction/MyKey

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过 ARM 模板安装时,琐碎的 Azure 逻辑应用程序失败 - Trivial Azure Logic App fails when installed via ARM template 通过参数文件将 Azure Key Vault secret 读入 ARM 模板 - Reading Azure Key Vault secret into ARM template via parameter file Azure ARM 模板 - 具有创建空/默认机密的 Key Vault - Azure ARM tempate - Key Vault with creating empty/default secrets 如何使用ARM模板为azure自动化设置账户运行? - How to set run as account for azure automation using ARM template? Azure 管道发布管道:ARM 模板部署:资源组 scope 失败,错误代码:部署失败” - Azure pipeline Release pipeline: ARM Template deployment: Resource Group scope fails with ,,Error code: DeploymentFailed" 通过PowerShell创建消费计划Azure function失败 - Creating of Azure function on consumption plan via PowerShell fails 通过 ARM 模板使用单个 azure 资源向多个用户添加 RBAC 角色 - Adding a RBAC role to multiple users using single azure resource via ARM template 在 ARM 模板参数文件中使用引用函数 - Using reference funtion in an ARM template parameter file 通过 Azure PowerShell 从 CSV 创建 NSG ARM 模板 - Create NSG ARM Template from CSV via Azure PowerShell Azure Stream 分析作业 - 转换查询 - ARM 模板中的正确格式 - Azure Stream Analytics Job - Transformation Query - correct formatting in ARM template
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM