Skip to content

Commit 72dc63d

Browse files
committed
implement review comments
1 parent 382c079 commit 72dc63d

File tree

4 files changed

+76
-52
lines changed

4 files changed

+76
-52
lines changed

articles/iot-hub-device-update/import-concepts.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
---
2-
title: Azure Device Update for IoT Hub import manifest concepts
3-
description: Understand the important concepts and sections in the Azure Device Update for IoT Hub import manifest.
2+
title: Azure Device Update for IoT Hub import concepts
3+
description: Understand key concepts for importing a new update into Azure Device Update for IoT Hub.
44
author: andrewbrownmsft
55
ms.author: andbrown
6-
ms.date: 01/03/2025
6+
ms.date: 01/08/2025
77
ms.topic: concept-article
88
ms.service: azure-iot-hub
99
ms.subservice: device-update
1010
---
1111

12-
# Azure Device Update for IoT Hub import manifest concepts
12+
# Azure Device Update for IoT Hub import concepts
1313

14-
To deploy an update to devices using Azure Device Update for IoT Hub, you first import the update into the Device Update service, which stores the imported update and deploys it to devices. Along with the update payload, you submit a JSON import manifest file that defines important information about the update. This article describes the important concepts and sections in the import manifest JSON file.
14+
To deploy an update to devices using Azure Device Update for IoT Hub, you first import the update into the Device Update service, which stores the imported update and deploys it to devices. This article provides an overview of some important concepts to understand when it comes to importing updates.
1515

16-
<a name="import-manifest"></a>
17-
## Import manifest file
16+
## Import manifest
1817

19-
You submit an import manifest JSON file along with the associated update files, such as a firmware update package, as part of the import process. The metadata defined in the import manifest is used both to ingest the update and at deployment time for functions like validating whether the update installed correctly.
18+
An import manifest is a JSON file that defines important information about the update you're importing. You submit both your import manifest and associated update file or files, such as a firmware update package, as part of the import process. The metadata defined in the import manifest is used to ingest the update. Some of the metadata is also used at deployment time, for example to validate if an update installed correctly.
2019

2120
The following JSON code shows an example import manifest file:
2221

@@ -65,11 +64,11 @@ The sections of the import manifest file represent important Device Update conce
6564

6665
### Update identity
6766

68-
The *update identity* or `updateId` provides the unique identifier for an update in Device Update, and contains the following properties:
67+
The *update identity* or `updateId` is the unique identifier for an update in Device Update, and contains the following properties:
6968

70-
- `provider` is the entity that creates or is responsible for the update, often a company name.
71-
- `name` identifies an update class, often a device class or model name.
72-
- `version` is a number that distinguishes this update from others with the same provider and name.
69+
- **Provider** is the entity that creates or is responsible for the update, often a company name.
70+
- **Name** is the identifier for an update class. **Name** is often a device class or model name.
71+
- **Version** is a number that distinguishes this update from others with the same provider and name.
7372

7473
For example:
7574

@@ -88,7 +87,7 @@ For example:
8887
8988
### Compatibility
9089

91-
The `compatibility` section uses one or more arbitrary key-value pairs to define the devices that can install an update. Only devices that report properties matching the `compatibility` values are eligible to deploy the update. You can make an update compatible with multiple device classes by including more than one set of device compatibility properties.
90+
The **Compatibility** section uses one or more arbitrary key-value pairs to define the devices that can install an update. Only devices that report properties matching the compatibility values are eligible to deploy the update. You can make an update compatible with multiple device classes by including more than one set of device compatibility properties.
9291

9392
The following example shows an update that can only be deployed to devices that report *Contoso* and *Toaster* as their device manufacturer and model.
9493

@@ -105,7 +104,7 @@ The following example shows an update that can only be deployed to devices that
105104

106105
### Instructions
107106

