PublishToAzureServiceBus@1 - 发布到 Azure 服务总线 v1 任务

使用此任务可以使用服务连接(无需代理)将消息发送到 Azure 服务总线。

语法

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

输入

azureSubscription - Azure 服务总线服务连接
输入别名:connectedServiceNamestring。 必填。

指定 Azure 服务总线服务连接


messageBody - 消息正文
string

指定 JSON messageBody


sessionId - 会话 ID
string

指定发布消息的会话 ID。 对于基于会话的队列,如果未指定值,发布将失败。 对于基于会话的非队列,不需要指定值。


signPayload - 对消息 签名
boolean。 默认值:false

如果设置为 true,则会将专用证书添加到消息中。


certificateString - 证书变量
stringsignPayload = true时是必需的。

指定包含证书内容的机密变量。 这也可以是存储在 Azure 密钥保管库中的证书,该保管库 链接到发布管道使用的变量组


signatureKey - 签名属性密钥
string。 可选。 当 signPayload = true时使用。 默认值:signature

在消息属性中,指定签名所在的密钥。 如果留空,则默认值为 signature


waitForCompletion - 等待任务完成
boolean。 默认值:false

如果设置为 true,则此任务将等待 TaskCompleted 事件,等待指定的任务超时。


useDataContractSerializer - 使用 .NET 数据协定序列化程序。
boolean。 默认值:true

如果要将消息作为流而不是对象传递,请将 useDataContractSerializer 设置为 false


任务控制选项

除任务输入之外,所有任务都具有控制选项。 有关详细信息,请参阅 控件选项和常见任务属性

输出变量

没有。

注解

在发布管道 无代理作业中使用此任务,使用服务连接(不使用代理)将消息发送到 Azure 服务总线。

注释

只能在发布管道 无代理作业中使用。

任务应在哪里发出完成信号?

若要发出完成信号,外部服务应将完成数据 POST 到以下管道 REST 终结点。

{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" }

有关详细信息,请参阅此简单的 cmdline 应用程序

此外,C# 帮助程序库可用于启用实时日志记录和管理无代理任务的任务状态。 详细了解 异步 HTTP 无代理任务

要求

要求 说明
管道类型 YAML,经典版本,经典版本
运行时间 服务器
需求 没有
功能 此任务不满足作业中后续任务的任何要求。
命令限制 任何
Settable 变量 任何
代理版本 所有支持的代理版本。
任务类别 效用