Reputation: 473
I have the following code:
// 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')]"
]
}
]
}
When trying to use it, I get this error:
Unable to evaluate template language function 'resourceId': function requires exactly one multi-segmented argument which must be resource type including resource provider namespace
How do I fix it?
Upvotes: 1
Views: 337
Reputation: 72171
I think this would be the issue:
"dependsOn": [
"[resourceId('Microsoft.ServiceBus/namespaces/topics', variables('resource_names').service_bus_namespaces.core, 'clusterprocessingcompletedevent')]"
]
so you have an extra /
in the topic name. the same should apply to this: variables('resource_names').service_bus_namespaces.core
. It should be a name of the namespace, without /
in it.
Upvotes: 2