PublishToAzureServiceBus@2 - Publish To Azure Service Bus v2 task
Raksts
Sends a message to Azure Service Bus using a service connection (no agent is required).
This version of the task supports Entra ID and Workload identity federation through its Azure Resource Manager service connection input (azureSubscription). For more information, see the following Remarks section.
Syntax
YAML
# Publish To Azure Service Bus v2# Sends a message to Azure Service Bus using an Azure Resource Manager service connection (no agent is required).- task:PublishToAzureServiceBus@2 inputs: azureSubscription:# string. Alias: connectedServiceName. Required. Azure Resource Manager service connection. serviceBusQueueName:# string. Required. Azure Service Bus Queue name. serviceBusNamespace:# string. Required. Azure Service Bus Namespace. #messageBody: # string. Message body. #waitForCompletion: false # boolean. Wait for task completion. Default: false.#useDataContractSerializer: true # boolean. Use .NET data contract serializer. Default: true.# Advanced#sessionId: # string. Session Id. #signPayload: false # boolean. Sign the Message. Default: false.#certificateString: # string. Required when signPayload = true. Certificate Variable. #signatureKey: 'signature' # string. Optional. Use when signPayload = true. Signature Property Key. Default: signature.
serviceBusQueueName - Azure Service Bus Queue name string. Required.
Specify the name of the queue for which the message is intended.
serviceBusNamespace - Azure Service Bus Namespace string. Required.
Specify the namespace of your Azure Service Bus.
messageBody - Message body string.
Specifies the JSON messageBody.
sessionId - Session Id string.
Specifies the session ID with which the message is published. For session-based queues, the publishing fails if a value is not specified. For non session-based queues, a value does not need to be specified.
signPayload - Sign the Message boolean. Default value: false.
If set to true, a private certificate will be added to the message.
certificateString - Certificate Variable string. Required when signPayload = true.
Specifies the secret variable that contains the certificate content. This can also be a certificate stored in an Azure key vault that is linked to a variable group used by the release pipeline.
signatureKey - Signature Property Key string. Optional. Use when signPayload = true. Default value: signature.
In Message Properties, specifies the key where the signature is. If left empty, the default value is signature.
waitForCompletion - Wait for task completion boolean. Default value: false.
If set to true, this task will wait for the TaskCompleted event for the specified task timeout.
useDataContractSerializer - Use .NET data contract serializer boolean. Default value: true.
Set useDataContractSerializer to false if you want to pass your message as a stream instead of an object.
Use this task in an agentless job of a release pipeline to send a message to an Azure Service Bus using a service connection (without using an agent).
Piezīme
Can only be used in an agentless job of a release pipeline.
Access Azure Service Bus from Pipelines using Entra ID authentication
You can now use Entra ID authentication to access Azure Service Bus from Azure Pipelines. This allows you to take advantage of Workload identity federation to remove secrets management and Azure RBAC for fine grained access control.
The PublishToAzureServiceBus@2 task can be configured using an Azure Resource Manager service connection. Create an Azure Resource Manager service connection and populate the serviceBusQueueName and serviceBusNamespace properties of the task:
In addition, a C# helper library is available to enable live logging and managing the task status for agentless tasks. Learn more about Async HTTP agentless tasks.
Pievienojieties meetup sērijai, lai kopā ar citiem izstrādātājiem un ekspertiem izveidotu mērogojamus AI risinājumus, kuru pamatā ir reālas lietošanas gadījumi.