Rediger

Del via


PublishToAzureServiceBus@1 - Publish To Azure Service Bus v1 task

Use this task to send a message to Azure Service Bus using a service connection (no agent is required).

Use this task to send a message to Azure Service Bus using a service connection (no agent required).

Syntax

# Publish To Azure Service Bus v1
# Sends a message to Azure Service Bus using a service connection (no agent is required).
- task: PublishToAzureServiceBus@1
  inputs:
    azureSubscription: # string. Alias: connectedServiceName. Required. Azure Service Bus service connection. 
    #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.
# Publish To Azure Service Bus v1
# Sends a message to Azure Service Bus using a service connection (no agent is required).
- task: PublishToAzureServiceBus@1
  inputs:
    azureSubscription: # string. Alias: connectedServiceName. Required. Azure Service Bus service connection. 
    #messageBody: # string. Message body. 
    #waitForCompletion: false # boolean. Wait for task completion. Default: false.
  # 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.
# Publish To Azure Service Bus v1
# Sends a message to azure service bus using a service connection (no agent required).
- task: PublishToAzureServiceBus@1
  inputs:
    azureSubscription: # string. Alias: connectedServiceName. Required. Azure Service Bus service connection. 
    #messageBody: # string. Message body. 
    #waitForCompletion: false # boolean. Wait for task completion. Default: false.
  # Signing Properties
    #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.

Inputs

azureSubscription - Azure Service Bus service connection
Input alias: connectedServiceName. string. Required.

Specifies an Azure Service Bus service connection.


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.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Remarks

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).

Note

Can only be used in an agentless job of a release pipeline.

Where should a task signal completion?

To signal completion, the external service should POST completion data to the following pipelines REST endpoint.

{planUri}/{projectId}/_apis/distributedtask/hubs/{hubName}/plans/{planId}/events?api-version=2.0-preview.1

**Request Body**
 { "name": "TaskCompleted", "taskId": "taskInstanceId", "jobId": "jobId", "result": "succeeded" }

See this simple cmdline application for specifics.

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.

Requirements

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Server
Demands None
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version All supported agent versions.
Task category Utility