Service Bus

Overview

The Service Bus builder creates service bus namespaces and their associated queues.

  • Service Bus Namespaces (Microsoft.ServiceBus/namespaces)

Builder Keywords

Applies ToKeywordPurpose
QueuenameThe name of the queue.
Queuelock_duration_minutesThe length of time that a lock can be held on a message.
Queuemax_delivery_countThe maximum number of times a message can be delivered before dead lettering.
Queueduplicate_detectionWhether to enable duplicate detection, and if so, how long to check for.
Queueduplicate_detection_minutesWhether to enable duplicate detection, and if so, how long to check for in minutes.
Queueenable_sessionEnables session support.
Queueenable_dead_letter_on_message_expirationEnables dead lettering of messages that expire.
Queueenable_partitionEnables partition support on the queue.
Queuelink_to_unmanaged_namespaceLink this queue to an existing namespace instead of creating a new one.
Queuemax_queue_sizeMaximum size for the queue in Megabytes e.g. 1024<Mb>.
Queuemessage_ttlTime To Live (TTL) value for messages expressed as a TimeSpan or a TimeSpan string, such as ‘01:30:00’ 1 hour, 30 minutes.
Queuemessage_ttl_daysTime To Live (TTL) value for messages in days.
Queueadd_authorization_ruleAdds an authorization rule to the queue.
SubscriptionnameThe name of the subscription.
Subscriptionlock_duration_minutesThe length of time that a lock can be held on a message.
Subscriptionmax_delivery_countThe maximum number of times a message can be delivered before dead lettering.
Subscriptionduplicate_detection_minutesWhether to enable duplicate detection, and if so, how long to check for.
Subscriptionenable_sessionEnables session support.
Subscriptionenable_dead_letter_on_message_expirationEnables dead lettering of messages that expire.
Subscriptionenable_partitionEnables partition support on the queue.
Subscriptionforward_toSpecifies a queue or topic to automatically forward messages delivered to this subscription.
Subscriptionlink_to_unmanaged_namespaceLink this queue to an existing namespace instead of creating a new one.
Subscriptionmessage_ttlTime To Live (TTL) value for messages expressed as a TimeSpan or a TimeSpan string, such as ‘01:30:00’ 1 hour, 30 minutes.
Subscriptionadd_filtersAdds multiple filters to a subscription
Subscriptionadd_sql_filterAdds a filter to a subscription using SQL syntax.
Subscriptionadd_correlation_filterAdds a filter to a subscription using header value correlation.
TopicnameThe name of the topic.
Topicduplicate_detectionWhether to enable duplicate detection, and if so, how long to check for.
Topicduplicate_detection_minutesWhether to enable duplicate detection, and if so, how long to check for in minutes.
Topicenable_partitionEnables partition support on the topic.
Topicmax_message_sizeThe maximum size of the message payload that can be accepted by the topic in Kilobytes e.g 1024<Kb>. Requires Premium SKU.
Topicmax_topic_sizeMaximum size for the topic in Megabytes e.g. 1024<Mb>.
Topicmessage_ttlTime To Live (TTL) value for messages expressed as a TimeSpan or a TimeSpan string, such as ‘01:30:00’ 1 hour, 30 minutes, or as an integer days e.g. 4<Days>.
Topiclink_to_unmanaged_namespaceInstead of creating or modifying a namespace, configure this topic to point to another unmanaged namespace instance.
NamespaceskuThe ServiceBusNamespaceSku e.g. Standard
Namespacenamespace_nameThe name of the namespace that holds the queue.
Namespacedepends_onSets dependencies on the service bus namespace.
Namespaceenable_zone_redundancyEnables zone redundancy.
Namespacedisable_public_network_accessDisables public network access to the namespace.
Namespacemin_tls_versionSet the minimum TLS version for clients connecting to the namespace.

Configuration Members

MemberPurpose
NamespaceDefaultConnectionStringReturns an ARM expression to retrieve the Primary Connection String of the service bus.
DefaultSharedAccessPolicyPrimaryKeyReturns an ARM expression to retrieve the Primary Key of the service bus.

Example

open Farmer
open Farmer.Builders
open Farmer.ServiceBus

let myServiceBus = serviceBus {
    name "my-namespace"
    sku Standard
    add_queues [
        queue { name "queueA" }
        queue { name "queueB" }
    ]
    add_topics [
        topic { name "topicA" }
        topic { name "topicB" }
    ]
}

let deployment = arm {
    location Location.NorthEurope
    add_resource myServiceBus
    output "connectionString" myServiceBus.NamespaceDefaultConnectionString
    output "defaultSharedAccessPolicyPrimaryKey" myServiceBus.DefaultSharedAccessPolicyPrimaryKey
}