Share via


DigitalTwinClient.Create Method

Definition

Overloads

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

Create(String, AzureSasCredential, DelegatingHandler[])

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

public static Microsoft.Azure.Devices.DigitalTwinClient Create (string hostName, Azure.AzureSasCredential credential, params System.Net.Http.DelegatingHandler[] handlers);
static member Create : string * Azure.AzureSasCredential * System.Net.Http.DelegatingHandler[] -> Microsoft.Azure.Devices.DigitalTwinClient
Public Shared Function Create (hostName As String, credential As AzureSasCredential, ParamArray handlers As DelegatingHandler()) As DigitalTwinClient

Parameters

hostName
String

IoT hub host name.

credential
AzureSasCredential

Credential that generates a SAS token to authenticate with IoT hub. See AzureSasCredential.

handlers
DelegatingHandler[]

The delegating handlers to add to the http client pipeline. You can add handlers for tracing, implementing a retry strategy, routing requests through a proxy, etc.

Returns

A DigitalTwinsClient instance.

Remarks

Users may wish to build their own shared access signature (SAS) tokens rather than give the shared key to the SDK and let it manage signing and renewal. The AzureSasCredential object gives the SDK access to the SAS token, while the caller can update it as necessary using the Update(String) method.

Applies to

Create(String, TokenCredential, DelegatingHandler[])

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

public static Microsoft.Azure.Devices.DigitalTwinClient Create (string hostName, Azure.Core.TokenCredential credential, params System.Net.Http.DelegatingHandler[] handlers);
static member Create : string * Azure.Core.TokenCredential * System.Net.Http.DelegatingHandler[] -> Microsoft.Azure.Devices.DigitalTwinClient
Public Shared Function Create (hostName As String, credential As TokenCredential, ParamArray handlers As DelegatingHandler()) As DigitalTwinClient

Parameters

hostName
String

IoT hub host name.

credential
TokenCredential

Azure Active Directory (AAD) credentials to authenticate with IoT hub. See TokenCredential

handlers
DelegatingHandler[]

The delegating handlers to add to the http client pipeline. You can add handlers for tracing, implementing a retry strategy, routing requests through a proxy, etc.

Returns

A DigitalTwinsClient instance.

Remarks

For more about information on the options of authenticating using a derived instance of TokenCredential, see https://docs.microsoft.com/dotnet/api/overview/azure/identity-readme. For more information on configuring IoT hub with Azure Active Directory, see https://docs.microsoft.com/azure/iot-hub/iot-hub-dev-guide-azure-ad-rbac

Applies to