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/delta-updates.md
+18-23Lines changed: 18 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,18 +3,18 @@ title: Azure Device Update for IoT Hub delta updates | Microsoft Learn
3
3
description: Understand key concepts for using delta or differential updates with Azure Device Update for IoT Hub.
4
4
author: andrewbrownmsft
5
5
ms.author: andbrown
6
-
ms.date: 01/21/2025
6
+
ms.date: 01/22/2025
7
7
ms.topic: conceptual
8
8
ms.service: azure-iot-hub
9
9
ms.subservice: device-update
10
10
---
11
11
12
12
# Delta updates (Preview)
13
13
14
-
Delta updates in Azure Device Update for IoT Hub allow you to generate small updates that represent only the changes between two full updates, a source image and a target image. This approach is ideal for reducing the bandwidth used to download an update to a device, especially if there are only a few changes between the source and target updates.
14
+
Delta updates allow you to generate small updates that represent only the changes between two full updates, a source image and a target image. This approach is ideal for reducing the bandwidth used to download an update to a device, especially if there are only a few changes between the source and target updates.
15
15
16
16
>[!NOTE]
17
-
>The delta update feature is currently in [public preview](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
17
+
>The delta update feature in Azure Device Update for IoT Hub is currently in [public preview](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
18
18
19
19
## Requirements for using delta updates in Device Update for IoT Hub
20
20
@@ -33,11 +33,11 @@ The Device Update agent _orchestrates_ the update process on the device, includi
33
33
34
34
### Update handler
35
35
36
-
An update handler integrates with the Device Update agent to perform the actual update install. For delta updates, start with the [`microsoft/swupdate:2` update handler](https://github.com/Azure/iot-hub-device-update/blob/main/src/extensions/step_handlers/swupdate_handler_v2/README.md) if you don't want to modify your own SWUpdate update handler.
36
+
An update handler integrates with the Device Update agent to perform the actual update install. For delta updates, start with the [`microsoft/swupdate:2` update handler](https://github.com/Azure/iot-hub-device-update/blob/main/src/extensions/step_handlers/swupdate_handler_v2/README.md) if you don't already have your own SWUpdate update handler that you want to modify.
37
37
38
38
### Delta processor
39
39
40
-
The delta processor at [Azure/iot-hub-device-update-delta](https://github.com/Azure/iot-hub-device-update-delta) creates the original SWU image file on your device after the delta file downloads, so your update handler can install the SWU file. To add the delta processor component to your device image and configure it for use, you can download a Debian package for Ubuntu 20.04 and later from [https://github.com/Azure/iot-hub-device-update-delta/tree/main/preview/2.0.0](https://github.com/Azure/iot-hub-device-update-delta/tree/main/preview/2.0.0).
40
+
The delta processor at [Azure/iot-hub-device-update-delta](https://github.com/Azure/iot-hub-device-update-delta)re-creates the original SWU image file on your device after the delta file downloads, so your update handler can install the SWU file. To add the delta processor component to your device image and configure it for use, you can download a Debian package for Ubuntu 20.04 and later from [https://github.com/Azure/iot-hub-device-update-delta/tree/main/preview/2.0.0](https://github.com/Azure/iot-hub-device-update-delta/tree/main/preview/2.0.0).
41
41
42
42
If you use another distro, follow the *README.md* instructions to use CMAKE to build the delta processor from source instead. From there, install the shared object *libadudiffapi.so* directly by copying it to the */usr/lib* directory, as follows:
43
43
@@ -46,9 +46,9 @@ sudo cp <path to libadudiffapi.so> /usr/lib/libadudiffapi.so
46
46
sudo ldconfig
47
47
```
48
48
49
-
### Source SWU image file on the device
49
+
### Add a source SWU image file to your device
50
50
51
-
After the delta update file downloads to a device, it compares against a valid `<source_archive>` previously cached on the device. This process enables the delta update to recreate the full target image.
51
+
After the delta update file downloads to a device, it is compared against a valid `<source_archive>` previously cached on the device. This process enables the delta update to recreate the full target image.
52
52
53
53
The simplest way to populate this cached image is to [import](import-update.md) and [deploy](deploy-update.md) a full image update to the device via the Device Update service. If the device is configured with Device Update agent version 1.0 or later and the delta processor, the agent caches the installed SWU file automatically for later delta update use.
54
54
@@ -60,7 +60,7 @@ If you want to directly prepopulate the source image on your device instead, the
60
60
-`/` encoded as `octets _2F`
61
61
-`=` encoded as `octets _3D`
62
62
63
-
## Delta updates using the DiffGen tool
63
+
## Delta update generation using the DiffGen tool
64
64
65
65
You can create delta updates by using the [Diff Generation (DiffGen) tool](https://github.com/Azure/iot-hub-device-update-delta?tab=readme-ov-file#diff-generation).
66
66
@@ -72,7 +72,7 @@ The following table shows the content needed, where to get it, and recommended i
72
72
73
73
| Binary name | Where to acquire | How to install |
74
74
|--|--|--|
75
-
| DiffGen |[Azure/iot-hub-device-update-delta](https://github.com/Azure/iot-hub-device-update-delta/tree/main/preview/2.0.0) GitHub repo |Download the version matching the OS and distro on the machine to be used to generate delta updates. |
75
+
| DiffGen |[Azure/iot-hub-device-update-delta](https://github.com/Azure/iot-hub-device-update-delta/tree/main/preview/2.0.0) GitHub repo |Download the version matching the OS or distro on the machine to be used to generate delta updates. |
76
76
| .NETCore runtime, version 8.0.0 | Via Terminal or package managers |[Install .NET on Linux](/dotnet/core/install/linux). Only the runtime is required. |
77
77
78
78
### Delta update creation using DiffGen
@@ -83,19 +83,19 @@ The DiffGen tool runs with the following required arguments and syntax:
83
83
84
84
The preceding command runs the *recompress_tool.py* script, which creates the `<recompressed_target_file>`. DiffGen then uses the `<recompressed_target_file>`instead of `<target_archive>` as the target file for creating the diff. Image files within the `<recompressed_target_archive>` are compressed with gzip.
85
85
86
-
Most SWU files are signed, so they also require the `<signing_command>` argument in the DiffGen command:
86
+
If your SWU files are signed, they also require the `<signing_command>` argument in the DiffGen command:
The DiffGenTool with signing command string parameter runs the *recompress_and_sign_tool.py* script. This script creates the `<recompressed_target_file>` and also signs the *sw-description* file within the archive to create a *sw-description.sig* file.
90
+
The DiffGenTool with signing command string parameter runs the *recompress_and_sign_tool.py* script. This script creates the `<recompressed_target_file>`. In addition, this script also signs the *sw-description* file within the archive to create a *sw-description.sig* file.
91
91
92
92
You can use the sample *sign_file.sh* script from the [Azure/iot-hub-device-update-delta](https://github.com/Azure/iot-hub-device-update-delta/tree/main/src/scripts/signing_samples/openssl_wrapper) GitHub repo to create a diff between the input source file and a recompressed and re-signed target file. Open the script, edit it to add the path to your private key file, and save it. See the [Examples](#diffgen-examples) section for sample usage.
93
93
94
94
The following table describes the arguments in more detail:
95
95
96
96
| Argument | Description |
97
97
|--|--|
98
-
|`<source_archive>`| The image that the delta creation bases against when creating the delta. **Important**: This image must be identical to the image already present on the device, for example cached from a previous update. |
98
+
|`<source_archive>`| The image that the delta creation is based on when creating the delta. **Important**: This image must be identical to the image already present on the device, for example cached from a previous update. |
99
99
|`<target_archive>`| The image that the delta updates the device to. |
100
100
|`<output_path>`| The path on the host machine to place the delta file in after creation, including desired name of the generated delta file. If the path doesn't exist, the tool creates it. |
101
101
|`<log_folder>`| The path on the host machine to create logs in. It's best to define this location as a subfolder of the output path. If the path doesn't exist, the tool creates it. |
@@ -119,7 +119,7 @@ sudo ./DiffGenTool
119
119
/mnt/o/temp/<recompressed target file to create>.swu
120
120
```
121
121
122
-
If you also use the signing parameter, which you must if your SWU file is signed, you can use the sample *sign_file.sh* script from the [Azure/iot-hub-device-update-delta](https://github.com/Azure/iot-hub-device-update-delta/tree/main/src/scripts/signing_samples/openssl_wrapper) GitHub repo. Open the script, edit it to add the path to your private key file, save the script, and then run DiffGen as follows.
122
+
If you also use the signing parameter, which you must if your SWU file is signed, you can use the sample *sign_file.sh* script mentioned previously. Open the script, edit it to add the path to your private key file, save the script, and then run DiffGen as follows.
123
123
124
124
The following code creates a diff between the input source file and a recompressed and re-signed target file:
125
125
@@ -134,9 +134,9 @@ sudo ./DiffGenTool
134
134
/mnt/o/temp/<path to script>/<sign_file>.sh
135
135
```
136
136
137
-
## Import for generated delta updates
137
+
## Generated delta update import
138
138
139
-
The process of importing a delta update to the Device Update service is the same as for any other update. If you haven't already, be sure to review [How to prepare an update to be imported into Azure Device Update for IoT Hub](create-update.md).
139
+
The basic process of importing a delta update to the Device Update service is the same as for any other update. If you haven't already, be sure to review [How to prepare an update to be imported into Azure Device Update for IoT Hub](create-update.md).
140
140
141
141
### Generate the import manifest
142
142
@@ -171,12 +171,7 @@ Use the `downloadHandler` object to specify how the Device Update agent orchestr
171
171
You can use the Azure CLI [`az iot du update init v5`](/cli/azure/iot/du/update/init#az-iot-du-update-init-v5) command to generate an import manifest for your delta update. For more information, see [Create a basic import manifest](create-update.md#create-a-basic-device-update-import-manifest).
--compat manufacturer=<value your device reports> model=<value your device reports> \
177
-
--step handler=microsoft/swupdate:2 properties=<JSON-formatted handler properties such as installedCriteria> \
178
-
--file path=<path(s) to update file(s), including full file names> downloadHandler=microsoft/delta:1 \
179
-
--related-file path=<path(s) to delta file(s), including full file names> properties='{"microsoft.sourceFileHashAlgorithm": "sha256", "microsoft.sourceFileHash": "<source SWU image file hash>"}'
174
+
--update-provider <replace with your Provider> --update-name <replace with your update Name> --update-version <replace with your update Version> --compat manufacturer=<replace with the value your device will report> model=<replace with the value your device will report> --step handler=microsoft/swupdate:2 properties=<replace with any desired handler properties (JSON-formatted), such as '{"installedCriteria": "1.0"}'> --file path=<replace with path(s) to your update file(s), including the full file name> downloadHandler=microsoft/delta:1 --related-file path=<replace with path(s) to your delta file(s), including the full file name> properties='{"microsoft.sourceFileHashAlgorithm": "sha256", "microsoft.sourceFileHash": "<replace with the source SWU image file hash>"}'
180
175
```
181
176
182
177
Save your generated import manifest JSON with the file extension *.importmanifest.json*.
@@ -185,7 +180,7 @@ Save your generated import manifest JSON with the file extension *.importmanifes
185
180
186
181
Once you create your import manifest, import the delta update by following the instructions in [Add an update to Device Update for IoT Hub](import-update.md#import-an-update). You must include the following items in the import:
187
182
188
-
- The *\*importmanifest.json* file
183
+
- The *\*importmanifest.json* file that you previously created in the earlier steps
189
184
- The `<recompressed_target_file>` SWU image the DiffGen tool created
190
185
- The `<delta file>` the DiffGen tool created
191
186
@@ -195,7 +190,7 @@ The delta update deployment experience in the Azure portal is the same as deploy
195
190
196
191
Once you create the deployment for your delta update, the Device Update service and client automatically determine if there's a valid delta update for each device you're deploying to. If they find a valid delta, they download and install the delta update on that device.
197
192
198
-
If they don't find a valid delta update, they download the full recompressed target SWU image update instead as a fallback. This approach ensures that all devices you deploy to get the appropriate version.
193
+
If they don't find a valid delta update, the full image update (the recompressed target SWU image) is downloaded instead as a fallback. This approach ensures that all devices you're deploying the update to get to the appropriate version.
199
194
200
195
There are three possible outcomes for a delta update deployment:
0 commit comments