You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-hub-device-update/import-concepts.md
+21-20Lines changed: 21 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,21 @@
1
1
---
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.
4
4
author: andrewbrownmsft
5
5
ms.author: andbrown
6
-
ms.date: 01/03/2025
6
+
ms.date: 01/08/2025
7
7
ms.topic: concept-article
8
8
ms.service: azure-iot-hub
9
9
ms.subservice: device-update
10
10
---
11
11
12
-
# Azure Device Update for IoT Hub import manifest concepts
12
+
# Azure Device Update for IoT Hub import concepts
13
13
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.
15
15
16
-
<aname="import-manifest"></a>
17
-
## Import manifest file
16
+
## Import manifest
18
17
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.
20
19
21
20
The following JSON code shows an example import manifest file:
22
21
@@ -65,11 +64,11 @@ The sections of the import manifest file represent important Device Update conce
65
64
66
65
### Update identity
67
66
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:
69
68
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.
73
72
74
73
For example:
75
74
@@ -88,7 +87,7 @@ For example:
88
87
89
88
### Compatibility
90
89
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.
92
91
93
92
The following example shows an update that can only be deployed to devices that report *Contoso* and *Toaster* as their device manufacturer and model.
94
93
@@ -105,7 +104,7 @@ The following example shows an update that can only be deployed to devices that
105
104
106
105
### Instructions
107
106
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.
109
108
110
109
```json
111
110
{
@@ -125,7 +124,7 @@ The `instructions` section contains the necessary information or `steps` for the
125
124
> [!NOTE]
126
125
> The `handler` property is equivalent to the `updateType` property in import manifest version 3.0 or older.
127
126
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:
129
128
130
129
```json
131
130
{
@@ -153,7 +152,9 @@ An update and an import manifest `steps` section can contain more than one step,
153
152
}
154
153
```
155
154
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:
157
158
158
159
```json
159
160
{
@@ -183,24 +184,24 @@ A `steps` section can also contain `reference` steps that instruct the device ag
183
184
184
185
### Files
185
186
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.
187
188
188
189
> [!NOTE]
189
190
> A parent update that contains only reference steps doesn't define any update payload files.
190
191
191
192
## Create an import manifest
192
193
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 manifestJSON 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).
194
195
195
196
> [!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*.
197
198
198
199
> [!TIP]
199
200
> You can use [Visual Studio Code](https://code.visualstudio.com) to enable autocomplete and JSON schema validation when you create an import manifest.
200
201
201
202
## Update import limits
202
203
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).
Copy file name to clipboardExpand all lines: articles/iot-hub-device-update/import-schema.md
+29-16Lines changed: 29 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Import manifest schema for Azure Device Update for IoT Hub
3
3
description: Understand the schema used to create the required import manifest for importing updates into Azure Device Update for IoT Hub.
4
4
author: andrewbrownmsft
5
5
ms.author: andbrown
6
-
ms.date: 01/03/2025
6
+
ms.date: 01/08/2025
7
7
ms.topic: concept-article
8
8
ms.service: azure-iot-hub
9
9
ms.subservice: device-update
@@ -37,8 +37,8 @@ The `updateID` object is a unique identifier for each update.
37
37
38
38
|Property|Type|Description|Required|
39
39
|---|---|---|---|
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|
42
42
|**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|
43
43
44
44
No other properties are allowed.
@@ -107,7 +107,7 @@ An `inline` step object is an installation instruction step that performs code e
107
107
108
108
|Property|Type|Description|Required|
109
109
|---|---|---|---|
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|
111
111
|**description**|`string`|Optional instruction step description. Maximum length: 64 characters.|No|
112
112
|**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|
113
113
|**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:
165
165
166
166
### Files object
167
167
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.
169
169
170
170
|Property|Type|Description|Required|
171
171
|---|---|---|---|
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).|
177
177
178
178
No other properties are allowed.
179
179
@@ -182,16 +182,29 @@ For example:
182
182
```json
183
183
{
184
184
"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
+
}
189
202
}
190
203
]
191
204
}
192
205
```
193
206
194
-
#### fileHashes object
207
+
#### Hashes object
195
208
196
209
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).
197
210
@@ -220,7 +233,7 @@ The `relatedFiles` object contains a collection of files that are related to one
220
233
|---|---|---|---|
221
234
|**filename**|`string`|List of related files associated with a primary payload file.|Yes|
222
235
|**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|
224
237
|**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|
Copy file name to clipboardExpand all lines: articles/iot-hub-device-update/import-update.md
+25-15Lines changed: 25 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Import an update to Azure Device Update for IoT Hub
3
3
description: Learn how to import update files into Azure Device Update for IoT Hub by using the Azure portal, Azure CLI, or programmatically.
4
4
author: andrewbrownmsft
5
5
ms.author: andbrown
6
-
ms.date: 01/03/2025
6
+
ms.date: 01/08/2025
7
7
ms.topic: how-to
8
8
ms.service: azure-iot-hub
9
9
ms.subservice: device-update
@@ -23,6 +23,29 @@ To deploy an update to devices using Azure Device Update for IoT Hub, you first
23
23
> [!IMPORTANT]
24
24
> 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).
25
25
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
+
26
49
## Import an update
27
50
28
51
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
31
54
32
55
# [Azure portal](#tab/portal)
33
56
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.
35
58
36
59
:::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":::
37
60
@@ -76,19 +99,6 @@ The import process begins, and the screen switches to the **Updates** screen. Af
76
99
77
100
# [Azure CLI](#tab/cli)
78
101
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
-
92
102
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.
93
103
94
104
The `stage` command takes the following arguments:
0 commit comments