Condividi tramite


IotHubModuleClient Constructors

Definition

Overloads

IotHubModuleClient(String, IotHubClientOptions)

Creates a disposable IotHubModuleClient from the specified connection string.

IotHubModuleClient(String, IAuthenticationMethod, IotHubClientOptions)

Creates a disposable IotHubModuleClient from the specified parameters.

IotHubModuleClient(String, IotHubClientOptions)

Creates a disposable IotHubModuleClient from the specified connection string.

public IotHubModuleClient (string connectionString, Microsoft.Azure.Devices.Client.IotHubClientOptions options = default);
new Microsoft.Azure.Devices.Client.IotHubModuleClient : string * Microsoft.Azure.Devices.Client.IotHubClientOptions -> Microsoft.Azure.Devices.Client.IotHubModuleClient
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 module to communicate with IoT Hub.

options
IotHubClientOptions

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

Exceptions

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

Neither shared access key nor shared access signature were presented for authentication.

Applies to

IotHubModuleClient(String, IAuthenticationMethod, IotHubClientOptions)

Creates a disposable IotHubModuleClient from the specified parameters.

public IotHubModuleClient (string hostName, Microsoft.Azure.Devices.Client.IAuthenticationMethod authenticationMethod, Microsoft.Azure.Devices.Client.IotHubClientOptions options = default);
new Microsoft.Azure.Devices.Client.IotHubModuleClient : string * Microsoft.Azure.Devices.Client.IAuthenticationMethod * Microsoft.Azure.Devices.Client.IotHubClientOptions -> Microsoft.Azure.Devices.Client.IotHubModuleClient
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.

authenticationMethod
IAuthenticationMethod

The authentication method that is used. It includes ClientAuthenticationWithSharedAccessKeyRefresh, ClientAuthenticationWithSharedAccessSignature, ClientAuthenticationWithX509Certificate or Microsoft.Azure.Devices.Client.HsmAuthentication.EdgeModuleAuthenticationWithHsm.

options
IotHubClientOptions

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

Exceptions

hostName, device Id, module Id or authenticationMethod is null.

Either shared access key or shared access signature where presented together with X509 certificates for authentication.

Applies to