Skip to main content

Azure Service Bus Component

Interact with message queues and publish-subscribe topics (in a namespace)

Component key: azureServiceBus

Description

Azure Service Bus is a fully managed enterprise message broker with message queues and publish-subscribe topics (in a namespace).

Connections

Connection String

Connection String

The Connection String authentication method is required for any integrations using the following actions:

  1. Send Messages from Queue
  2. Receive Messages from Queue

Additionally, in an integration, ensure when using these actions, the connection is configured to the Connection String authentication type.

Creating a new namespace automatically generates an initial Shared Access Signature (SAS) policy with primary and secondary keys, and primary and secondary connection strings that each grant full control over all aspects of the namespace. See Service Bus authentication and authorization for information about how to create rules with more constrained rights for regular senders and receivers.

A client can use the connection string to connect to the Service Bus namespace. To copy the primary connection string for your namespace, follow these steps:

  1. On the Service Bus Namespace page, select Shared access policies on the left menu.
  2. On the Shared access policies page, select RootManageSharedAccessKey.

In the Policy: RootManageSharedAccessKey window, select the copy button next to Primary Connection String, to copy the connection string to your clipboard for later use. Paste this value into the connection configuration of your integration.

InputNotesExample
Connection String

The connection string for your Azure Service Bus namespace. You can find this in the Azure Portal under the 'Shared access policies' tab.

OAuth 2.0

Azure Service Bus uses OAuth 2.0 Authentication to authenticate the security principal (a user, a group, or service principal) running the application. Create and Register your Microsoft application with an Azure AD tenant. For more information refer to https://learn.microsoft.com/en-us/azure/service-bus-messaging/authenticate-application

The first step in using Azure AD to authorize Service Bus entities is registering your client application with an Azure AD tenant from the Azure portal

Menu > All Services > Azure Active Directory

  • Select Add > App registration
  • Name the App and set the Supported Account types to 'Accounts in any organizational directory (Any Azure AD directory - Multitenant)'.
  • In Redirect URI set the first field to “Web”. In the second field enter https://oauth2.prismatic.io/callback and select Register.

Create a client Secret

  • Navigate to your app registration in the Azure portal if you aren't already on the page.
  • Select Certificates & secrets on the left menu.
  • Under Client secrets, select New client secret to create a new secret.

Set the Permissions to the Service Bus API

  • If your application is a console application, you must register a native application and add API permissions for Microsoft.ServiceBus to the required permissions set. Native applications also need a redirect-uri in Azure AD, which serves as an identifier; the URI doesn't need to be a network destination. Use https://servicebus.microsoft.com for this example, because the sample code already uses that URI.

Assign Azure roles using the Azure portal

Now, configure the OAuth 2.0 connection. Add an Azure Service Bus OAuth 2.0 Connection config variable:

  • Use the Application (client) ID value for the Client ID field.
  • Use the Client Secret for the same named field.
  • If you didn't select Multitenant when creating the Azure application, you will need to replace the Authorize URL and Token URL with ones specific to your tenant.

Save your integration and you should be able to authenticate a user through Azure Service Bus with OAuth 2.0.

InputNotesExample
Authorize URL

The OAuth 2.0 Authorization URL for Azure Service Bus

https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize
Client ID

Generate this value when you create your Active Directory App

Client Secret

Generate this value when you create your Active Directory App

Scopeshttps://management.azure.com/.default
Tenant ID

Generate this value when you create your Active Directory App

Token URL

The OAuth 2.0 Token URL for Azure Service Bus

https://login.microsoftonline.com/organizations/oauth2/v2.0/token

Triggers

Webhook

Receive and validate webhook requests from Azure Service Bus for webhooks you configure. | key: subscriptionMessageWebhook