108-
The `instructions` section contains the necessary information or `steps` for the device agent to install the update. The simplest update contains a single inline step that executes the update payload file using a `handler` registered with the device agent. The following example shows a single-step `instructions` section.
107+
The **Instructions** section contains the necessary information or steps for the device agent to install the update. The simplest update contains a single inline step that executes the update payload file using a handler registered with the device agent. The following example shows a single-step instructions section.
109108

110109
```json
111110
{
@@ -125,7 +124,7 @@ The `instructions` section contains the necessary information or `steps` for the
125124
> [!NOTE]
126125
> The `handler` property is equivalent to the `updateType` property in import manifest version 3.0 or older.
127126
128-
An update and an import manifest `steps` section can contain more than one step, as in the following example:
127+
An update can contain more than one step, as in the following example:
129128

130129
```json
131130
{
@@ -153,7 +152,9 @@ An update and an import manifest `steps` section can contain more than one step,
153152
}
154153
```
155154

156-
A `steps` section can also contain `reference` steps that instruct the device agent to install a different update and corresponding import manifest, establishing a parent and child update relationship. The following example update for a toaster contains two child update steps. An update can contain any combination of inline and reference steps.
155+
An update may contain *reference* steps that instruct the device agent to install another update with its own import manifest, establishing a parent and child update relationship. An update can contain any combination of inline and reference steps.
156+
157+
For example, an update for a toaster may contain two child updates:
157158

158159
```json
159160
{
@@ -183,24 +184,24 @@ A `steps` section can also contain `reference` steps that instruct the device ag
183184

184185
### Files
185186

186-
The `files` section of the import manifest contains update payload file metadata like `name`, `size`, and `hash`. Device Update uses this metadata for integrity validation during the import process, and forwards the same information to the device agent for integrity validation before installation.
187+
The **Files** section of the import manifest contains update payload file metadata like `name`, `size`, and `hash`. Device Update uses this metadata for integrity validation during the import process, and forwards the same information to the device agent for integrity validation before installation.
187188

188189
> [!NOTE]
189190
> A parent update that contains only reference steps doesn't define any update payload files.
190191
191192
## Create an import manifest
192193

193-
Once you understand the structure of an import manifest, create an import manifest file to describe your update. You can author a JSON import manifest file manually using a text editor, but the Azure CLI [az iot du init v5](/cli/azure/iot/du/update/init#az-iot-du-update-init-v5) command simplifies the process. For more information and instructions, see [Prepare an update to import into Device Update](create-update.md).
194+
While it's possible to author an import manifest JSON manually using a text editor, the Azure CLI simplifies the process greatly. When you're ready to try out the creation of an import manifest, you can use the [How-to guide](create-update.md#create-a-basic-device-update-import-manifest).
194195

195196
> [!IMPORTANT]
196-
> To import into the Azure portal, an import manifest JSON filename must end with *.importmanifest.json*.
197+
> To import into the Device Update service via the Azure portal, an import manifest JSON filename must end with *.importmanifest.json*.
197198
198199
> [!TIP]
199200
> You can use [Visual Studio Code](https://code.visualstudio.com) to enable autocomplete and JSON schema validation when you create an import manifest.
200201
201202
## Update import limits
202203

203-
Certain limits are enforced for Device Update instances, including import limits. For more information, see [Device Update limits](./device-update-limits.md).
204+
Certain limits are enforced for each Device Update for IoT Hub instance. If you haven't already reviewed them, see [Device Update limits](./device-update-limits.md).
204205

205206
## Related content
206207

articles/iot-hub-device-update/import-schema.md

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Import manifest schema for Azure Device Update for IoT Hub
33
description: Understand the schema used to create the required import manifest for importing updates into Azure Device Update for IoT Hub.
44
author: andrewbrownmsft
55
ms.author: andbrown
6-
ms.date: 01/03/2025
6+
ms.date: 01/08/2025
77
ms.topic: concept-article
88
ms.service: azure-iot-hub
99
ms.subservice: device-update
@@ -37,8 +37,8 @@ The `updateID` object is a unique identifier for each update.
3737

3838
|Property|Type|Description|Required|
3939
|---|---|---|---|
40-
|**provider**|`string`|Entity who is creating or directly responsible for the update, such as a company name.<br>Pattern: `^[a-zA-Z0-9.-]+$`<br>Maximum length: 64 characters|Yes|
41-
|**name**|`string`|Identifier for a class of update, such as a device class or model name.<br>Pattern: `^[a-zA-Z0-9.-]+$`<br>Maximum length: 64 characters|Yes|
40+
|**provider**|`string`|Entity who is creating or directly responsible for the update. The **provider** can be a company name.<br>Pattern: `^[a-zA-Z0-9.-]+$`<br>Maximum length: 64 characters|Yes|
41+
|**name**|`string`|Identifier for a class of update. The **name** can be a device class or model name.<br>Pattern: `^[a-zA-Z0-9.-]+$`<br>Maximum length: 64 characters|Yes|
4242
|**version**|`string`|Two- to four-part dot-separated numerical version numbers. Each part must be a number between 0 and 2147483647, and leading zeroes are dropped.<br>Pattern: `^\d+(?:\.\d+)+$`<br>Examples: `"1.0"`, `"2021.11.8"`|Yes|
4343

4444
No other properties are allowed.
@@ -107,7 +107,7 @@ An `inline` step object is an installation instruction step that performs code e
107107

108108
|Property|Type|Description|Required|
109109
|---|---|---|---|
110-
|**type**|`string`|Instruction step type that performs code execution. Must be `inline`.|No|
110+
|**type**|`string`|Instruction step type that performs code execution. Must be `inline`. Defaults to `inline` if no value is provided.|No|
111111
|**description**|`string`|Optional instruction step description. Maximum length: 64 characters.|No|
112112
|**handler**|`string`|Identity of the handler on the device that can execute this step.<br>Pattern: `^\S+/\S+:\d{1,5}$`<br>Minimum length: Five characters<br>Maximum length: 32 characters<br>Examples: `microsoft/script:1`, `microsoft/swupdate:1`, `microsoft/apt:1` |Yes|
113113
|**files**|`string` `[1-10]`| Names of update files defined as [file objects](#files-object) that the agent passes to the handler. Each element length must be 1-255 characters. |Yes|
@@ -165,15 +165,15 @@ For example:
165165

166166
### Files object
167167

168-
Each *file* object is an update payload file, such as a binary, firmware, or script file, that must be unique within an update.
168+
Each `files` object is an update payload file, such as a binary, firmware, or script file, that must be unique within an update.
169169

170170
|Property|Type|Description|Required|
171171
|---|---|---|---|
172-
|**filename**|`string`|Update payload file name. Maximum length: 255 characters.|Yes|
173-
|**sizeInBytes**|`number`|File size in number of bytes. Maximum size: 2147483648 bytes.|Yes|
174-
|**hashes**|`fileHashes`|Base64-encoded file hashes with the algorithm name as key. For more information, see [fileHashes object](#filehashes-object). |Yes|
175-
|**relatedFiles**|`relatedFile[0-4]`|Collection of files related to one or more primary payload files. |No|
176-
|**downloadHandler**|`downloadHandler`|Specifies how to process any related files. |Yes if using `relatedFiles`|
172+
|**filename**|`string`|Update payload file name. Maximum length: 255 characters|Yes|
173+
|**sizeInBytes**|`number`|File size in number of bytes. Maximum size: 2147483648 bytes|Yes|
174+
|**hashes**|`fileHashes`|Base64-encoded file hashes with algorithm name as key. At least SHA-256 algorithm must be specified, and additional algorithms may be specified if supported by agent. See [Hashes object](#hashes-object} for details on how to calculate the hash.|Yes|
175+
|**relatedFiles**|`relatedFile[0-4]`|Collection of files related to one or more primary payload files. For more information, see [relatedFiles object](#relatedfiles-object).|No|
176+
|**downloadHandler**|`downloadHandler`|Specifies how to process any related files. |Yes, if using `relatedFiles`. For more information, see [downloadHandler object](#downloadhandler-object).|
177177

178178
No other properties are allowed.
179179

@@ -182,16 +182,29 @@ For example:
182182
```json
183183
{
184184
"files": [
185-
{
186-
"filename": "configure.sh",
187-
"sizeInBytes": 7558,
188-
"hashes": {...}
185+
{
186+
"fileName": "full-image-file-name",
187+
"sizeInBytes": 12345,
188+
"hashes": {...},
189+
"relatedFiles": [
190+
{
191+
"fileName": "delta-from-v1-file-name",
192+
"sizeInBytes": 1234,
193+
"hashes": {
194+
"SHA256": "delta-from-v1-file-hash"
195+
},
196+
"properties": {...}
197+
}
198+
],
199+
"downloadHandler": {
200+
"id": "microsoft/delta:1"
201+
}
189202
}
190203
]
191204
}
192205
```
193206

194-
#### fileHashes object
207+
#### Hashes object
195208

196209
The `hashes` object contains base64-encoded file hashes with the algorithm names as keys. At least the SHA-256 algorithm must be specified, and other algorithms may be specified if supported by the agent. For an example of how to calculate the hash correctly, see the `Get-AduFileHashes` function in the [AduUpdate.psm1 script](https://github.com/Azure/iot-hub-device-update/blob/main/tools/AduCmdlets/AduUpdate.psm1).
197210

@@ -220,7 +233,7 @@ The `relatedFiles` object contains a collection of files that are related to one
220233
|---|---|---|---|
221234
|**filename**|`string`|List of related files associated with a primary payload file.|Yes|
222235
|**sizeInBytes**|`number`|File size in number of bytes. Maximum size: 2147483648 bytes.|Yes|
223-
|**hashes**|`fileHashes`|Base64-encoded file hashes with algorithm name as key. For more information, see [fileHashes object](#filehashes-object). |Yes|
236+
|**hashes**|`fileHashes`|Base64-encoded file hashes with algorithm name as key. For more information, see [Hashes object](#filehashes-object). |Yes|
224237
|**properties**|`relatedFilesProperties` `[0-5]`|Up to five key-value pairs, where the key is limited to 64 ASCII characters and the value is a JObject with up to 256 ASCII characters. |No|
225238

226239
Other properties are allowed.

articles/iot-hub-device-update/import-update.md

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Import an update to Azure Device Update for IoT Hub
33
description: Learn how to import update files into Azure Device Update for IoT Hub by using the Azure portal, Azure CLI, or programmatically.
44
author: andrewbrownmsft
55
ms.author: andbrown
6-
ms.date: 01/03/2025
6+
ms.date: 01/08/2025
77
ms.topic: how-to
88
ms.service: azure-iot-hub
99
ms.subservice: device-update
@@ -23,6 +23,29 @@ To deploy an update to devices using Azure Device Update for IoT Hub, you first
2323
> [!IMPORTANT]
2424
> Make sure the storage account you use or create doesn't have private endpoints enabled. To see if private endpoints are enabled, you can check for your Azure Storage account name under **Private endpoints** in the [Private Link Center](https://portal.azure.com/#blade/Microsoft_Azure_Network/PrivateLinkCenterBlade/overview).
2525
26+
# [Azure portal](#tab/portal)
27+
28+
- Supported browsers Microsoft Edge or Google Chrome.
29+
30+
# [Azure CLI](#tab/cli)
31+
32+
- A Bash environment.
33+
34+
You can use the Bash environment in [Azure Cloud Shell](/azure/cloud-shell/quickstart) to run the commands in this article. Select **Launch Cloud Shell** to open Cloud Shell, or select the Cloud Shell icon in the top toolbar of the Azure portal.
35+
36+
:::image type="icon" source="~/reusable-content/ce-skilling/azure/media/cloud-shell/launch-cloud-shell-button.png" alt-text="Button to launch the Azure Cloud Shell." border="false" link="https://shell.azure.com":::
37+
38+
Or, if you prefer, you can run the Azure CLI commands locally:
39+
40+
1. [Install Azure CLI](/cli/azure/install-azure-cli). Run [az version](/cli/azure/reference-index#az-version) to see the installed Azure CLI version and dependent libraries, and run [az upgrade](/cli/azure/reference-index#az-upgrade) to install the latest version.
41+
1. Sign in to Azure by running [az login](/cli/azure/reference-index#az-login).
42+
1. Install the `azure-iot` extension when prompted on first use. To make sure you're using the latest version of the extension, run `az extension update --name azure-iot`.
43+
44+
>[!TIP]
45+
>The Azure CLI commands in this article use the backslash \\ character for line continuation so that the command arguments are easier to read. This syntax works in Bash environments. If you run these commands in PowerShell, replace each backslash with a backtick \`, or remove them entirely.
46+
47+
---
48+
2649
## Import an update
2750

2851
This section shows how to import an update using either the Azure portal or the Azure CLI. You can also [import an update by using the Device Update APIs](#import-using-the-device-update-apis) instead.
@@ -31,7 +54,7 @@ To import an update, you first upload the update and import manifest files into
3154

3255
# [Azure portal](#tab/portal)
3356

34-
1. On the [Azure portal](https://portal.azure.com) IoT hub page for your Device Update instance, select **Device management** > **Updates** from the left navigation.
57+
1. In the [Azure portal](https://portal.azure.com), on the IoT hub page for your Device Update instance, select **Device management** > **Updates** from the left navigation.
3558

3659
:::image type="content" source="media/import-update/import-updates-3-ppr.png" alt-text="Screenshot that shows Import updates." lightbox="media/import-update/import-updates-3-ppr.png":::
3760

@@ -76,19 +99,6 @@ The import process begins, and the screen switches to the **Updates** screen. Af
7699

77100
# [Azure CLI](#tab/cli)
78101

79-
You can use the Bash environment in [Azure Cloud Shell](/azure/cloud-shell/quickstart) to run the following commands. Select **Launch Cloud Shell** to open Cloud Shell, or select the Cloud Shell icon in the top toolbar of the Azure portal.
80-
81-
:::image type="icon" source="~/reusable-content/ce-skilling/azure/media/cloud-shell/launch-cloud-shell-button.png" alt-text="Button to launch the Azure Cloud Shell." border="false" link="https://shell.azure.com":::
82-
83-
Or, if you prefer, you can run the Azure CLI commands locally:
84-
85-
1. [Install Azure CLI](/cli/azure/install-azure-cli). Run [az version](/cli/azure/reference-index#az-version) to see the installed Azure CLI version and dependent libraries, and run [az upgrade](/cli/azure/reference-index#az-upgrade) to install the latest version.
86-
1. Sign in to Azure by running [az login](/cli/azure/reference-index#az-login).
87-
1. Install the `azure-iot` extension when prompted on first use. To make sure you're using the latest version of the extension, run `az extension update --name azure-iot`.
88-
89-
>[!TIP]
90-
>The following Azure CLI commands use the backslash \\ character for line continuation so that the command arguments are easier to read. This syntax works in Bash environments. If you run these commands in PowerShell, replace each backslash with a backtick \`, or remove them entirely.
91-
92102
The [az iot du update stage](/cli/azure/iot/du/update#az-iot-du-update-stage) command handles the prerequisite steps of importing an update, including uploading the update files into a target storage container. An optional flag also lets this command automatically import the files after preparing them. Otherwise, the [az iot du update import](/cli/azure/iot/du/update#az-iot-du-update-import) command completes the process.
93103

94104
The `stage` command takes the following arguments:

articles/iot-hub-device-update/update-manifest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Azure Device Update for IoT Hub update manifest
33
description: Learn about the update manifest that the Azure Device Update for IoT Hub service uses to send properties to devices during updates.
44
author: andrewbrownmsft
55
ms.author: andbrown
6-
ms.date: 01/03/2025
6+
ms.date: 01/08/2025
77
ms.topic: concept-article
88
ms.service: azure-iot-hub
99
ms.subservice: device-update

0 commit comments

Comments
 (0)