服务总线不工作的 ARM 部署资源 ID

ARM deployment resourceID with servicebus not working

我在尝试部署我的 Azure 资源包时遇到此错误。很想找到一种解决方法 'resourceId':函数只需要一个多段参数语句。

 [ERROR] New-AzureRmResourceGroupDeployment : 2:17:06 PM - Error: Code=InvalidTemplate; 
14:17:06 - [ERROR] Message=Deployment template validation failed: 'The template resource 
14:17:06 - [ERROR] 'xxxxx/basket-item-changed-topic/basket-telemetry-processor' at line 
14:17:06 - [ERROR] '2799' and column '10' is not valid: Unable to evaluate template language 
14:17:06 - [ERROR] function 'resourceId': function requires exactly one multi-segmented argument 
14:17:06 - [ERROR] which must be resource type including resource provider namespace. Current 
14:17:06 - [ERROR] function arguments 'Microsoft.ServiceBus/namespaces/topics,xxxxxx/bask
14:17:06 - [ERROR] et-item-changed-topic'. Please see 

--------------------这是模板

{ "comments": "Generalized from resource: '/subscriptions/fa17ed69-d83f-47bc-8604-fd96cd27d322/resourcegroups/xxxxxxx-Integration-Environment/providers/Microsoft.ServiceBus/namespaces/xxxxx/topics/basket-item-changed-topic/subscriptions/basket-telemetry-processor'.", "type": "Microsoft.ServiceBus/namespaces/topics/subscriptions",
"name": "[parameters('subscriptions_basket_telemetry_processor_name')]",
"apiVersion": "2015-08-01", "location": "UK West",
"scale": null, "properties": {
"lockDuration": "00:02:00", "requiresSession": false,
"defaultMessageTimeToLive": "10675199.02:48:05.4775807",
"deadLetteringOnMessageExpiration": true,
"deadLetteringOnFilterEvaluationExceptions": true,
"messageCount": 0, "maxDeliveryCount": 1,
"enableBatchedOperations": true, "status": "Active",
"createdAt": "2017-05-10T14:31:54.2059078Z",
"updatedAt": "2017-05-10T14:31:56.6330818Z",
"accessedAt": "2017-06-23T10:53:20.3815084Z",
"countDetails": { "activeMessageCount": 0,
"deadLetterMessageCount": 0,
"scheduledMessageCount": 0, "transferMessageCount": 0, "transferDeadLetterMessageCount": 0
}, "autoDeleteOnIdle": "10675199.02:48:05.4775807",
"entityAvailabilityStatus": "Available" },
"dependsOn": [
"[resourceId('Microsoft.ServiceBus/namespaces', parameters('namespaces_xxx_int_name'))]",
"[resourceId('Microsoft.ServiceBus/namespaces/topics', parameters('topics_basket_item_changed_topic_name'))]" ]
},

您可以只使用资源的名称如果它部署在同一个模板中:

dependsOn: [
    "[parameters('namespaces_xxx_int_name')]",
    "[parameters('topics_basket_item_changed_topic_name')]"
]

您不能将 dependsOn 用于已部署或存在于模板之外的资源,因此我原来的评论没有任何意义。

这是一个命名问题。

参数('namespaces_xxx_int_name')

求解步骤

1.Remove 参数文件中的参数。(使用默认参数)

2.Add 你的函数。

3.Find所有导致错误的相关地方。