With IoT Edge automatic deployments, how do I stop a previous deployment's module properties.desired overwriting any other desired.properties I set?

Iain White 146 Reputation points

When I perform a new automatic deployment with no properties.desired applied, the module properties.desired' values from a previous deployment are being applied and are overwriting any new properties I apply. Setting --layered false has no effect but I didn't expect it to because the default is stated as 'False'.

I'm following the documentation on IoT Edge automatic deployments: https://learn.microsoft.com/en-us/azure/iot-edge/module-deployment-monitoring?view=iotedge-1.4

And also the deployment CLI:


The documentation is a bit difficult to understand -

An edge deployment is classified as layered if a module has properties.desired.* defined.

Then it states that a deployment can be defined as layered using the --layered property, but this seems to contradict the above which states that it is the presence of the properties.desired details that defines whether a deployment is 'layered' or not.

Also, there doesn't appear to be any way to tell if a deployment is layered or not from the portal. Is this correct or am I missing something?

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
422 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sander van de Velde 17,856 Reputation points MVP

    Hello @Iain White

    normally, Azure IoT Edge devices are updated by providing a deployment manifest.

    Azure IoT Edge also offers layered deployments:

    User's image

    Multiple (partial and conditional) deployment layers make up a complete deployment manifest.

    You are responsible for adding multiple layers complete with priorities.

    This is what you are trying to do using the CLI.

    Please try it out first using the Azure Portal before using the CLI so you get familiar with what is needed.

    Pay also attention to the usually overseen standard/base deployment on which the layered deployments are set. That basic deployment support access to the edgeHub and edgeAgent.

    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.

    1 person found this answer helpful.
    0 comments No comments

  2. LeelaRajeshSayana-MSFT 3,461 Reputation points

    Hi @Iain White Greetings! Thank you for posting this question here.

    values from a previous deployment are being applied and are overwriting any new properties I apply

    I suspect the previous deployment is still targeting the device and applying the settings. You can validate this by inspecting the Metrics captured from the deployments and verify if it still being applied to the device. Also, please make sure that the new deployment has a greater Priority number. Kindly note that if an IoT Edge device is targeted by more than one deployment, the deployment with the highest priority applies.

    If you prefer to remove any existing desired properties from the previous deployments, you can perhaps do so by setting the desired property to null in the latest deployment. This recommendation is based on the observations from Back end operations from module twins where the following sample is provided on how to remove a desired property.

        "properties": {
            "desired": {
                "newProperty": {
                    "nestedProperty": "newValue"
                "existingProperty": "otherNewValue",
                "otherOldProperty": null

    The documentation is a bit difficult to understand

    Thank you for bringing this feedback to us. We will work on improving the article to provide clarification.

    there doesn't appear to be any way to tell if a deployment is layered or not from the portal

    We will check with the team internally on this and get back to you with more updates.

    Please let us know if you have any additional questions or need further clarification in the comments below. We would be glad to help you further.

    If the response helped, please do click Accept Answer and Yes. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.