Share via


Example: Creating a Rule

 

The following example shows how to create a rule.

PUT /MyTopics/Topic1/Subscriptions/FirstSubscription/Rules/FirstRule HTTP/1.1
Host: Contoso.servicebus.windows.net
Content-Type: application/atom+xml
Accept: application/atom+xml
Authorization: …
Content-Length: nnn

<entry xmlns='http://www.w3.org/2005/Atom'>  
<content type='application/xml'>    
<RuleDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://schemas.microsoft.com/netservices/2010/10/servicebus/connect">
 <Filter i:type="SqlFilter">
  <SqlExpression>MyProperty='XYZ'</SqlExpression>
 </Filter>
 <Action i:type="SqlFilterAction">
  <SqlExpression>set MyProperty2 = 'ABC'</SqlExpression>
 </Action>
</RuleDescription>
</content>
</entry>

See Also

Rules
Delete Rule
Get Rule
Create Rule
List Rules
RuleDescription