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

  1. 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)
  2. 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
  3. Combine sys.* predicates with user-scope properties (default scope) using AND/OR, e.g. sys.contentType = 'application/json' AND priority = 'high'
  4. 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)
  5. Test the filter by sending messages with and without the targeted system property set and confirming delivery only to the matching subscription
  6. Monitor for FilterException errors in rule evaluation logs

Known gotchas

Related routes

Configure Azure Service Bus MaxDeliveryCount and inspect the dead-letter sub-queue for a queue or subscription
learn.microsoft.com · 6 steps · unrated
Configure Azure Service Bus duplicate detection window and diagnose prefetch pitfalls
azure-service-bus · 6 steps · unrated

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?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans