1

I am trying to add a rule on a subscription on Azure service bus. The payload of the message looks like this:

{
  header: {
    // a bunch of data
  },
  body: {
    type: "payment",
    // a bunch of data
  }
}

Using New-AzureRMServiceBusRule to create a new rule, i get a 400 error when i try to add "body.type = 'payment'". If I just use "type = 'payment'" everything is fine, but the standard library my client uses forces everything into its own envelope structure.

Is there a way to parse a JSON payload in a service bus rule?

Jeff Hornby
  • 12,948
  • 4
  • 40
  • 61

1 Answers1

2

Azure Service Bus rules only operate on headers. If you'd like to evaluate things from the payload/body, you will have to promote those into custom/user headers.

An FYI, if you're filtering based on equality, Correlation filters is much more efficient than SQL filters.

Sean Feldman
  • 23,443
  • 7
  • 55
  • 80