question

UsmanSadiq-2394 avatar image
0 Votes"
UsmanSadiq-2394 asked PramodValavala-MSFT answered

Creating Correlation Filter on service bus topic through az-cli

Hi, I want to create a correlation filter on a service bus topic using Azure CLI but everytime I stumble into this error:

"BadRequest: Value cannot be null.
Parameter name: sqlExpression CorrelationId: a14dcc41-7626-4f06-8f26-33df172d9c90"

In the github repo for az-cli, there are two existing bugs for the same issue and they are open for more than 9 months now approx. I have tried playing with all possible parameters mentioned here https://docs.microsoft.com/en-us/cli/azure/servicebus/topic/subscription/rule?view=azure-cli-latest#az_servicebus_topic_subscription_rule_create but no luck.

I can however create a correlation filter through C# or using Service Bus Explorer. We are blocked at the moment because we use az cli scripts to create our infra in azure through devops pipelines. Any help/pointers would be highly appreciated. Thanks,

Cheers,
Usman

azure-service-bus
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

PramodValavala-MSFT avatar image
0 Votes"
PramodValavala-MSFT answered

@UsmanSadiq-2394 Since this hasn't been fixed yet, a workaround you can pursue would be to use az rest against the Service Bus ARM REST API to create the correlation filter, though working with JSON payloads is a bit of a hassle.

In PowerShell, it's a bit simpler since you have objects as covered in the SO thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.