question

Exitare-6656 avatar image
0 Votes"
Exitare-6656 asked Exitare-6656 commented

SQL Filters in service bus not working

I created a topic "Messages" in my service bus instance, and added a new subscription to it. I can send messages to this topic and the Azure Function v3 trigger is activated just fine. The message is received and displayed in an instant.
When I add an sql filter to filter messages for a subscription it is not working anymore.

What I did so far.
Created an sql filter in the azure portal:

 sys.Label = "Test" -> Not working as no messages are received anymore, even though I verified that the Label attribute is set.  

 sys.Label != "Test" Not working as no messages are received anymore, even though I verified that the Label attribute is set and not matching "Test"  

 sys.To = "Test" -> Not working, no messages are received. Verified that the messages contain the To member.  

 sys.Label is not Null -> This is strangely working.  

What am I doing wrong here?

Sql Filter in portal

azure-service-bus
image.png (122.1 KiB)
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

MayankBargali-MSFT avatar image
1 Vote"
MayankBargali-MSFT answered Exitare-6656 commented

Hi @Exitare-6656

Welcome to Microsoft Q&A! Thanks for posting the question.

The SQL filter value should be in single quotes 'test'

Example : sys.To = 'test'

Make sure that you are defining the message system properties while sending the message to topic.

113694-image.png

Feel free to get back to me if you need any assistance.

Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


image.png (7.5 KiB)
· 1
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.

Thank you!
Yeah that did it

Example : sys.To = 'test'

Honestly, the red quotes are really misleading. I had an error popping up while adding that, and I thought it was because of the single quotes and therefore changed it to double.

Anyways, thank you for the help!

0 Votes 0 ·