To trigger webhook calls within Service Bus, you need to make use of Azure Event Grid and Logic Apps. Follow these steps to build the webhook integration:

  1. Register Microsoft.EventGrid resource provider to the subscription:

    • Navigate to Azure account subscriptions.
    • Open the subscription settings.
    • Go to Resource Providers.
    • Register Microsoft.EventGrid resource.
  2. Create a Service Bus namespace: Create a Service Bus Namespace

  3. Receive messages by using Logic Apps: Receive Messages by Using Logic Apps

  4. Add a step to receive messages from Service Bus via Event Grid: Add a Step to Receive Messages from Service Bus via Event Grid

  5. Add a foreach loop: Add a Foreach Loop

  6. Add an HTTP action to post to your trigger:

  • Within the For Each loop, select "Add an action."
  • In the "Search connectors and actions" text box, enter "HTTP."
  • Select the HTTP action.
  • Select POST for Method.
  • Add the flow URL to the URI Input.
  • For the Body, add this expression: base64ToString(items('For_each')?['ContentData']).
  1. Add another action in the foreach loop to complete the message: Add Another Action in the Foreach Loop to Complete the Message

To test the webhook, send a message to the Topic Subscription using Service Bus Explorer. This should trigger the integration.


Actions

Create or Update Namespaces

Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. | key: createOrUpdateNamespaces

InputNotesExample
Alternate Name

Alternate name for the namespace.

Connection
Disable Local Auth

This property disables SAS authentication for the Service Bus namespace.

false
Identity Type

Type of managed service identity.

Key Source

Enumerates the possible value of keySource for Encryption

Microsoft.KeyVault
Key Vault Properties

Properties of the Key Vault

Location

The geo-location where the resource lives

Namespace Name

The namespace name

Private Endpoint Connections

List of private endpoint connections.

Require Infrastructure Encryption

Enable Infrastructure Encryption (Double Encryption)

false
Resource Group Name

Name of the Resource group within the Azure subscription.

SKU

SKU of the namespace.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Tags

Resource tags.

Identity User Assigned Identities

Properties for User Assigned Identities

Zone Redundant

Enabling this property creates a Premium Service Bus Namespace in regions supported availability zones.

false

Create or Update Queue

Creates or updates a Service Bus queue. This operation is idempotent. | key: createOrUpdateQueue

InputNotesExample
Auto Delete On Idle

ISO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes.

Connection
Dead Lettering On Message Expiration

Value that indicates whether a subscription has dead letter support when a message expires.

false
Default Message Time To Live

ISO 8601 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.

Duplicate Detection History Time Window

ISO8601 timespan structure that defines the duration of the duplicate detection history. The default value is 10 minutes.

Enable Batched Operations

Value that indicates whether server-side batched operations are enabled.

false
Enable Express

Value that indicates whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage.

false
Enable Partitioning

Value that indicates whether the topic to be partitioned across multiple message brokers is enabled.

false
Forward Dead Lettered Messages To

Queue/Topic name to forward the Dead Letter message.

Forward To

Queue/Topic name to forward the messages.

Lock Duration

ISO 8601 lock duration timespan for the subscription. The default value is 1 minute.

Max Delivery Count

Number of maximum deliveries.

Max Message Size in Kilobytes

Maximum size (in KB) of the message payload that can be accepted by the topic. This property is only used in Premium today, and the default is 1024.

Max Size in Megabytes

Maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. Default is 1024.

Namespace Name

The namespace name

Queue Name

The queue name.

Requires Duplicate Detection

Value indicating if this topic requires duplicate detection.

false
Requires Session

Value indicating if a subscription supports the concept of sessions.

false
Resource Group Name

Name of the Resource group within the Azure subscription.

Status

Status of the messaging entity.

Use one: Active, Disabled, Restoring, SendDisabled, ReceiveDisabled, Creating, Deleting, Renaming ,Unknown
Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.


Create or Update Rules

Creates a new rule and updates an existing rule | key: createOrUpdateRules

InputNotesExample
Action

Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter expression.

Connection
Correlation Filter

Represents the correlation filter expression.

