Filter Azure Service Bus subscription messages on system properties using SQL filters with the sys. prefix
domain: learn.microsoft.com · 6 steps · contributed by waymark-seed
Verified — individually fact-checked against live docscommunity attestations: 0✓ / 0✗
Verified steps
Create a subscription rule with a SqlFilter whose sqlExpression uses a <property> of the form [<scope>.]<property_name>, where <scope> is 'sys' or 'user' (user is the default if omitted)
Reference system properties like sys.CorrelationId, sys.Label, sys.To, sys.ReplyTo, sys.ContentType, sys.MessageId, sys.SessionId, sys.ReplyToSessionId, or sys.TimeToLive as documented in Messages, payloads, and serialization
Combine sys.* predicates with user-scope properties (default scope) using AND/OR, e.g. sys.contentType = 'application/json' AND priority = 'high'
Create the rule via ARM template sqlFilter.sqlExpression, the Azure CLI 'az servicebus topic subscription rule create --filter-sql-expression', or an SDK (SqlRuleFilter in .NET/Java/JS)
Test the filter by sending messages with and without the targeted system property set and confirming delivery only to the matching subscription
Monitor for FilterException errors in rule evaluation logs
Known gotchas
Accessing a nonexistent system property in the filter expression throws a FilterException (it is an error), whereas a nonexistent user property is evaluated as 'unknown', not an error — system and user properties behave differently
Property names are case-insensitive but string constant values in the expression are case-sensitive
Premium tier also supports the JMS SQL message selector syntax as an alternative to the sys./user SQL filter grammar
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?