【问题标题】:ARM Template deployment - The resource identificator is malformedARM 模板部署 - 资源标识符格式错误
【发布时间】:2018-09-10 13:00:15
【问题描述】:

我正在尝试从一个 ARM 模板一起部署多个 LogicApp 和其他资源。当我尝试使用我创建的模板执行Test-AzureRmResourceGroupDeployment 时,会引发此错误

Code    : InvalidTemplate
Message : Deployment template validation failed: 'The template resource 'MyLogicApp' at line '159' and column '9' is not valid: The resource identificator
          '/subscriptions/8a506831-cc80-4512-b51b-6ed4cc32b2cd/resourceGroups/arm/providers/Microsoft.Web/' is malformed. Please see https://aka.ms/arm-template-expressions/#reference for usage
          details.. Please see https://aka.ms/arm-template-expressions for usage details.'.

这是从我的代码创建资源的块。

我似乎找不到任何有关此的资源。请帮忙。谢谢

【问题讨论】:

    标签: azure azure-resource-manager azure-logic-apps arm-template


    【解决方案1】:

    您在模板中的某个地方构建的 resourceId 很差:

    /subscriptions/8a506831-cc80-4512-b51b-6ed4cc32b2cd/resourceGroups/arm/providers/Microsoft.Web/
    

    它应该以资源名称结尾。当您不提供模板时很难分辨。

    在这种情况下,传递给模板的参数之一为空,因此此错误表明该资源没有名称。

    【讨论】:

    • 这很好"id": "[concat(subscription().id,'/providers/Microsoft.Web/locations/',resourceGroup().location,'/managedApis/servicebus')]",
    • 嗯,我不知道应该如何构造这个特定的 ID,但通常应该是 subscriptions/GUID/resourceGroups/name/providers/type/name 你的是 subscriptions/GUID/providers/type/random/subtype/name
    • 我为所有逻辑应用程序设置了单独的模板,部署时工作正常。但是我现在已经结合了它,我似乎找不到错误。我提供的这条线的构造在单独和组合上都是相同的
    • 如果没有完整的模板,我将无法提供帮助。您的模板有错误。
    • 您是否将空字符串传递给其中一个参数?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-21
    • 1970-01-01
    • 2019-12-16
    • 1970-01-01
    相关资源
    最近更新 更多