Sdílet prostřednictvím


DigitalTwinClient Class

Definition

This client contains methods to retrieve and update digital twin information, and invoke commands on a digital twin device.

public class DigitalTwinClient : IDisposable
type DigitalTwinClient = class
    interface IDisposable
Public Class DigitalTwinClient
Implements IDisposable
Inheritance
DigitalTwinClient
Implements

Remarks

For more information, see https://github.com/Azure/azure-iot-sdk-csharp#iot-hub-service-sdk.

This client creates lifetime long instances of HttpClient that are tied to the URI of the IoT hub specified, configure any proxy settings, and connection lease timeout. For that reason, the instances are not static and an application using this client should create and save it for all use. Repeated creation may cause socket exhaustion.

Constructors

DigitalTwinClient()

Creates an instance of DigitalTwinClient, provided for unit testing purposes only.

Methods

Create(String, AzureSasCredential, DelegatingHandler[])

Creates DigitalTwinClient using a shared access signature provided and refreshed as necessary by the caller.

Create(String, TokenCredential, DelegatingHandler[])

Creates DigitalTwinClient, authenticating using an identity in Azure Active Directory (AAD).

CreateFromConnectionString(String, DelegatingHandler[])

Creates DigitalTwinClient from an IoT hub connection string.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Dispose(Boolean)

Releases unmanaged and - optionally - managed resources.

GetDigitalTwinAsync<T>(String, CancellationToken)

Gets a strongly-typed digital twin.

InvokeCommandAsync(String, String, String, DigitalTwinInvokeCommandRequestOptions, CancellationToken)

Invoke a command on a digital twin.

InvokeComponentCommandAsync(String, String, String, String, DigitalTwinInvokeCommandRequestOptions, CancellationToken)

Invoke a command on a component of a digital twin.

UpdateDigitalTwinAsync(String, String, DigitalTwinUpdateRequestOptions, CancellationToken)

Updates a digital twin.

Applies to