The Azure Service Bus actions let you send and receive messages from Azure Service Bus queues directly from your workflows. All actions authenticate using an Azure AD service principal (Entra app registration) and communicate with the Service Bus data plane.
The below actions follow two usage patterns:
- Send: Use
sendMessageto publish a message to a queue. - Peek-lock lifecycle: Use
peekLockMessageto read and lock a message without removing it, then eithercompleteMessage(processing succeeded — delete it) orunlockMessage(processing abandoned — return it to the queue). UserenewLockto extend the lock during long-running steps. For a simpler, destructive alternative, usereceiveAndDeleteMessageto receive and immediately delete a message in one step.
Prerequisites
- An Azure Service Bus namespace and at least one queue.
- An Entra (Azure AD) app registration (service principal). See register an Azure app.
- Assign the appropriate built-in role on the namespace or queue:
- Azure Service Bus Data Sender — required for
sendMessage. - Azure Service Bus Data Receiver (or Data Owner) — required for
receiveAndDeleteMessage,peekLockMessage,renewLock,completeMessage, andunlockMessage.
- Azure Service Bus Data Sender — required for
- Store
clientId,clientSecret, andtenantIdas secrets in the New Relic Secrets Service and reference them using${{ :secrets:<keyName> }}.
Send a message
Action identifier: azure.serviceBus.sendMessage
Sends a message to an Azure Service Bus queue.
Input | Type | Description |
|---|---|---|
| String | Required. Entra service-principal client ID. Must be passed as a secret. |
| String | Required. Entra service-principal client secret. Must be passed as a secret. |
| String | Required. Entra tenant ID. Must be passed as a secret. |
| String | Required. Service Bus namespace name, without the |
| String | Required. Name of the queue to send the message to. For example, |
| String | Required. Message body to send (max 256 KB). For example, |
| String | Required. Content type of the message body, sent as the |
| Map | Optional. Broker metadata for the message. Accepted keys: |
| List | Optional. JQ selectors to extract specific fields from the action output. For example, |
Output | Type | Description |
|---|---|---|
| Boolean |
|
| Object | Present when |
| String | Error message if the send failed. |
name: sendOrderCreatedMessagedescription: Send a message to a Service Bus queuesteps: - name: sendMessage type: action action: azure.serviceBus.sendMessage version: '1' inputs: clientId: ${{ :secrets:azure-client-id }} clientSecret: ${{ :secrets:azure-client-secret }} tenantId: ${{ :secrets:azure-client-tenant }} namespace: my-namespace queueName: my-queue body: '{"orderId": "12345", "status": "created"}' contentType: application/json brokerProperties: Label: order-created TimeToLive: 300 selectors: - name: statusCode expression: ".response.statusCode" next: endReceive and delete a message
Action identifier: azure.serviceBus.receiveAndDeleteMessage
Receives a message from an Azure Service Bus queue and permanently removes it in a single, destructive operation.
Importante
Permanently deletes the message on receipt. If the workflow fails after this step, the message cannot be recovered. Use azure.serviceBus.peekLockMessage instead when the processing step might fail and you need the ability to retry.
Input | Type | Description |
|---|---|---|
| String | Required. Entra service-principal client ID. Must be passed as a secret. |
| String | Required. Entra service-principal client secret. Must be passed as a secret. |
| String | Required. Entra tenant ID. Must be passed as a secret. |
| String | Required. Service Bus namespace name, without the |
| String | Required. Name of the queue to receive from. |
| Integer | Optional. How long to wait for a message before returning empty (1–55 seconds). The 55-second ceiling is a New Relic platform limit, not an Azure constraint. Default: 5. |
| List | Optional. JQ selectors to extract specific fields from the action output. For example, |
Output | Type | Description |
|---|---|---|
| Boolean |
|
| Boolean | Top-level output (not inside |
| Object | Present when |
| String | Error message if the receive failed. |
name: drainQueueMessagedescription: Receive and permanently delete the next message from a queuesteps: - name: receiveAndDeleteMessage type: action action: azure.serviceBus.receiveAndDeleteMessage version: '1' inputs: clientId: ${{ :secrets:azure-client-id }} clientSecret: ${{ :secrets:azure-client-secret }} tenantId: ${{ :secrets:azure-client-tenant }} namespace: my-namespace queueName: my-queue timeoutSeconds: 30 selectors: - name: messageFound expression: ".messageFound" - name: body expression: ".response.body" next: endPeek-lock a message
Action identifier: azure.serviceBus.peekLockMessage
Reads a message from an Azure Service Bus queue without removing it, and temporarily locks it so other consumers cannot see it while it is being processed. Returns a location value that you must pass to completeMessage, unlockMessage, or renewLock in subsequent steps.
Importante
location is a top-level output — reference it as .steps.<stepName>.outputs.location, not .steps.<stepName>.outputs.response.location. Reuse this same value in every subsequent renewLock, completeMessage, or unlockMessage step — renewLock does not echo location back as an output.
Input | Type | Description |
|---|---|---|
| String | Required. Entra service-principal client ID. Must be passed as a secret. |
| String | Required. Entra service-principal client secret. Must be passed as a secret. |
| String | Required. Entra tenant ID. Must be passed as a secret. |
| String | Required. Service Bus namespace name, without the |
| String | Required. Name of the queue to peek-lock from. |
| Integer | Optional. How long to wait for a message before returning empty (1–55 seconds). The 55-second ceiling is a New Relic platform limit, not an Azure constraint. Default: 5. |
| List | Optional. JQ selectors to extract specific fields from the action output. For example, |
Output | Type | Description |
|---|---|---|
| Boolean |
|
| Boolean | Top-level output (not inside |
| String | Top-level output (not inside |
| Object | Present when |
| String | Error message if the peek-lock failed. |
name: peekLockAndCompletedescription: Peek-lock a message then mark it as processedsteps: - name: peekLockMessage type: action action: azure.serviceBus.peekLockMessage version: '1' inputs: clientId: ${{ :secrets:azure-client-id }} clientSecret: ${{ :secrets:azure-client-secret }} tenantId: ${{ :secrets:azure-client-tenant }} namespace: my-namespace queueName: my-queue timeoutSeconds: 30 selectors: - name: messageFound expression: ".messageFound" - name: location expression: ".location" - name: body expression: ".response.body" - name: completeMessage type: action action: azure.serviceBus.completeMessage version: '1' inputs: clientId: ${{ :secrets:azure-client-id }} clientSecret: ${{ :secrets:azure-client-secret }} tenantId: ${{ :secrets:azure-client-tenant }} namespace: my-namespace location: ${{ .steps.peekLockMessage.outputs.location }} next: endRenew a message lock
Action identifier: azure.serviceBus.renewLock
Extends the lock duration on a peek-locked Azure Service Bus message, preventing the lock from expiring while a long-running workflow step is still processing it.
Importante
Does not return a location output. Azure's renew-lock response has no Location header. Continue referencing the original peekLockMessage.outputs.location value in every subsequent renewLock, completeMessage, and unlockMessage step — do not read location from a prior renewLock output. Returns HTTP 404 if called after the lock has already expired.
Input | Type | Description |
|---|---|---|
| String | Required. Entra service-principal client ID. Must be passed as a secret. |
| String | Required. Entra service-principal client secret. Must be passed as a secret. |
| String | Required. Entra tenant ID. Must be passed as a secret. |
| String | Required. Service Bus namespace name, without the |
| String | Required. The |
| List | Optional. JQ selectors to extract specific fields from the action output. |
Output | Type | Description |
|---|---|---|
| Boolean |
|
| Object | Present only when |
| String | Error message if the renew failed, for example because the lock already expired (HTTP 404). |
name: renewLockDuringProcessingdescription: Peek-lock a message, wait, renew the lock, then complete itsteps: - name: peekLockMessage type: action action: azure.serviceBus.peekLockMessage version: '1' inputs: clientId: ${{ :secrets:azure-client-id }} clientSecret: ${{ :secrets:azure-client-secret }} tenantId: ${{ :secrets:azure-client-tenant }} namespace: my-namespace queueName: my-queue timeoutSeconds: 30 selectors: - name: location expression: ".location" - name: processMessage type: wait seconds: 15 - name: renewLock type: action action: azure.serviceBus.renewLock version: '1' inputs: clientId: ${{ :secrets:azure-client-id }} clientSecret: ${{ :secrets:azure-client-secret }} tenantId: ${{ :secrets:azure-client-tenant }} namespace: my-namespace location: ${{ .steps.peekLockMessage.outputs.location }} - name: completeMessage type: action action: azure.serviceBus.completeMessage version: '1' inputs: clientId: ${{ :secrets:azure-client-id }} clientSecret: ${{ :secrets:azure-client-secret }} tenantId: ${{ :secrets:azure-client-tenant }} namespace: my-namespace location: ${{ .steps.peekLockMessage.outputs.location }} next: endComplete a message
Action identifier: azure.serviceBus.completeMessage
Marks a peek-locked Azure Service Bus message as successfully processed, permanently deleting it from the queue. This is the terminal "success" step of the peek-lock pattern.
Input | Type | Description |
|---|---|---|
| String | Required. Entra service-principal client ID. Must be passed as a secret. |
| String | Required. Entra service-principal client secret. Must be passed as a secret. |
| String | Required. Entra tenant ID. Must be passed as a secret. |
| String | Required. Service Bus namespace name, without the |
| String | Required. The |
| List | Optional. JQ selectors to extract specific fields from the action output. |
Output | Type | Description |
|---|---|---|
| Boolean |
|
| Object | Present only when |
| String | Error message if the complete operation failed, for example because the lock expired (HTTP 404). |
name: peekLockAndCompletedescription: Peek-lock a message and mark it as successfully processedsteps: - name: peekLockMessage type: action action: azure.serviceBus.peekLockMessage version: '1' inputs: clientId: ${{ :secrets:azure-client-id }} clientSecret: ${{ :secrets:azure-client-secret }} tenantId: ${{ :secrets:azure-client-tenant }} namespace: my-namespace queueName: my-queue timeoutSeconds: 30 selectors: - name: location expression: ".location" - name: completeMessage type: action action: azure.serviceBus.completeMessage version: '1' inputs: clientId: ${{ :secrets:azure-client-id }} clientSecret: ${{ :secrets:azure-client-secret }} tenantId: ${{ :secrets:azure-client-tenant }} namespace: my-namespace location: ${{ .steps.peekLockMessage.outputs.location }} next: endUnlock a message
Action identifier: azure.serviceBus.unlockMessage
Releases the lock on a peek-locked Azure Service Bus message, making it immediately available again for other consumers. This is the terminal "abandon" step of the peek-lock pattern — use it when the workflow determines it cannot or should not finish processing the message.
Input | Type | Description |
|---|---|---|
| String | Required. Entra service-principal client ID. Must be passed as a secret. |
| String | Required. Entra service-principal client secret. Must be passed as a secret. |
| String | Required. Entra tenant ID. Must be passed as a secret. |
| String | Required. Service Bus namespace name, without the |
| String | Required. The |
| List | Optional. JQ selectors to extract specific fields from the action output. |
Output | Type | Description |
|---|---|---|
| Boolean |
|
| Object | Present only when |
| String | Error message if the unlock failed, for example because the lock expired (HTTP 404). |
name: peekLockAndAbandondescription: Peek-lock a message then release it back to the queue unprocessedsteps: - name: peekLockMessage type: action action: azure.serviceBus.peekLockMessage version: '1' inputs: clientId: ${{ :secrets:azure-client-id }} clientSecret: ${{ :secrets:azure-client-secret }} tenantId: ${{ :secrets:azure-client-tenant }} namespace: my-namespace queueName: my-queue timeoutSeconds: 30 selectors: - name: location expression: ".location" - name: unlockMessage type: action action: azure.serviceBus.unlockMessage version: '1' inputs: clientId: ${{ :secrets:azure-client-id }} clientSecret: ${{ :secrets:azure-client-secret }} tenantId: ${{ :secrets:azure-client-tenant }} namespace: my-namespace location: ${{ .steps.peekLockMessage.outputs.location }} next: end