Filter Type

Filter type that is evaluated against a BrokeredMessage.

SqlFilter, CorrelationFilter
Namespace Name

The namespace name

Resource Group Name

Name of the Resource group within the Azure subscription.

Rule Name

The rule name.

SQL Filter

Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Subscription Name

The subscription name.

Topic Name

The topic name.


Create or Update Subscription

Creates a topic subscription. | key: createOrUpdateSubscription

InputNotesExample
Auto Delete On Idle

ISO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes.

Client ID

Indicates the Client ID of the application that created the client-affine subscription.

Connection
Dead Lettering On Filter Evaluation Exceptions

Value that indicates whether a subscription has dead letter support on filter evaluation exceptions.

false
Dead Lettering On Message Expiration

Value that indicates whether a subscription has dead letter support when a message expires.

false
Default Message Time To Live

ISO 8601 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.

Duplicate Detection History Time Window

ISO8601 timespan structure that defines the duration of the duplicate detection history. The default value is 10 minutes.

Enable Batched Operations

Value that indicates whether server-side batched operations are enabled.

false
Forward Dead Lettered Messages To

Queue/Topic name to forward the Dead Letter message.

Forward To

Queue/Topic name to forward the messages.

Is Client Affine

Value that indicates whether the subscription has an affinity to the client id.

false
Is Durable

For client-affine subscriptions, this value indicates whether the subscription is durable or not.

false
Is Shared

For client-affine subscriptions, this value indicates whether the subscription is shared or not.

false
Lock Duration

ISO 8601 lock duration timespan for the subscription. The default value is 1 minute.

Max Delivery Count

Number of maximum deliveries.

Namespace Name

The namespace name

Requires Session

Value indicating if a subscription supports the concept of sessions.

false
Resource Group Name

Name of the Resource group within the Azure subscription.

Status

Status of the messaging entity.

Use one: Active, Disabled, Restoring, SendDisabled, ReceiveDisabled, Creating, Deleting, Renaming ,Unknown
Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Subscription Name

The subscription name.

Topic Name

The topic name.


Create or Update Topic

Creates or updates a topic in the specified namespace. | key: createOrUpdateTopic

InputNotesExample
Auto Delete On Idle

ISO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes.

Connection
Default Message Time To Live

ISO 8601 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.

Duplicate Detection History Time Window

ISO8601 timespan structure that defines the duration of the duplicate detection history. The default value is 10 minutes.

Enable Batched Operations

Value that indicates whether server-side batched operations are enabled.

false
Enable Express

Value that indicates whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage.

false
Enable Partitioning

Value that indicates whether the topic to be partitioned across multiple message brokers is enabled.

false
Max Message Size in Kilobytes

Maximum size (in KB) of the message payload that can be accepted by the topic. This property is only used in Premium today, and the default is 1024.

Max Size in Megabytes

Maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. Default is 1024.

Namespace Name

The namespace name

Requires Duplicate Detection

Value indicating if this topic requires duplicate detection.

false
Resource Group Name

Name of the Resource group within the Azure subscription.

Status

Status of the messaging entity.

Use one: Active, Disabled, Restoring, SendDisabled, ReceiveDisabled, Creating, Deleting, Renaming ,Unknown
Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Support Ordering

Value that indicates whether the topic supports ordering.

false
Topic Name

The topic name.


Delete Namespace

Deletes an existing namespace. This operation also removes all associated resources under the namespace. | key: deleteNamespace

InputNotesExample
Connection
Namespace Name

The namespace name

Resource Group Name

Name of the Resource group within the Azure subscription.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.


Delete Queue

Deletes a queue from the specified namespace in a resource group. | key: deleteQueue

InputNotesExample
Connection
Namespace Name

The namespace name

Queue Name

The queue name.

Resource Group Name

Name of the Resource group within the Azure subscription.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.


Delete Rule

Deletes an existing rule. | key: deleteRule

