1
votes

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?

1
@GauravMantri yes, I did take a look at it. If it's possible, I don't want to define a parameter 'serviceBusTopicName'. Any way I can avoid doing that? The 'dependsOn' parameter in the subscription resource seems to be the problem.droft1312

1 Answers

2
votes

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.