Create CorrelationFilter Rule on ServiceBus Topic Subscription
This is autogenerated. Please review and update as needed.
Describe the bug
Trying to create a correlation filter rule (Label = xxx) on a topic subscription. The same was successfully created in C# using the SubscriptionClient.AddRuleAsync:
_subscriptionClient.AddRuleAsync(new RuleDescription()
{
Name = "Rule1",
Filter = new CorrelationFilter { Label = "test" }
}).GetAwaiter().GetResult();
Command Name
az servicebus topic subscription rule create
Errors:
BadRequest - Value cannot be null.
Parameter name: sqlExpression CorrelationId: a9cf8052-c375-4235-aba4-3a153f9aaf33
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- Put any pre-requisite steps here...
az servicebus topic subscription rule create --name {} --namespace-name {} --subscription-name {} --topic-name {} --resource-group {} --subscription {} --enable-action-preprocessing false --enable-correlation-preprocessing true --enable-sql-preprocessing false --label {}
Expected Behavior
Create a correlation filter rule, with a label filter.
Environment Summary
Windows-10-10.0.18362-SP0
Python 3.6.6
azure-cli 2.1.0
Extensions:
application-insights 0.1.3
interactive 0.4.3
storage-preview 0.2.10
Additional Context
Is this a bug or am I missing something in the az servicebus topic subscription rule create command?
Also tries specifying --filter-sql-expression but this creates a SqlFilter type rule.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jfggdl
service bus
Hi , any update on the fix for this bug?
I also need to create correlation filter rules via the CLI. Any updates? Ths!
@v-Ajnava , could you please take a look at this one?
For some reason, it seems that the --filter-sql-expression parameter is required, even though it is marked as optional in the docs.
This seems to be a mistake in the Azure CLI implementation.
Here's the command handler: https://github.com/Azure/azure-cli/blob/8adf97355a605d147afc26f6c1b6f6afb6651c2f/src/azure-cli/azure/cli/command_modules/servicebus/custom.py#L326-L361
Here's the test for this command: https://github.com/Azure/azure-cli/blob/8adf97355a605d147afc26f6c1b6f6afb6651c2f/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_commands.py#L376-L379
There's no test for running the command without the --filter-sql-expression parameter, which it sets to test=test
Here's the recorded request and response generated by the test: https://github.com/Azure/azure-cli/blob/6185cbbf0136ffb1ec12de3efdcc3136ec3c2235/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/recordings/test_sb_rules.yaml#L539-L599
Internal Tracking
devdivcsef 359125
Are there any workarounds or do we just have to wait for a fix?
Still no fix? That is really annoying
is this issue still not fixed? seems the only way is to filter the correlation property using sql expression
service bus team should look into this
Looks like service bus team ignores this bug.
I'm experiencing the same issue. I know the workaround is there using C# and REST, but this is not ideal for a company that it's using your services and expects manage infrastructure with AZ CLI the same one that it's promoted if you are an IT professional. Also, what is the point to study and pass certifications exams when in real life things you expected to work are actually broken. This affects the credibility of all IT professionals.
When can we wait for a fix on this? Please increase priority.
Can you please allow us to create correlation filters through the CLI? Not much use encouraging correlation filters over sql expressions but then not giving us useful ways to implement it.
Hi Team,
Sincere apologies for the delay in response here.
We will triage internally and get back to you with an update soon.
Can we get an update please. This is a fairly critical issue considering how important correlation rules are for any kind of meaningful, performant, advanced routing in Azure ServiceBus via the az cli. This has been an issue for over 2 years now.
With this still broken it means we still need to use hacky workarounds in Azure Functions that first attempt to clear default rules and then add new rules each initialization via C# etc...
Hi Team,
Thanks for your patience here. Our dev team has been working on coming up with a fix ( as I type this comment). With everything in place, I am positive that we should be able to roll out a fix for this one by this month's end ( rough estimate).
I would circle back with update soon.
Hi Team,
I am here to share some good news!
We could fix this issue in the latest release (https://docs.microsoft.com/en-us/cli/azure/release-notes-azure-cli?view=azure-cli-latest#service-bus). Please try the rule creation at your side and let us know in case you observe any other discrepancies. Thanks
Hi, thanks for getting back to us about the update. I've just tested this and I can finally confirm that this is now working. Here is the syntax I'm using:
az servicebus topic subscription rule create -g rgtest --namespace-name sbtest --topic-name mytopicname --subscription-name mysubname -n mycorrelationfilterrulename --filter-type CorrelationFilter --label=mycorrelationfilterstring
This is working as expected using the syntax by DanoThom.
@DanoThom thank you.