InputNotesExample
Connection
Namespace Name

The namespace name

Resource Group Name

Name of the Resource group within the Azure subscription.

Rule Name

The rule name.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Subscription Name

The subscription name.

Topic Name

The topic name.


Delete Subscriptions

Deletes a subscription from the specified topic. | key: deleteSubscriptions

InputNotesExample
Connection
Namespace Name

The namespace name

Resource Group Name

Name of the Resource group within the Azure subscription.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Subscription Name

The subscription name.

Topic Name

The topic name.


Delete Topic

Deletes a topic from the specified namespace and resource group. | key: deleteTopic

InputNotesExample
Connection
Namespace Name

The namespace name

Resource Group Name

Name of the Resource group within the Azure subscription.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Topic Name

The topic name.


Get Namespaces

Gets a description for the specified namespace. | key: getNamespaces

InputNotesExample
Connection
Namespace Name

The namespace name

Resource Group Name

Name of the Resource group within the Azure subscription.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.


Get Queue

Returns a description for the specified queue. | key: getQueue

InputNotesExample
Connection
Namespace Name

The namespace name

Queue Name

The queue name.

Resource Group Name

Name of the Resource group within the Azure subscription.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.


Get Rule

Retrieves the description for the specified rule. | key: getRule

InputNotesExample
Connection
Namespace Name

The namespace name

Resource Group Name

Name of the Resource group within the Azure subscription.

Rule Name

The rule name.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Subscription Name

The subscription name.

Topic Name

The topic name.


Get Subscriptions

Returns a subscription description for the specified topic. | key: getSubscriptions

InputNotesExample
Connection
Namespace Name

The namespace name

Resource Group Name

Name of the Resource group within the Azure subscription.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Subscription Name

The subscription name.

Topic Name

The topic name.


Get Topic

Gets all the topics in a namespace | key: getTopic

InputNotesExample
Connection
Namespace Name

The namespace name

Resource Group Name

Name of the Resource group within the Azure subscription.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Topic Name

The topic name.


List Namespaces

Gets all the available namespaces within the subscription, irrespective of the resource groups. | key: listNamespaces

InputNotesExample
Connection
Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.


List Namespaces By Resource Group

Gets the available namespaces within a resource group. | key: listNamespacesByResourceGroup

InputNotesExample
Connection
Resource Group Name

Name of the Resource group within the Azure subscription.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.


List Queues

Gets the queues within a namespace. | key: listQueues

InputNotesExample
Skip

Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls.

Top

May be used to limit the number of results to the most recent N usageDetails.

Connection
Namespace Name

The namespace name

Resource Group Name

Name of the Resource group within the Azure subscription.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.


List Rules

List all the rules within given topic-subscription | key: listRules

InputNotesExample
Skip

Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls.

Top

May be used to limit the number of results to the most recent N usageDetails.

Connection
Namespace Name

The namespace name

Resource Group Name

Name of the Resource group within the Azure subscription.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Subscription Name

The subscription name.

Topic Name

The topic name.


List Subscriptions

List all the subscriptions | key: listSubscriptions

InputNotesExample
Connection
Version

Version of the API.

2016-06-01

List Subscriptions By Topic

List all the subscriptions under a specified topic. | key: listSubscriptionsByTopic

InputNotesExample
Skip

Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls.

Top

May be used to limit the number of results to the most recent N usageDetails.

Connection
Namespace Name

The namespace name

Queue Name

The queue name.

Resource Group Name

Name of the Resource group within the Azure subscription.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Topic Name

The topic name.


List Topics By Namespace

Gets all the topics in a namespace | key: listTopicsByNamespace

InputNotesExample
Skip

Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls.

Top

May be used to limit the number of results to the most recent N usageDetails.

Connection
Namespace Name

The namespace name

Queue Name

The queue name.

Resource Group Name

Name of the Resource group within the Azure subscription.

Subscription ID

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.


Raw Request

