Share via


IotHubDeviceClient Constructors

Definition

Overloads

IotHubDeviceClient(String, IotHubClientOptions)

Creates a disposable IotHubDeviceClient from the specified connection string.

IotHubDeviceClient(String, IAuthenticationMethod, IotHubClientOptions)

Creates a disposable IotHubDeviceClient from the specified parameters.

IotHubDeviceClient(String, IotHubClientOptions)

Creates a disposable IotHubDeviceClient from the specified connection string.

public IotHubDeviceClient (string connectionString, Microsoft.Azure.Devices.Client.IotHubClientOptions options = default);
new Microsoft.Azure.Devices.Client.IotHubDeviceClient : string * Microsoft.Azure.Devices.Client.IotHubClientOptions -> Microsoft.Azure.Devices.Client.IotHubDeviceClient
Public Sub New (connectionString As String, Optional options As IotHubClientOptions = Nothing)

Parameters

connectionString
String

The connection string based on shared access key used in API calls which allows the device to communicate with IoT Hub.

options
IotHubClientOptions

The options that allow configuration of the device client instance during initialization.

Exceptions

Either connectionString is null, or the IoT hub host name or device Id in the connection string is null.

A module Id was specified in the connection string. IotHubModuleClient should be used for modules.

Applies to

IotHubDeviceClient(String, IAuthenticationMethod, IotHubClientOptions)

Creates a disposable IotHubDeviceClient from the specified parameters.

public IotHubDeviceClient (string hostName, Microsoft.Azure.Devices.Client.IAuthenticationMethod authenticationMethod, Microsoft.Azure.Devices.Client.IotHubClientOptions options = default);
new Microsoft.Azure.Devices.Client.IotHubDeviceClient : string * Microsoft.Azure.Devices.Client.IAuthenticationMethod * Microsoft.Azure.Devices.Client.IotHubClientOptions -> Microsoft.Azure.Devices.Client.IotHubDeviceClient
Public Sub New (hostName As String, authenticationMethod As IAuthenticationMethod, Optional options As IotHubClientOptions = Nothing)

Parameters

hostName
String

The fully-qualified DNS host name of IoT hub.

options
IotHubClientOptions

The options that allow configuration of the device client instance during initialization.

Exceptions

hostName, device Id or authenticationMethod is null.

A module Id was specified in the connection string. IotHubModuleClient should be used for modules.

CertificateChain could not be installed.

Applies to