Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit focus mode

Azure Device Update for IoT Hub client library for .NET - version 1.0.0

  • 2022-10-11
Feedback

In this article

The library provides access to the Device Update for IoT Hub service that enables customers to publish updates for their IoT devices to the cloud, and then deploy these updates to their devices (approve updates to groups of devices managed and provisioned in IoT Hub).

Source code |Package |Product documentation

Getting started

The complete Microsoft Azure SDK can be downloaded from theMicrosoft Azure Downloads page and ships with support for building deployment packages, integrating with tooling, rich command line tooling, and more.

For the best development experience, developers should use the official Microsoft NuGet packages for libraries. NuGet packages are regularly updated with new functionality and hotfixes.

Prerequisites

  • Microsoft Azure Subscription: To call Microsoft Azure services, you need to create anAzure subscription
  • Device Update for IoT Hub instance
  • Azure IoT Hub instance

Install the package

Install the Device Update for IoT Hub client library for .NET withNuGet:

dotnet add package Azure.IoT.DeviceUpdate

Authenticate the Client

In order to interact with the Device Update for IoT Hub service, you will need to create an instance of aTokenCredential class and pass it to the constructor of your DeviceUpdateClient and DeviceManagementClient class.

Key concepts

Device Update for IoT Hub is a managed service that enables you to deploy over-the-air updates for your IoT devices. The client library has three main components:

  • DeviceManagementClient: device, group, deployment management (enumerate, create, retrieve, delete device, group, deployment, etc.)
  • DeviceUpdateClient: update management (import, enumerate, delete, etc.)

You can learn more about Device Update for IoT Hub by visitingDevice Update for IoT Hub.

Examples

You can familiarize yourself with different APIs usingSamples.

Troubleshooting

All Device Update for IoT Hub service operations will throw a RequestFailedException on failure with helpful ErrorCodes.

For example, if you use theGetUpdateAsync operation and the model you are looking for doesn't exist, you can catch that specificHttpStatusCode to decide the operation that follows in that case.

try{    Response update = await _updatesClient.GetUpdateAsync(      "provider", "name", "1.0.0.0");}catch (RequestFailedException ex) when (ex.Status == (int)HttpStatusCode.NotFound){    // Update does not exist.}

Next steps

Get started with ourDevice Update for IoT Hub samples

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visitContributor License Agreement.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted theMicrosoft Open Source Code of Conduct. For more information see theCode of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, seeour contributor guide.

Feedback

Was this page helpful?

YesNo

In this article

Was this page helpful?

YesNo