Share via


HttpPipeline.CreateClientRequestIdScope(String) メソッド

定義

すべての送信要求で指定された を使用するスコープを作成します。

public static IDisposable CreateClientRequestIdScope (string? clientRequestId);
static member CreateClientRequestIdScope : string -> IDisposable
Public Shared Function CreateClientRequestIdScope (clientRequestId As String) As IDisposable

パラメーター

clientRequestId
String

要求と共に送信されるクライアント要求 ID 値。

戻り値

IDisposableクライアント要求 ID を送信しなくなったときに破棄する必要があるインスタンス。

使用例:

var secretClient = new SecretClient(new Uri("http://example.com"), new DefaultAzureCredential());

using (HttpPipeline.CreateClientRequestIdScope("<custom-client-request-id>"))
{
    // The HTTP request resulting from the client call would have x-ms-client-request-id value set to <custom-client-request-id>
    secretClient.GetSecret("<secret-name>");
}

適用対象