Documentation menu

resources

Service Bus

Overview

{
	"service_bus": {
		"name": "sb-backend-{env}",
		"sku": "Standard",
		"authorization_rules": [
			{
				"name": "myManageRuleName",
				"rights": ["Listen", "Send", "Manage"]
			},
			{
				"name": "mySendRuleNameWithKeyVault",
				"rights": ["Listen", "Send", "Manage"],

				"primary_connection_string": "nameOfMySecretInsideTheVault",
				"primary_key": "nameOfMySecretInsideTheVault"
			}
		],
		"queues": [
			{
				"name": "myqueuename"
			}
		],
		"topics": [
			{
				"name": "my-topic-name",
				"subscriptions": [
					{
						"name": "subone",
						"requires_session": true
					},
					{
						"name": "subtwo",
						"requires_session": false,
						"rules": [
							{
								"name": "AccessRequestFilter",
								"filter_type": "Sql",
								"expression": "db.Name IN ('Example1', 'Example2', 'Example3')"
							},
							{
								"name": "CorrelationRequestFilter",
								"content_type": "text/html",
								"correlation_id": "1111111",
								"filter_type": "Correlation",
								"label": "mylabel",
								"message_id": "12345678",
								"properties": {
									"key1": "value"
								},
								"reply_to": "turmlo@compusftgroup.com",
								"reply_to_session_id": "1111111111",
								"requires_preprocessing": false,
								"session_id": "777777777",
								"to": "santga@compusoftgroup.com"
							}
						]
					}
				]
			}
		],
		"keyvault": {
			"@key_vault_name": "kv-sbus-{env}",
			"secret_name": "renameTheMasterConnectionString"
		},
		"@log_analytics_workspace_name": "log-test-{env}",
		"location": "northeurope",
		"external": false,
		"resource_group_name": "my-rg-name",
		"tags": { "example": "S0" }
	}
}

Service Bus Reference

Key Type Description
name (required) string The name of the Service Bus (see how to name)
sku (required) Service Bus Sku Definition The SKU of the namespace
queues array of Queue Definition Defines the queues for this Service Bus
topics array of optional Topic Definition Defines the topics for this Service Bus (not available on the Basic sku)
authorization_rules array of optional Authorization Rule Definition Defines the authorization rules for this Service Bus (defaults to no rules)
keyvault Keyvault The Key Vault configuration (defaults to no keyvault config)
@log_analytics_workspace_name string The name of the log analytics workspace to use to send logs (defaults to no integration)
location string Resource Location (defaults to the resource group location)
external bool A reference to an existing Storage Account (defaults to false)
resource_group_name string The name of the resource group where the resource is located, only with external resources (defaults to the resource group of the deployment)
tags object Additional tags for the resource (defaults to no additional tags)

Service Bus Sku

Value Description
Basic Defines a Basic service bus
Standard Defines a Standard service bus
Premium Defines a Premium service bus

Keyvault Config

Key Type Description
@key_vault_name (required) string The name of the Key Vault to use
secret_name string The name to give to the secret of the RootManageSharedAccessKey (defaults to SERVICE_BUS_NAME-connection-string)

Queue

Key Type Description
name (required) string The name of the Queue
max_message_size number The maximum size of the queue in megabytes (defaults to 1024)
auto_delete_on_idle string The time duration after which the message expires in iso 8601 duration (defaults to 30 days)
lock_duration string The amount of timne a message is locked for other receivers in iso 8601 duration (defaults to 1 minute)
dead_lettering_on_expiration boolean Whether this queue has dead letter support when a message expires (defaults to false)
default_ttl boolean The time duration after which the message expires in iso 8601 duration (defaults to 7 days)
requires_session boolean Whether this queue requires sessions (defaults to false)
max_delivery_count int The maximum delivery count. Messages are automatically deadlettered after this number of deliveries (defaults to 10)

Topic

Key Type Description
name (required) string The name of the Topic
max_message_size number The maximum size of the queue in megabytes (defaults to 1024)
partitioning bool Indicates whether the topic can be partitioned across multiple message brokers (defaults false)
subscriptions array of optional Subscription Definition The list of subscriptions for this topic (defaults to no subscriptions)

Topic Subscription

Key Type Description
name (required) string The name of the Topic
requires_session boolean Whether this subscription requires sessions (defaults to false)
rules array of option Rule Definition The list of rules for this subscription (defaults to no rules)

Subscription Rule

Key Type Description
name (required) string The name of the Rule
filter_type (required) Rule Filter enum The type of rule filter to use

Rule Filter

Value Type Description
Correlation Correlation Filter The correlation filter
Sql Sql Filter The sql filter

Correlation Filter

Key Type Description
correlation_id (required) string Identifier of the correlation
content_type (required) string The Content Type of the message
label (required) string The label of the message
message_id (required) string Identifier of the message
properties object Custom properties of the message (defaults to no custom properties)
reply_to (required) string The reply to address of the message
reply_to_session_id (required) string The reply to session id of the message
requires_preprocessing (required) bool Indicates whether the rule action requires preprocessing
session_id (required) string The session id of the message
to (required) string Address to send to

Sql Filter

Key Type Description
expression (required) string The SQL expression to use e.g. MyProperty=‘ABC’

Authorization Rule

Key Type Description
name (required) string The name of the authorization rule
rights (required) array of Rule Right Definition The list of rights to grant to this auth rule, minimum 1
primary_key string The name of the Key Vault secret to use for the primary key of the auth rule (defaults to no secret inserted in the Key Vault)
primary_connection_string string The name of the Key Vault secret to use for the primary connection string of the auth rule (defaults to RULE_NAME-connection-string)

Service Bus Sku

source

Value Description
Listen Confers the right to send messages to the entity
Send Confers the right to receive (queue, subscriptions) and all related message handling
Manage Confers the right to manage the topology of the namespace, including creating and deleting entities (Manage requires all 3 rights: Listen, Send, Manage)