Condividi tramite


IotHubServiceClient Class

Definition

The client for making service requests to IoT hub. This client contains subclients for the various feature sets within IoT hub including managing device/module identities, getting/setting twin for device/modules, invoking direct methods on devices/modules, and more.

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

Remarks

This client is IDisposable but users are not responsible for disposing subclients within this client.

This client creates a lifetime long instance of HttpClient that is tied to the URI of the IoT hub specified and configured with any proxy settings provided. 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

IotHubServiceClient()

Creates an instance of this class. Provided for unit testing purposes only.

IotHubServiceClient(String, AzureSasCredential, IotHubServiceClientOptions)

Create an instance of this class that authenticates service requests with a shared access signature provided and refreshed as necessary by the caller.

IotHubServiceClient(String, IotHubServiceClientOptions)

Create an instance of this class that authenticates service requests using an IoT hub connection string.

IotHubServiceClient(String, TokenCredential, IotHubServiceClientOptions)

Create an instance of this class that authenticates service requests using an identity in Azure Active Directory (AAD).

Properties

Configurations

Subclient of IotHubServiceClient that handles configurations getting/adding/setting/deleting configurations.

Devices

The subclient for all device registry operations including getting/adding/setting/deleting device identities, getting modules on a device, and getting device registry statistics.

DigitalTwins

Subclient of IotHubServiceClient that handles all digital twin operations including getting a digital twin, updating a digital twin, and invoking commands on a digital twin.

DirectMethods

Subclient of IotHubServiceClient to directly invoke direct methods on devices and modules in IoT hub.

FileUploadNotifications

Subclient of IotHubServiceClient for receiving file upload notifications.

MessageFeedback

Subclient of IotHubServiceClient for receiving cloud-to-device message feedback.

Messages

Subclient of IotHubServiceClient for sending cloud-to-device and cloud-to-module messages.

Modules

Subclient of IotHubServiceClient that handles all module registry operations including getting/adding/setting/deleting module identities.

Query

Subclient of IotHubServiceClient for executing queries using a SQL-like syntax.

ScheduledJobs

Subclient of IotHubServiceClient for scheduled jobs management.

Twins

Subclient of IotHubServiceClient that handles getting, updating, and replacing device and module twins.

Methods

Dispose()

Dispose this client and all the disposable resources it has. This includes any HTTP clients created by or given to this client.

Applies to