Cuir in eagar

Comhroinn trí


Device Update for IoT Hub update manifest

Device Update for IoT Hub uses IoT Plug and Play to send data to devices during deployment. One of them is the update manifest, a serialized JSON object string containing metadata of the update to install. It's also cryptographically signed to allow the Device Update agent to verify its authenticity. For more information on how the update manifest is used to securely install content, see Device Update security.

Import manifest vs update manifest

It's important to understand the differences between the import manifest and the update manifest concepts in Device Update for IoT Hub:

  • The import manifest is created by whomever creates the corresponding update. It describes the contents of the update that will be imported into Device Update for IoT Hub.
  • The update manifest is automatically generated by the Device Update for IoT Hub service, using some of the properties that were defined in the import manifest. It's used to communicate relevant information to the Device Update agent during the update process.

Each manifest type has its own schema and schema version.

Update manifest schema

Important

Update manifest JSON schema version 4 is hosted at SchemaStore.org.

Example update manifest

{
  "manifestVersion": "4",
  "updateId": {
    "provider": "Contoso",
    "name": "Toaster",
    "version": "1.0"
  },
  "compatibility": [
    {
      "manufacturer": "Contoso",
      "model": "Toaster"
    }
  ],
  "instructions": {
    "steps": [
      {
        "handler": "microsoft/swupdate:1",
        "handlerProperties": {
          "installedCriteria": "1.0"
        },
        "files": [
          "fileId0"
        ]
      }
    ]
  },
  "files": {
    "fileId0": {
      "filename": "contoso.toaster.1.0.swu",
      "sizeInBytes": 718,
      "hashes": {
        "sha256": "mcB5SexMU4JOOzqmlJqKbue9qMskWY3EI/iVjJxCtAs="
      }
    }
  },
  "createdDateTime": "2021-09-28T18:32:01.8404544Z"
}

Full vs mini update manifest

When an update manifest exceeds a certain size that prevents it from being communicated efficiently, Device Update for IoT Hub will send it to the device in detached format, also known as a mini update manifest. A mini manifest is technically metadata for update manifest and contains information needed for the Device Update agent to download the full update manifest and verify its authenticity.

Example mini update manifest:

{
  "manifestVersion": "4",
  "updateId": {
    "provider": "Contoso",
    "name": "Toaster",
    "version": "1.0"
  },
  "detachedManifestFileId": "fileId1",
  "files": {
    "fileId1": {
      "filename": "contoso.toaster.1.0.updatemanifest.json",
      "sizeInBytes": 2048,
      "hashes": {
        "sha256": "789s9PDfX4uA9wFUubyC30BWkLFbgmpkpmz1fEdqo2U="
      }
    }
  }
}