【发布时间】:2019-12-08 10:46:31
【问题描述】:
我有以下代码:
// Create event topics and listeners
{
"comments": "Service Bus Topic - clusterprocessingcompletedevent",
"type": "Microsoft.ServiceBus/namespaces/topics",
"name": "[concat(variables('resource_names').service_bus_namespaces.core, '/clusterprocessingcompletedevent')]",
"apiVersion": "2017-04-01",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.ServiceBus/namespaces', variables('resource_names').service_bus_namespaces.core)]"
],
"resources": [
{
"comments": "Service Bus Topic Subscription - notification.clusterprocessingcompletedevent",
"apiVersion": "2017-04-01",
"name": "[concat(variables('resource_names').service_bus_namespaces.core, '/clusterprocessingcompletedevent', '/notification.clusterprocessingcompletedevent')]",
"type": "Microsoft.ServiceBus/namespaces/topics/subscriptions",
"dependsOn": [
"[resourceId('Microsoft.ServiceBus/namespaces/topics', variables('resource_names').service_bus_namespaces.core, '/clusterprocessingcompletedevent')]"
]
}
]
}
当尝试使用它时,我得到这个错误:
无法评估模板语言函数“resourceId”:函数 只需要一个多段参数,它必须是资源 类型包括资源提供者命名空间
我该如何解决?
【问题讨论】:
-
@GauravMantri 是的,我确实看过它。如果可能,我不想定义参数“serviceBusTopicName”。有什么办法可以避免这样做吗?订阅资源中的“dependsOn”参数似乎是问题所在。
标签: json azure azure-resource-manager