Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions sdk/deviceupdate/Azure.Iot.DeviceUpdate/Azure.Iot.DeviceUpdate.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30621.155
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Iot.DeviceUpdate", "src\Azure.Iot.DeviceUpdate.csproj", "{F1AB3BFB-DBBF-4002-A93F-DFB02545C666}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Iot.DeviceUpdate.Tests", "tests\Azure.Iot.DeviceUpdate.Tests.csproj", "{C039F382-F091-433C-9DAA-CC2FF7CF4644}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{24219D07-7E76-4631-9D89-49DCB79F7A84}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeviceUpdateClientSample", "samples\DeviceUpdateClientSample\DeviceUpdateClientSample.csproj", "{4719AE90-2B90-4DBC-92DA-8CCE29D5B7F3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F1AB3BFB-DBBF-4002-A93F-DFB02545C666}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F1AB3BFB-DBBF-4002-A93F-DFB02545C666}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F1AB3BFB-DBBF-4002-A93F-DFB02545C666}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F1AB3BFB-DBBF-4002-A93F-DFB02545C666}.Release|Any CPU.Build.0 = Release|Any CPU
{C039F382-F091-433C-9DAA-CC2FF7CF4644}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C039F382-F091-433C-9DAA-CC2FF7CF4644}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C039F382-F091-433C-9DAA-CC2FF7CF4644}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C039F382-F091-433C-9DAA-CC2FF7CF4644}.Release|Any CPU.Build.0 = Release|Any CPU
{24219D07-7E76-4631-9D89-49DCB79F7A84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24219D07-7E76-4631-9D89-49DCB79F7A84}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24219D07-7E76-4631-9D89-49DCB79F7A84}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24219D07-7E76-4631-9D89-49DCB79F7A84}.Release|Any CPU.Build.0 = Release|Any CPU
{4719AE90-2B90-4DBC-92DA-8CCE29D5B7F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4719AE90-2B90-4DBC-92DA-8CCE29D5B7F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4719AE90-2B90-4DBC-92DA-8CCE29D5B7F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4719AE90-2B90-4DBC-92DA-8CCE29D5B7F3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3D97F8B9-00F4-4457-BD23-58F8D58B9C64}
EndGlobalSection
EndGlobal
4 changes: 4 additions & 0 deletions sdk/deviceupdate/Azure.Iot.DeviceUpdate/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Release History

## 1.0.0-preview.1 (2020-09-01)
- Initial changelog
6 changes: 6 additions & 0 deletions sdk/deviceupdate/Azure.Iot.DeviceUpdate/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Add any shared properties you want for the projects under this package directory that need to be set before the auto imported Directory.Build.props
-->
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
</Project>
75 changes: 75 additions & 0 deletions sdk/deviceupdate/Azure.Iot.DeviceUpdate/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Device Update for IoT Hub client library for .NET

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](https://github.com/Azure/azure-sdk-for-sdk/tree/master/sdk/deviceupdate/Azure.Iot.DeviceUpdate/src/) | [Package](https://www.nuget.org/packages/Azure.DeviceUpdate) | [Product documentation](https://github.com/Azure/adu-private-preview/blob/master/docs/adu-overview.md)


## Getting started

The complete Microsoft Azure SDK can be downloaded from the [Microsoft Azure Downloads](https://azure.microsoft.com/downloads/?sdk=net) 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 an [Azure subscription](https://azure.microsoft.com/free/)
- Device Update for IoT Hub instance
- Azure IoT Hub instance

### Install the package

Install the Device Update for IoT Hub client library for .NET with [NuGet](https://www.nuget.org/ ):

```PowerShell
dotnet install Azure.Iot.DeviceUpdate --version 1.0.0-beta.1
```

### Authenticate the Client

In order to interact with the Device Update for IoT Hub service, you will need to create an instance of a [TokenCredential class](https://docs.microsoft.com/dotnet/api/azure.core.tokencredential?view=azure-dotnet) and pass it to the constructor of your UpdateClient, DeviceClient and DeploymentClient 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:
- **UpdatesClient**: update management (import, enumerate, delete, etc.)
- **DevicesClient**: device management (enumerate devices and retrieve device properties)
- **DeploymentsClient**: deployment management (start and monitor update deployments to a set of devices)

You can learn more about Device Update for IoT Hub by visiting [Device Update for IoT Hub](https://github.com/Azure/adu-private-preview/tree/release/v0.2.0-private-preview).

## Examples

You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-sdk/tree/master/sdk/deviceupdate/Azure.Iot.DeviceUpdate/samples).

## Troubleshooting

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

For example, if you use the `GetUpdateAsync` operation and the model you are looking for doesn't exist, you can catch that specific [HttpStatusCode](https://docs.microsoft.com/dotnet/api/system.net.httpstatuscode?view=netcore-3.1) to decide the operation that follows in that case.

```csharp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

```

## Next steps

Get started with our [Device Update for IoT Hub samples](https://github.com/Azure/azure-sdk-for-sdk/tree/master/sdk/deviceupdate/Azure.Iot.DeviceUpdate/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, visit <https://cla.microsoft.com.>

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 the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
Loading