IotHubDeviceClient Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
IotHubDeviceClient(String, IotHubClientOptions) |
Creates a disposable |
IotHubDeviceClient(String, IAuthenticationMethod, IotHubClientOptions) |
Creates a disposable |
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.
- authenticationMethod
- IAuthenticationMethod
The authentication method that is used. It includes ClientAuthenticationWithSharedAccessKeyRefresh, ClientAuthenticationWithSharedAccessSignature or ClientAuthenticationWithX509Certificate.
- 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
Azure SDK for .NET