Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Bicep resource definition
The namespaces/topics/subscriptions/rules resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.ServiceBus/namespaces/topics/subscriptions/rules resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.ServiceBus/namespaces/topics/subscriptions/rules@2024-01-01' = {
parent: resourceSymbolicName
name: 'string'
properties: {
action: {
compatibilityLevel: int
requiresPreprocessing: bool
sqlExpression: 'string'
}
correlationFilter: {
contentType: 'string'
correlationId: 'string'
label: 'string'
messageId: 'string'
properties: {
{customized property}: 'string'
}
replyTo: 'string'
replyToSessionId: 'string'
requiresPreprocessing: bool
sessionId: 'string'
to: 'string'
}
filterType: 'string'
sqlFilter: {
compatibilityLevel: int
requiresPreprocessing: bool
sqlExpression: 'string'
}
}
}
Property Values
Microsoft.ServiceBus/namespaces/topics/subscriptions/rules
| Name | Description | Value |
|---|---|---|
| name | The resource name | string Constraints: Min length = 1 Max length = 50 (required) |
| parent | In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource. For more information, see Child resource outside parent resource. |
Symbolic name for resource of type: namespaces/topics/subscriptions |
| properties | Properties of Rule resource | Ruleproperties |
Action
| Name | Description | Value |
|---|---|---|
| compatibilityLevel | This property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20. | int |
| requiresPreprocessing | Value that indicates whether the rule action requires preprocessing. | bool |
| sqlExpression | SQL expression. e.g. MyProperty='ABC' | string |
CorrelationFilter
| Name | Description | Value |
|---|---|---|
| contentType | Content type of the message. | string |
| correlationId | Identifier of the correlation. | string |
| label | Application specific label. | string |
| messageId | Identifier of the message. | string |
| properties | dictionary object for custom filters | CorrelationFilterProperties |
| replyTo | Address of the queue to reply to. | string |
| replyToSessionId | Session identifier to reply to. | string |
| requiresPreprocessing | Value that indicates whether the rule action requires preprocessing. | bool |
| sessionId | Session identifier. | string |
| to | Address to send to. | string |
CorrelationFilterProperties
| Name | Description | Value |
|---|
Ruleproperties
| Name | Description | Value |
|---|---|---|
| action | Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter expression. | Action |
| correlationFilter | Properties of correlationFilter | CorrelationFilter |
| filterType | Filter type that is evaluated against a BrokeredMessage. | 'CorrelationFilter' 'SqlFilter' |
| sqlFilter | Properties of sqlFilter | SqlFilter |
SqlFilter
| Name | Description | Value |
|---|---|---|
| compatibilityLevel | This property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20. | int |
| requiresPreprocessing | Value that indicates whether the rule action requires preprocessing. | bool |
| sqlExpression | The SQL expression. e.g. MyProperty='ABC' | string |
ARM template resource definition
The namespaces/topics/subscriptions/rules resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.ServiceBus/namespaces/topics/subscriptions/rules resource, add the following JSON to your template.
{
"type": "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules",
"apiVersion": "2024-01-01",
"name": "string",
"properties": {
"action": {
"compatibilityLevel": "int",
"requiresPreprocessing": "bool",
"sqlExpression": "string"
},
"correlationFilter": {
"contentType": "string",
"correlationId": "string",
"label": "string",
"messageId": "string",
"properties": {
"{customized property}": "string"
},
"replyTo": "string",
"replyToSessionId": "string",
"requiresPreprocessing": "bool",
"sessionId": "string",
"to": "string"
},
"filterType": "string",
"sqlFilter": {
"compatibilityLevel": "int",
"requiresPreprocessing": "bool",
"sqlExpression": "string"
}
}
}
Property Values
Microsoft.ServiceBus/namespaces/topics/subscriptions/rules
| Name | Description | Value |
|---|---|---|
| apiVersion | The api version | '2024-01-01' |
| name | The resource name | string Constraints: Min length = 1 Max length = 50 (required) |
| properties | Properties of Rule resource | Ruleproperties |
| type | The resource type | 'Microsoft.ServiceBus/namespaces/topics/subscriptions/rules' |
Action
| Name | Description | Value |
|---|---|---|
| compatibilityLevel | This property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20. | int |
| requiresPreprocessing | Value that indicates whether the rule action requires preprocessing. | bool |
| sqlExpression | SQL expression. e.g. MyProperty='ABC' | string |
CorrelationFilter
| Name | Description | Value |
|---|---|---|
| contentType | Content type of the message. | string |
| correlationId | Identifier of the correlation. | string |
| label | Application specific label. | string |
| messageId | Identifier of the message. | string |
| properties | dictionary object for custom filters | CorrelationFilterProperties |
| replyTo | Address of the queue to reply to. | string |
| replyToSessionId | Session identifier to reply to. | string |
| requiresPreprocessing | Value that indicates whether the rule action requires preprocessing. | bool |
| sessionId | Session identifier. | string |
| to | Address to send to. | string |
CorrelationFilterProperties
| Name | Description | Value |
|---|
Ruleproperties
| Name | Description | Value |
|---|---|---|
| action | Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter expression. | Action |
| correlationFilter | Properties of correlationFilter | CorrelationFilter |
| filterType | Filter type that is evaluated against a BrokeredMessage. | 'CorrelationFilter' 'SqlFilter' |
| sqlFilter | Properties of sqlFilter | SqlFilter |
SqlFilter
| Name | Description | Value |
|---|---|---|
| compatibilityLevel | This property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20. | int |
| requiresPreprocessing | Value that indicates whether the rule action requires preprocessing. | bool |
| sqlExpression | The SQL expression. e.g. MyProperty='ABC' | string |
Usage Examples
Azure Quickstart Templates
The following Azure Quickstart templates deploy this resource type.
| Template | Description |
|---|---|
| Correlating messages over Logic Apps using Service Bus |
which shows how we can correlate messages over Logic Apps using Azure Service Bus |
Terraform (AzAPI provider) resource definition
The namespaces/topics/subscriptions/rules resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.ServiceBus/namespaces/topics/subscriptions/rules resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules@2024-01-01"
name = "string"
parent_id = "string"
body = {
properties = {
action = {
compatibilityLevel = int
requiresPreprocessing = bool
sqlExpression = "string"
}
correlationFilter = {
contentType = "string"
correlationId = "string"
label = "string"
messageId = "string"
properties = {
{customized property} = "string"
}
replyTo = "string"
replyToSessionId = "string"
requiresPreprocessing = bool
sessionId = "string"
to = "string"
}
filterType = "string"
sqlFilter = {
compatibilityLevel = int
requiresPreprocessing = bool
sqlExpression = "string"
}
}
}
}
Property Values
Microsoft.ServiceBus/namespaces/topics/subscriptions/rules
| Name | Description | Value |
|---|---|---|
| name | The resource name | string Constraints: Min length = 1 Max length = 50 (required) |
| parent_id | The ID of the resource that is the parent for this resource. | ID for resource of type: namespaces/topics/subscriptions |
| properties | Properties of Rule resource | Ruleproperties |
| type | The resource type | "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules@2024-01-01" |
Action
| Name | Description | Value |
|---|---|---|
| compatibilityLevel | This property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20. | int |
| requiresPreprocessing | Value that indicates whether the rule action requires preprocessing. | bool |
| sqlExpression | SQL expression. e.g. MyProperty='ABC' | string |
CorrelationFilter
| Name | Description | Value |
|---|---|---|
| contentType | Content type of the message. | string |
| correlationId | Identifier of the correlation. | string |
| label | Application specific label. | string |
| messageId | Identifier of the message. | string |
| properties | dictionary object for custom filters | CorrelationFilterProperties |
| replyTo | Address of the queue to reply to. | string |
| replyToSessionId | Session identifier to reply to. | string |
| requiresPreprocessing | Value that indicates whether the rule action requires preprocessing. | bool |
| sessionId | Session identifier. | string |
| to | Address to send to. | string |
CorrelationFilterProperties
| Name | Description | Value |
|---|
Ruleproperties
| Name | Description | Value |
|---|---|---|
| action | Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter expression. | Action |
| correlationFilter | Properties of correlationFilter | CorrelationFilter |
| filterType | Filter type that is evaluated against a BrokeredMessage. | 'CorrelationFilter' 'SqlFilter' |
| sqlFilter | Properties of sqlFilter | SqlFilter |
SqlFilter
| Name | Description | Value |
|---|---|---|
| compatibilityLevel | This property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20. | int |
| requiresPreprocessing | Value that indicates whether the rule action requires preprocessing. | bool |
| sqlExpression | The SQL expression. e.g. MyProperty='ABC' | string |
Usage Examples
Terraform Samples
A basic example of deploying ServiceBus Subscription Rule.
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "namespace" {
type = "Microsoft.ServiceBus/namespaces@2022-01-01-preview"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
properties = {
disableLocalAuth = false
publicNetworkAccess = "Enabled"
zoneRedundant = false
}
sku = {
capacity = 0
name = "Standard"
tier = "Standard"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "topic" {
type = "Microsoft.ServiceBus/namespaces/topics@2021-06-01-preview"
parent_id = azapi_resource.namespace.id
name = var.resource_name
body = {
properties = {
enableBatchedOperations = false
enableExpress = false
enablePartitioning = false
maxSizeInMegabytes = 5120
requiresDuplicateDetection = false
status = "Active"
supportOrdering = false
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "subscription" {
type = "Microsoft.ServiceBus/namespaces/topics/subscriptions@2021-06-01-preview"
parent_id = azapi_resource.topic.id
name = var.resource_name
body = {
properties = {
clientAffineProperties = {
}
deadLetteringOnFilterEvaluationExceptions = true
deadLetteringOnMessageExpiration = false
enableBatchedOperations = false
isClientAffine = false
maxDeliveryCount = 10
requiresSession = false
status = "Active"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "rule" {
type = "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules@2021-06-01-preview"
parent_id = azapi_resource.subscription.id
name = var.resource_name
body = {
properties = {
correlationFilter = {
contentType = "test_content_type"
correlationId = "test_correlation_id"
label = "test_label"
messageId = "test_message_id"
replyTo = "test_reply_to"
replyToSessionId = "test_reply_to_session_id"
sessionId = "test_session_id"
to = "test_to"
}
filterType = "CorrelationFilter"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}