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

OAuth 2.0

Connection and Authentication

Azure OAuth 2.0 Connection

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 in Prismatic. 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.

Triggers

Subscription Message Webhook

Trigger for handling Azure Service Bus Topic Subscription Message (Leveraging Azure Event Grid and Azure Logic Apps) | key: subscriptionMessageWebhook

Output Example Payload

{
"payload": {
"headers": {
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US",
"Content-Type": "text/plain; charset=utf-8",
"Host": "hooks.prismatic.io",
"User-Agent": "azure-logic-apps/1.0 (workflow 58fce0896a114cceb9c92a4d07611234; version 08585128901970019172)",
"X-Amz-Cf-Id": "iOiPjKC55qKUNE5Jid-emKKQRPH3TFz7d3O50UcFk-IkV7RuJk1234==",
"X-Amzn-Trace-Id": "Root=1-64a7c5c8-7af54c4a6b77f32e14401234",
"x-ms-action-tracking-id": "ecbd964b-ca88-40dd-977c-5db5129951234",
"x-ms-activity-vector": "IN.0J",
"x-ms-client-request-id": "97110424-b3ec-453a-9e5c-81807df91234",
"x-ms-client-tracking-id": "085851289014160877189743753061234",
"x-ms-correlation-id": "97110424-b3ec-453a-9e5c-81807df91234",
"x-ms-execution-location": "eastus",
"x-ms-tracking-id": "97110424-b3ec-453a-9e5c-81807df91234",
"x-ms-workflow-id": "58fce0896a114cceb9c92a4d07611234",
"x-ms-workflow-name": "subscriptionLogicApp",
"x-ms-workflow-operation-name": "HTTP",
"x-ms-workflow-repeatitem-batch-index": "0",
"x-ms-workflow-repeatitem-index": "0",
"x-ms-workflow-repeatitem-scope-name": "For_each",
"x-ms-workflow-resourcegroup-name": "Prismatic",
"x-ms-workflow-run-id": "085851289014160877179743753061234",
"x-ms-workflow-run-tracking-id": "878c50fd-9ec7-417e-bb06-0eb3e5d21234",
"x-ms-workflow-subscription-id": "782a9e34-9e60-4037-b32e-40b85e601234",
"x-ms-workflow-system-id": "/locations/eastus/scaleunits/prod-55/workflows/58fce0896a114cceb9c92a4d07611234",
"x-ms-workflow-version": "08585128901970011234"
},
"queryParameters": null,
"rawBody": "<data (4 bytes)>",
"body": {
"data": "test",
"contentType": "text/plain; charset=utf-8"
},
"pathFragment": "",
"webhookUrls": {
"Flow 1": "https://hooks.prismatic.io/trigger/WEBHOOK_ID"
},
"webhookApiKeys": {
"Flow 1": ["sample-api-key"]
},
"invokeUrl": "https://hooks.prismatic.io/trigger/WEBHOOK_ID",
"executionId": "SW5zdGFuY2VFeGVjdXRpb25SZXN1bHQ6ZGNhYTAxOTUtOTcwMi00NzAzLWJkZTctMmEwMDIwMWIz1234",
"customer": {
"id": "testCustomerId",
"name": "Test Customer",
"externalId": "testCustomerExternalId"
},
"instance": {
"id": "testInstanceId",
"name": "Test Instance"
},
"user": {
"id": "testUserId",
"email": "testUserEmail@example.com",
"name": "Test User",
"externalId": "testUserExternalId"
}
}
}

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


Create or Update Queue

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


Create or Update Rules

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


Create or Update Subscription

Creates a topic subscription. | key: createOrUpdateSubscription


Create or Update Topic

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


Delete Namespace

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


Delete Queue

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


Delete Rule

Deletes an existing rule. | key: deleteRule


Delete Subscriptions

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


Delete Topic

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


Get Namespaces

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


Get Queue

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


Get Rule

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


Get Subscriptions

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


Get Topic

Gets all the topics in a namespace | key: getTopic


List Namespaces

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


List Namespaces By Resource Group

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


List Queues

Gets the queues within a namespace. | key: listQueues


List Rules

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


List Subscriptions By Topic

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


List Topics By Namespace

Gets all the topics in a namespace | key: listTopicsByNamespace


Raw Request

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