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

KeyTypeDescription
name (required)stringThe name of the Service Bus (see how to name)
sku (required)Service Bus Sku DefinitionThe SKU of the namespace
queuesarray of Queue DefinitionDefines the queues for this Service Bus
topicsarray of optional Topic DefinitionDefines the topics for this Service Bus (not available on the Basic sku)
authorization_rulesarray of optional Authorization Rule DefinitionDefines the authorization rules for this Service Bus (defaults to no rules)
keyvaultKeyvaultThe Key Vault configuration (defaults to no keyvault config)
@log_analytics_workspace_namestringThe name of the log analytics workspace to use to send logs (defaults to no integration)
locationstringResource Location (defaults to the resource group location)
externalboolA reference to an existing Storage Account (defaults to false)
resource_group_namestringThe name of the resource group where the resource is located, only with external resources (defaults to the resource group of the deployment)
tagsobjectAdditional tags for the resource (defaults to no additional tags)

Service Bus Sku

ValueDescription
BasicDefines a Basic service bus
StandardDefines a Standard service bus
PremiumDefines a Premium service bus

Keyvault Config

KeyTypeDescription
@key_vault_name (required)stringThe name of the Key Vault to use
secret_namestringThe name to give to the secret of the RootManageSharedAccessKey (defaults to SERVICE_BUS_NAME-connection-string)

Queue

KeyTypeDescription
name (required)stringThe name of the Queue
max_message_sizenumberThe maximum size of the queue in megabytes (defaults to 1024)
auto_delete_on_idlestringThe time duration after which the message expires in iso 8601 duration (defaults to 30 days)
lock_durationstringThe amount of timne a message is locked for other receivers in iso 8601 duration (defaults to 1 minute)
dead_lettering_on_expirationbooleanWhether this queue has dead letter support when a message expires (defaults to false)
default_ttlbooleanThe time duration after which the message expires in iso 8601 duration (defaults to 7 days)
requires_sessionbooleanWhether this queue requires sessions (defaults to false)
max_delivery_countintThe maximum delivery count. Messages are automatically deadlettered after this number of deliveries (defaults to 10)

Topic

KeyTypeDescription
name (required)stringThe name of the Topic
max_message_sizenumberThe maximum size of the queue in megabytes (defaults to 1024)
partitioningboolIndicates whether the topic can be partitioned across multiple message brokers (defaults false)
subscriptionsarray of optional Subscription DefinitionThe list of subscriptions for this topic (defaults to no subscriptions)

Topic Subscription

KeyTypeDescription
name (required)stringThe name of the Topic
requires_sessionbooleanWhether this subscription requires sessions (defaults to false)
rulesarray of option Rule DefinitionThe list of rules for this subscription (defaults to no rules)

Subscription Rule

KeyTypeDescription
name (required)stringThe name of the Rule
filter_type (required)Rule Filter enumThe type of rule filter to use

Rule Filter

ValueTypeDescription
CorrelationCorrelation FilterThe correlation filter
SqlSql FilterThe sql filter

Correlation Filter

KeyTypeDescription
correlation_id (required)stringIdentifier of the correlation
content_type (required)stringThe Content Type of the message
label (required)stringThe label of the message
message_id (required)stringIdentifier of the message
propertiesobjectCustom properties of the message (defaults to no custom properties)
reply_to (required)stringThe reply to address of the message
reply_to_session_id (required)stringThe reply to session id of the message
requires_preprocessing (required)boolIndicates whether the rule action requires preprocessing
session_id (required)stringThe session id of the message
to (required)stringAddress to send to

Sql Filter

KeyTypeDescription
expression (required)stringThe SQL expression to use e.g. MyProperty=‘ABC’

Authorization Rule

KeyTypeDescription
name (required)stringThe name of the authorization rule
rights (required)array of Rule Right DefinitionThe list of rights to grant to this auth rule, minimum 1
primary_keystringThe 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_stringstringThe 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

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