OpenMCF logoOpenMCF

Loading...

Azure Service Bus Namespace

Deploys an Azure Service Bus namespace with optional queues and topics for enterprise message brokering. The component bundles the namespace with its messaging entities because a namespace without at least one queue or topic is incomplete. Supports Basic, Standard, and Premium tiers with duplicate detection, sessions, dead-lettering, message forwarding, and zone redundancy.

What Gets Created

When you deploy an AzureServiceBusNamespace resource, OpenMCF provisions:

  • Service Bus Namespace -- a servicebus.Namespace resource in the specified region and resource group, configured with the chosen SKU tier, TLS version, and optional Premium capacity settings
  • Queues -- a servicebus.Queue for each entry in queues, supporting point-to-point messaging with configurable lock duration, sessions, duplicate detection, dead-lettering, and message forwarding
  • Topics -- a servicebus.Topic for each entry in topics, supporting publish-subscribe messaging with configurable partitioning, duplicate detection, and message ordering (Standard and Premium only)
  • Azure Tags -- resource metadata tags applied to the namespace for tracking and governance

Prerequisites

  • Azure credentials configured via environment variables or OpenMCF provider config
  • An Azure Resource Group where the namespace will be created (can reference an AzureResourceGroup resource)
  • A globally unique namespace name -- the name becomes the endpoint {name}.servicebus.windows.net
  • SKU selection -- Basic for simple queues only, Standard for queues + topics, Premium for dedicated capacity, VNet integration, and zone redundancy

Quick Start

Create a file servicebus.yaml:

apiVersion: azure.openmcf.org/v1
kind: AzureServiceBusNamespace
metadata:
  name: my-sb
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: dev.AzureServiceBusNamespace.my-sb
spec:
  region: eastus
  resourceGroup: my-rg
  name: my-servicebus-ns
  queues:
    - name: orders

Deploy:

openmcf apply -f servicebus.yaml

This creates a Standard-tier Service Bus namespace with a single orders queue, TLS 1.2 enforcement, and public network access enabled.

Configuration Reference

Required Fields

FieldTypeDescriptionValidation
regionstringAzure region for the namespace (e.g., eastus, westeurope).Required, minimum length 1
resourceGroupStringValueOrRefAzure Resource Group name. Can reference an AzureResourceGroup resource via valueFrom.Required
namestringGlobally unique namespace name. Becomes the endpoint {name}.servicebus.windows.net. ForceNew.Required, 6-50 characters, pattern ^[a-zA-Z][-a-zA-Z0-9]{4,48}[a-zA-Z0-9]$

Optional Fields

FieldTypeDefaultDescription
skustring"Standard"SKU tier. Values: Basic (queues only), Standard (queues + topics, 99.95% SLA), Premium (dedicated capacity, VNet, zones).
capacityint--Messaging units for Premium SKU (1, 2, 4, 8, 16). Each unit provides ~1 MB/s send throughput. Ignored for Basic/Standard.
premiumMessagingPartitionsint--Partitions for Premium SKU (1, 2, 4). ForceNew. Ignored for Basic/Standard.
zoneRedundantboolfalseEnable zone redundancy (Premium only). Replicates across availability zones.
minimumTlsVersionstring"1.2"Minimum TLS version. Values: 1.0, 1.1, 1.2.
publicNetworkAccessEnabledbooltrueAllow public internet access. Set to false for private-only access via Private Endpoint.
queueslist[]Queues for point-to-point messaging. See queue fields below.
topicslist[]Topics for publish-subscribe messaging (Standard/Premium only). See topic fields below.

Queue fields (each entry in queues):

FieldTypeDefaultDescription
namestring--Queue name (required, 1-260 characters)
maxSizeInMegabytesint(SKU default)Maximum queue size. Standard: 1024-5120. Premium: up to 81920.
partitioningEnabledboolfalseEnable queue partitioning for higher throughput. ForceNew.
defaultMessageTtlstring(unbounded)Message time-to-live as ISO 8601 duration (e.g., P14D, PT1H).
lockDurationstring"PT1M"Message lock duration. Range: PT5S to PT5M.
maxDeliveryCountint10Max delivery attempts before dead-lettering. Minimum: 1.
requiresDuplicateDetectionboolfalseDeduplicate messages by MessageId. ForceNew.
requiresSessionboolfalseEnable ordered, stateful session processing. ForceNew.
deadLetteringOnMessageExpirationboolfalseMove expired messages to dead-letter queue instead of discarding.
forwardTostring--Auto-forward messages to another queue or topic in the namespace.
forwardDeadLetteredMessagesTostring--Auto-forward dead-lettered messages to another entity.

