Skip to content

Commit 6592d8a

Browse files
authored
Merge branch 'MicrosoftDocs:master' into master
2 parents ab1beb9 + f878bae commit 6592d8a

File tree

68 files changed

+2731
-928
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2731
-928
lines changed

articles/iot-hub-device-update/components-enumerator.md

Lines changed: 475 additions & 0 deletions
Large diffs are not rendered by default.

articles/iot-hub-device-update/create-device-update-account.md

Lines changed: 11 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To get started with Device Update you'll need to create a Device Update account,
2020
* [Microsoft Edge](https://www.microsoft.com/edge)
2121
* Google Chrome
2222

23-
## Create a device update account
23+
## Create a device update account and instance
2424

2525
1. Go to [Azure portal](https://portal.azure.com)
2626

@@ -30,74 +30,34 @@ To get started with Device Update you'll need to create a Device Update account,
3030

3131
3. Click **Create** -> **Device Update for IoT Hub**
3232

33-
4. Specify the Azure Subscription to be associated with your Device Update Account and Resource Group
34-
35-
5. Specify a Name and Location for your Device Update Account
33+
4. Specify the Azure Subscription to be associated with your Device Update Account and Resource Group. Specify a Name and Location for your Device Update Account
3634

3735
:::image type="content" source="media/create-device-update-account/account-details.png" alt-text="Screenshot of account details." lightbox="media/create-device-update-account/account-details.png":::
3836

3937
> [!NOTE]
4038
> You can go to [Azure Products-by-region page](https://azure.microsoft.com/global-infrastructure/services/?products=iot-hub) to discover the regions where Device Update for IoT Hub is available. If Device Update for IoT Hub is not available in your region you can choose to create an account in an available region closest to you.
4139
42-
6. Optionally, you can check the box to assign the Device Update administrator role to yourself. You can also use the steps listed in the "Configure access control roles" section to provide a combination of roles to users and applications for the right level of access.
43-
44-
8. Click **Next: Review + create>**
45-
46-
:::image type="content" source="media/create-device-update-account/account-review.png" alt-text="Screenshot of account details review." lightbox="media/create-device-update-account/account-review.png":::
47-
48-
7. Review the details and then select **Create**. You will see your deployment is in progress.
49-
50-
:::image type="content" source="media/create-device-update-account/account-deployment-inprogress.png" alt-text="Screenshot of account deployment in progress." lightbox="media/create-device-update-account/account-deployment-inprogress.png":::
51-
52-
8. You will see the deployment status change to "complete" in a few minutes. Click **Go to resource**
40+
5. Optionally, you can check the box to assign the Device Update administrator role to yourself. You can also use the steps listed in the "Configure access control roles" section to provide a combination of roles to users and applications for the right level of access.
5341

54-
:::image type="content" source="media/create-device-update-account/account-complete.png" alt-text="Screenshot of account deployment complete." lightbox="media/create-device-update-account/account-complete.png":::
55-
56-
## Create a device update instance
57-
58-
An instance of Device Update is associated with a single IoT hub. Select the IoT hub that will be used with Device Update. We will create a new Shared Access policy during this step to ensure Device Update uses only the required permissions to work with IoT Hub (registry write and service connect). This policy ensures that access is only limited to Device Update.
42+
6. Click **Next: Instance**
5943

60-
To create a Device Update instance after an account has been created.
44+
An instance of Device Update is associated with a single IoT hub. Select the IoT hub that will be used with Device Update. We will create a new Shared Access policy during this step to ensure Device Update uses only the required permissions to work with IoT Hub (registry write and service connect). This policy ensures that access is only limited to Device Update.
6145

62-
1. Once you are in your newly created account resource, go to the Instance Management **Instances** blade
63-
64-
:::image type="content" source="media/create-device-update-account/instance-blade.png" alt-text="Screenshot of instance management within account." lightbox="media/create-device-update-account/instance-blade.png":::
65-
66-
2. Click **Create** and specify an instance name and select your IoT Hub
46+
7. Specify an instance name and select your IoT Hub
6747

6848
:::image type="content" source="media/create-device-update-account/instance-details.png" alt-text="Screenshot of instance details." lightbox="media/create-device-update-account/instance-details.png":::
6949

7050
> [!NOTE]
7151
> The IoT Hub you link to your Device Update resource, doesn't need to be in the same region as your Device Update Account. However, for better performance it is recommended that your IoT Hub be in a region same as or close to the region of your Device Update account.
7252
73-
3. Click **Create**. You will see the instance in a "Creating" state.
74-
75-
:::image type="content" source="media/create-device-update-account/instance-creating.png" alt-text="Screenshot of instance creating." lightbox="media/create-device-update-account/instance-creating.png":::
53+
8. Click **Next: Review + Create**. After validation, click on **Create**.
7654

77-
4. Allow 5-10 mins for the instance deployment to complete. Refresh the status till you see the "Provisioning State" turn to "Succeeded".
78-
79-
:::image type="content" source="media/create-device-update-account/instance-succeeded.png" alt-text="Screenshot of instance creation succeeded." lightbox="media/create-device-update-account/instance-succeeded.png":::
80-
81-
## Configure IoT Hub
82-
83-
In order for Device Update to receive change notifications from IoT Hub, Device Update integrates with the "Built-In" Event Hub. Clicking the "Configure IoT Hub" button configures the required message routes and access policy required to communicate with IoT devices.
84-
85-
To configure IoT Hub
86-
87-
1. Once the Instance "Provisioning State" turns to "Succeeded", select the instance in the Instance Management blade. Click **Configure IoT Hub**
88-
89-
:::image type="content" source="media/create-device-update-account/instance-configure.png" alt-text="Screenshot of configuring IoT Hub for an instance." lightbox="media/create-device-update-account/instance-configure.png":::
90-
91-
2. Select **I agree to make these changes**
92-
93-
:::image type="content" source="media/create-device-update-account/instance-configure-selected.png" alt-text="Screenshot of agreeing to configure IoT Hub for an instance." lightbox="media/create-device-update-account/instance-configure-selected.png":::
94-
95-
3. Click **Update**
55+
:::image type="content" source="media/create-device-update-account/account-review.png" alt-text="Screenshot of account review." lightbox="media/create-device-update-account/account-review.png":::
56+
57+
9. You will see your deployment is in progress. The deployment status will change to "complete" in a few minutes. Click **Go to resource**
9658

97-
> [!NOTE]
98-
> If you are using a Free tier of Azure IoT Hub, the allowed number of message routes are limited to 5. Device Update for IoT Hub needs to configure 4 message routes to work as expected.
59+
:::image type="content" source="media/create-device-update-account/account-complete.png" alt-text="Screenshot of account deployment complete." lightbox="media/create-device-update-account/account-complete.png":::
9960

100-
[Learn about the message routes that are configured.](device-update-resources.md)
10161

10262

10363
## Configure access control roles

articles/iot-hub-device-update/create-update-group.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ ms.service: iot-hub-device-update
1111
# Create device groups in Device Update for IoT Hub
1212
Device Update for IoT Hub allows deploying an update to a group of IoT devices.
1313

14+
> [!NOTE]
15+
> If you would like to deploy to a default group instead of a user-created group, you can directly move to [How to Deploy an Update](deploy-update.md)
16+
17+
1418
## Prerequisites
1519

1620
* [Access to an IoT Hub with Device Update for IoT Hub enabled](create-device-update-account.md). It is recommended that you use a S1 (Standard) tier or above for your IoT Hub.
@@ -78,21 +82,21 @@ Tags can also be added or updated in Device twin or Module Twin directly.
7882

7983
2. Select the IoT Hub you previously connected to your Device Update instance.
8084

81-
3. Select the Device Updates option under Automatic Device Management from the left-hand navigation bar.
85+
3. Select the Updates option under Device Management from the left-hand navigation bar.
8286

83-
4. Select the Groups tab at the top of the page. You will be able to see the number of devices connected to Device Update that are not grouped yet.
87+
4. Select the Groups and Deployments tab at the top of the page.
8488
:::image type="content" source="media/create-update-group/ungrouped-devices.png" alt-text="Screenshot of ungrouped devices." lightbox="media/create-update-group/ungrouped-devices.png":::
8589

86-
5. Select the Add button to create a new group.
90+
5. Select the "Add group" button to create a new group.
8791
:::image type="content" source="media/create-update-group/add-group.png" alt-text="Screenshot of device group addition." lightbox="media/create-update-group/add-group.png":::
8892

89-
6. Select an IoT Hub tag from the list and then select Create update group.
93+
6. Select an IoT Hub tag and Device Class from the list and then select Create group.
9094
:::image type="content" source="media/create-update-group/select-tag.png" alt-text="Screenshot of tag selection." lightbox="media/create-update-group/select-tag.png":::
9195

92-
7. Once the group is created, you will see that the update compliance chart and groups list are updated. Update compliance chart shows the count of devices in various states of compliance: On latest update, New updates available, Updates in Progress and Devices not yet Grouped. [Learn about update compliance.](device-update-compliance.md)
96+
7. Once the group is created, you will see that the update compliance chart and groups list are updated. Update compliance chart shows the count of devices in various states of compliance: On latest update, New updates available, and Updates in Progress. [Learn about update compliance.](device-update-compliance.md)
9397
:::image type="content" source="media/create-update-group/updated-view.png" alt-text="Screenshot of update compliance view." lightbox="media/create-update-group/updated-view.png":::
9498

95-
8. You should see your newly created group and any available updates for the devices in the new group. You can deploy the update to the new group from this view by clicking on the update name. See Next Step: Deploy Update for more details.
99+
8. You should see your newly created group and any available updates for the devices in the new group. If there are devices that don't meet the device class requirements of the group, they will show up in a corresponding invalid group. You can deploy the best available update to the new user-defined group from this view by clicking on the "Deploy" button next to the group. See Next Step: Deploy Update for more details.
96100

97101
## View Device details for the group you created
98102

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
---
2+
title: How to prepare an update to be imported into Azure Device Update for IoT Hub | Microsoft Docs
3+
description: How-To guide for preparing to import a new update into Azure Device Update for IoT Hub.
4+
author: andrewbrownmsft
5+
ms.author: andbrown
6+
ms.date: 1/28/2022
7+
ms.topic: how-to
8+
ms.service: iot-hub-device-update
9+
---
10+
11+
# Prepare an update to import into Device Update for IoT Hub
12+
13+
Learn how to obtain a new update and prepare the update for importing into Device Update for IoT Hub.
14+
15+
## Prerequisites
16+
17+
* [Access to an IoT Hub with Device Update for IoT Hub enabled](create-device-update-account.md).
18+
* An IoT device (or simulator) [provisioned for Device Update](device-update-agent-provisioning.md) within IoT Hub.
19+
* [PowerShell 5](/powershell/scripting/install/installing-powershell) or later (includes Linux, macOS, and Windows installs)
20+
* Supported browsers:
21+
* [Microsoft Edge](https://www.microsoft.com/edge)
22+
* Google Chrome
23+
24+
## Obtain an update for your devices
25+
26+
Now that you've set up Device Update and provisioned your devices, you'll need the update file(s) that you'll be deploying to those devices.
27+
28+
* If you’ve purchased devices from an Original Equipment Manufacturer (OEM) or solution integrator, that organization will most likely provide update files for you, without you needing to create the updates. Contact the OEM or solution integrator to find out how they make updates available.
29+
30+
* If your organization already creates software for the devices you use, that same group will be the ones to create the updates for that software.
31+
32+
When creating an update to be deployed using Device Update for IoT Hub, start with either the [image-based or package-based approach](understand-device-update.md#support-for-a-wide-range-of-update-artifacts) depending on your scenario.
33+
34+
## Create a basic Device Update import manifest
35+
36+
Once you have your update files, create an import manifest to describe the update. If you haven't already done so, be sure to familiarize yourself with the basic [import concepts](import-concepts.md). While it is possible to author an import manifest JSON manually using a text editor, this guide will use PowerShell as example.
37+
38+
> [!TIP]
39+
> Try the [image-based](device-update-raspberry-pi.md), [package-based](device-update-ubuntu-agent.md), or [proxy update](device-update-howto-proxy-updates.md) tutorials if you haven't already done so. You can also just view sample import manifest files from those tutorials for reference.
40+
41+
1. [Clone](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) `Azure/iot-hub-device-update` [Git repository](https://github.com/Azure/iot-hub-device-update).
42+
43+
2. Navigate to `Tools/AduCmdlets` in your local clone from PowerShell.
44+
45+
3. Run the following commands after replacing the sample parameter values with your own. See [Import schema and API information](import-schema.md) for details on what values you can use. In particular, be aware that the same exact set of compatibility properties cannot be used with more than one Provider and Name combination.
46+
47+
```powershell
48+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
49+
50+
Import-Module ./AduUpdate.psm1
51+
52+
$updateId = New-AduUpdateId -Provider Contoso -Name Toaster -Version 1.0
53+
54+
$compat = New-AduUpdateCompatibility -Properties @{ deviceManufacturer = 'Contoso'; deviceModel = 'Toaster' }
55+
56+
$installStep = New-AduInstallationStep -Handler 'microsoft/swupdate:1'-HandlerProperties @{ installedCriteria = '1.0' } -Files 'path to your update file'
57+
58+
$update = New-AduImportManifest -UpdateId $updateId -Compatibility $compat -InstallationSteps $installStep
59+
60+
# Write the import manifest to a file, ideally next to the update file(s).
61+
$update | Out-File "./$($updateId.provider).$($updateId.name).$($updateId.version).importmanifest.json" -Encoding utf8
62+
```
63+
64+
Once you've created your import manifest, if you're ready to import your update, you can scroll to the Next steps link at the bottom of this page.
65+
66+
## Create an advanced Device Update import manifest for a proxy update
67+
68+
If your update is more complex, such as a [proxy update](device-update-proxy-updates.md), you may need to create multiple import manifests. You can use the same PowerShell script from the previous section to create parent and child import manifests for complex updates. Run the following commands after replacing the sample parameter values with your own. See [Import schema and API information](import-schema.md) for details on what values you can use.
69+
70+
```powershell
71+
Import-Module $PSScriptRoot/AduUpdate.psm1 -ErrorAction Stop
72+
73+
# We will use arbitrary files as update payload files.
74+
$childFile = "$env:TEMP/childFile.bin.txt"
75+
$parentFile = "$env:TEMP/parentFile.bin.txt"
76+
"This is a child update payload file." | Out-File $childFile -Force -Encoding utf8
77+
"This is a parent update payload file." | Out-File $parentFile -Force -Encoding utf8
78+
79+
# ------------------------------
80+
# Create a child update
81+
# ------------------------------
82+
Write-Host 'Preparing child update ...'
83+
84+
$microphoneUpdateId = New-AduUpdateId -Provider Contoso -Name Microphone -Version $UpdateVersion
85+
$microphoneCompat = New-AduUpdateCompatibility -DeviceManufacturer Contoso -DeviceModel Microphone
86+
$microphoneInstallStep = New-AduInstallationStep -Handler 'microsoft/swupdate:1' -Files $childFile
87+
$microphoneUpdate = New-AduImportManifest -UpdateId $microphoneUpdateId `
88+
-IsDeployable $false `
89+
-Compatibility $microphoneCompat `
90+
-InstallationSteps $microphoneInstallStep `
91+
-ErrorAction Stop -Verbose:$VerbosePreference
92+
93+
# ------------------------------
94+
# Create another child update
95+
# ------------------------------
96+
Write-Host 'Preparing another child update ...'
97+
98+
$speakerUpdateId = New-AduUpdateId -Provider Contoso -Name Speaker -Version $UpdateVersion
99+
$speakerCompat = New-AduUpdateCompatibility -DeviceManufacturer Contoso -DeviceModel Speaker
100+
$speakerInstallStep = New-AduInstallationStep -Handler 'microsoft/swupdate:1' -Files $childFile
101+
$speakerUpdate = New-AduImportManifest -UpdateId $speakerUpdateId `
102+
-IsDeployable $false `
103+
-Compatibility $speakerCompat `
104+
-InstallationSteps $speakerInstallStep `
105+
-ErrorAction Stop -Verbose:$VerbosePreference
106+
107+
# ------------------------------------------------------------
108+
# Create the parent update which parents the child update above
109+
# ------------------------------------------------------------
110+
Write-Host 'Preparing parent update ...'
111+
112+
$parentUpdateId = New-AduUpdateId -Provider Contoso -Name Toaster -Version $UpdateVersion
113+
$parentCompat = New-AduUpdateCompatibility -DeviceManufacturer Contoso -DeviceModel Toaster
114+
$parentSteps = @()
115+
$parentSteps += New-AduInstallationStep -Handler 'microsoft/script:1' -Files $parentFile -HandlerProperties @{ 'arguments'='--pre'} -Description 'Pre-install script'
116+
$parentSteps += New-AduInstallationStep -UpdateId $microphoneUpdateId -Description 'Microphone Firmware'
117+
$parentSteps += New-AduInstallationStep -UpdateId $speakerUpdateId -Description 'Speaker Firmware'
118+
$parentSteps += New-AduInstallationStep -Handler 'microsoft/script:1' -Files $parentFile -HandlerProperties @{ 'arguments'='--post'} -Description 'Post-install script'
119+
120+
$parentUpdate = New-AduImportManifest -UpdateId $parentUpdateId `
121+
-Compatibility $parentCompat `
122+
-InstallationSteps $parentSteps `
123+
-ErrorAction Stop -Verbose:$VerbosePreference
124+
125+
# ------------------------------------------------------------
126+
# Write all to files
127+
# ------------------------------------------------------------
128+
Write-Host 'Saving manifest and update files ...'
129+
130+
New-Item $Path -ItemType Directory -Force | Out-Null
131+
132+
$microphoneUpdate | Out-File "$Path/$($microphoneUpdateId.Provider).$($microphoneUpdateId.Name).$($microphoneUpdateId.Version).importmanifest.json" -Encoding utf8
133+
$speakerUpdate | Out-File "$Path/$($speakerUpdateId.Provider).$($speakerUpdateId.Name).$($speakerUpdateId.Version).importmanifest.json" -Encoding utf8
134+
$parentUpdate | Out-File "$Path/$($parentUpdateId.Provider).$($parentUpdateId.Name).$($parentUpdateId.Version).importmanifest.json" -Encoding utf8
135+
136+
Copy-Item $parentFile -Destination $Path -Force
137+
Copy-Item $childFile -Destination $Path -Force
138+
139+
Write-Host "Import manifest JSON files saved to $Path" -ForegroundColor Green
140+
141+
Remove-Item $childFile -Force -ErrorAction SilentlyContinue | Out-Null
142+
Remove-Item $parentFile -Force -ErrorAction SilentlyContinue | Out-Null
143+
```
144+
145+
## Next steps
146+
147+
* [Import an update](import-update.md)
148+
* [Learn about import concepts](import-concepts.md)

0 commit comments

Comments
 (0)