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_detection_minutesWhether to enable duplicate detection, and if so, how long to check for.
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_namespaceLink this queue to an existing namespace instead of creating a new one.
Queuemessage_ttlTime To Live (TTL) value for messages expressed as a TimeSpan string, such as ‘01:30:00’ 1 hour, 30 minutes.
Queuemessage_ttl_daysTime To Live (TTL) value for messages in days.
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.
Subscriptionlink_to_namespaceLink this queue to an existing namespace instead of creating a new one.
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_detection_minutesWhether to enable duplicate detection, and if so, how long to check for.
Topicenable_partitionEnables partition support on the topic.
Topicmessage_ttlTime To Live (TTL) value for messages expressed as a TimeSpan string, such as ‘01:30:00’ 1 hour, 30 minutes, or as an integer days e.g. 4<Days>.
NamespaceskuThe ServiceBusNamespaceSku e.g. Standard
Namespacenamespace_nameThe name of the namespace that holds the queue.
Namespacedepends_onSets dependencies on the service bus 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
}