Topic fields (each entry in topics):

FieldTypeDefaultDescription
namestring--Topic name (required, 1-260 characters)
maxSizeInMegabytesint(SKU default)Maximum topic size.
partitioningEnabledboolfalseEnable topic partitioning. ForceNew.
defaultMessageTtlstring(unbounded)Message time-to-live as ISO 8601 duration.
requiresDuplicateDetectionboolfalseDeduplicate messages by MessageId. ForceNew.
supportOrderingboolfalseEnable message ordering for session-enabled subscriptions.

Examples

Standard Messaging with Queues and Topics

A Standard-tier namespace with a work queue and an events topic for a typical microservices architecture:

apiVersion: azure.openmcf.org/v1
kind: AzureServiceBusNamespace
metadata:
  name: app-messaging
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: prod.AzureServiceBusNamespace.app-messaging
spec:
  region: eastus
  resourceGroup: prod-rg
  name: app-messaging-ns
  queues:
    - name: order-processing
      maxDeliveryCount: 5
      deadLetteringOnMessageExpiration: true
      defaultMessageTtl: P7D
    - name: notification-delivery
      lockDuration: PT2M
  topics:
    - name: order-events
      defaultMessageTtl: P14D
    - name: inventory-updates

Premium Enterprise Namespace

A Premium-tier namespace with dedicated capacity, zone redundancy, and private-only access:

apiVersion: azure.openmcf.org/v1
kind: AzureServiceBusNamespace
metadata:
  name: enterprise-sb
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: prod.AzureServiceBusNamespace.enterprise-sb
spec:
  region: westeurope
  resourceGroup: prod-rg
  name: enterprise-messaging
  sku: Premium
  capacity: 4
  premiumMessagingPartitions: 2
  zoneRedundant: true
  publicNetworkAccessEnabled: false
  queues:
    - name: payment-processing
      requiresSession: true
      requiresDuplicateDetection: true
      maxDeliveryCount: 3
      deadLetteringOnMessageExpiration: true
  topics:
    - name: audit-events
      supportOrdering: true

Event-Driven Microservices with Forwarding

A namespace with message forwarding chains for routing patterns:

apiVersion: azure.openmcf.org/v1
kind: AzureServiceBusNamespace
metadata:
  name: routing-sb
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: prod.AzureServiceBusNamespace.routing-sb
spec:
  region: eastus
  resourceGroup: prod-rg
  name: routing-messaging-ns
  queues:
    - name: inbound
      forwardTo: processing
    - name: processing
      maxDeliveryCount: 3
      forwardDeadLetteredMessagesTo: failed-messages
    - name: failed-messages
      defaultMessageTtl: P30D

Using Foreign Key References

Reference an OpenMCF-managed resource group:

apiVersion: azure.openmcf.org/v1
kind: AzureServiceBusNamespace
metadata:
  name: ref-sb
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: prod.AzureServiceBusNamespace.ref-sb
spec:
  region: eastus
  resourceGroup:
    valueFrom:
      kind: AzureResourceGroup
      name: my-rg
      field: status.outputs.resource_group_name
  name: ref-messaging-ns
  queues:
    - name: tasks
  topics:
    - name: events

Stack Outputs

After deployment, the following outputs are available in status.outputs:

OutputTypeDescription
namespace_idstringAzure Resource Manager ID of the namespace. Referenced by AzurePrivateEndpoint for private connectivity.
namespace_namestringName of the namespace
endpointstringNamespace endpoint URL (e.g., https://{name}.servicebus.windows.net:443/)
primary_connection_stringstringConnection string from the default RootManageSharedAccessKey (sensitive)
primary_keystringPrimary SAS key for authentication (sensitive)
queue_idsmap<string, string>Map of queue names to their Azure Resource Manager IDs
topic_idsmap<string, string>Map of topic names to their Azure Resource Manager IDs

Related Components

  • AzureResourceGroup -- provides the resource group for namespace placement
  • AzurePrivateEndpoint -- establishes private connectivity to the namespace
  • AzureFunctionApp -- serverless functions triggered by Service Bus messages

Next article

Azure Service Plan

Azure Service Plan Deploys an Azure App Service Plan that defines the compute tier, VM size, instance count, and pricing for hosting Azure Web Apps, Function Apps, and Logic Apps. The plan supports Linux and Windows operating systems, zone-redundant deployments, per-site scaling, and elastic worker limits for serverless workloads. What Gets Created When you deploy an AzureServicePlan resource, OpenMCF provisions: App Service Plan -- an appservice.ServicePlan resource in the specified region and...
Read next article
Presets
3 ready-to-deploy configurationsView presets →