通过


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Scripts.ReadTriggerStreamAsync Method

Definition

Reads a TriggerProperties from the Azure Cosmos service as an asynchronous operation.

public abstract System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ResponseMessage> ReadTriggerStreamAsync(string id, Microsoft.Azure.Cosmos.RequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member ReadTriggerStreamAsync : string * Microsoft.Azure.Cosmos.RequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ResponseMessage>
Public MustOverride Function ReadTriggerStreamAsync (id As String, Optional requestOptions As RequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ResponseMessage)

Parameters

id
String
requestOptions
RequestOptions
cancellationToken
CancellationToken

Returns

A Task containing a ResponseMessage containing the read resource record.

Examples

This reads an existing trigger

Scripts scripts = this.container.Scripts;
ResponseMessage response = await scripts.ReadTriggerStreamAsync("ExistingId");
if (!response.IsSuccessStatusCode)
{
    //Handle and log exception
    return;
}

Applies to