Send raw HTTP request to Azure Service Bus | key: rawRequest

InputNotesExample
Connection
Data

The HTTP body payload to send to the URL.

{"exampleKey": "Example Data"}
Debug Request

Enabling this flag will log out the current request.

false
File Data

File Data to be sent as a multipart form upload.

[{key: "example.txt", value: "My File Contents"}]
File Data File Names

File names to apply to the file data inputs. Keys must match the file data keys above.

Form Data

The Form Data to be sent as a multipart form upload.

[{"key": "Example Key", "value": new Buffer("Hello World")}]
Header

A list of headers to send with the request.

User-Agent: curl/7.64.1
Max Retry Count

The maximum number of retries to attempt. Specify 0 for no retries.

0
Method

The HTTP method to use.

Query Parameter

A list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2.

Response Type

The type of data you expect in the response. You can request json, text, or binary data.

json
Retry On All Errors

If true, retries on all erroneous responses regardless of type. This is helpful when retrying after HTTP 429 or other 3xx or 4xx errors. Otherwise, only retries on HTTP 5xx and network errors.

false
Retry Delay (ms)

The delay in milliseconds between retries. This is used when 'Use Exponential Backoff' is disabled.

0
Timeout

The maximum time that a client will await a response to its request

2000
URL

Input the path only (/{subscriptionId}/providers/Microsoft.ServiceBus/namespaces?api-version=2021-11-01), The base URL is already included (https://management.azure.com/subscriptions). For example, to connect to https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/namespaces?api-version=2021-11-01, only /{subscriptionId}/providers/Microsoft.ServiceBus/namespaces?api-version=2021-11-01 is entered in this field.

/{subscriptionId}/providers/Microsoft.ServiceBus/namespaces?api-version=2021-11-01
Use Exponential Backoff

Specifies whether to use a pre-defined exponential backoff strategy for retries. When enabled, 'Retry Delay (ms)' is ignored.

false

Receive Messages from Queue

Receive messages from a queue. Receive messages from a queue will remove the message from the queue. | key: receiveMessagesFromQueue

InputNotesExample
Amount of Messages

Amount of messages to receive from the queue.

Connection
Max Time To Wait

Max time to wait (in seconds) for messages to receive from the queue. Default is 60 seconds.

60
Namespace Name

The namespace name

Peek

If true, the messages will be peeked from the queue, which doesn't alter the visibility of the message. If false, the messages will be received from the queue. https://learn.microsoft.com/en-us/rest/api/storageservices/peek-messages

false
Queue Name

The queue name.

Return Full Messages

If true, the full message objects will be returned including message ID, sequence number, delivery metadata, etc. If false, only the messages bodies will be returned.

false

Send Message to Queue

Send a single message to a queue. | key: sendMessageToQueue

InputNotesExample
Body

The body of the message.

Connection
Content Type

The content type of the message.

application/json
Message ID

An optional unique ID of the message to be used for deduplication. If omitted, a unique ID will be generated by Microsoft.

Namespace Name

The namespace name

Partition Key

An optional partition key https://learn.microsoft.com/en-us/dotnet/api/azure.messaging.servicebus.servicebusmessage.partitionkey

Queue Name

The queue name.

Reply To

An optional address that the receiver can use to reply to the message. https://learn.microsoft.com/en-us/dotnet/api/azure.messaging.servicebus.servicebusmessage.replyto

Scheduled Enqueue Time UTC

An optional time at which the message should be enqueued. If omitted, the message will be enqueued immediately.

Subject

An optional subject for the message.

To

An optional address that specifies the intended recipient of the message. https://learn.microsoft.com/en-us/dotnet/api/azure.messaging.servicebus.servicebusmessage.to


Send Multiple Messages to Queue

Send multiple plain text messages to a queue. | key: sendMessagesToQueue

InputNotesExample
Connection
Messages

List of messages to send to the queue.

Namespace Name

The namespace name

Queue Name

The queue name.