Azure-docs: Retain old IoT modules by adding new IoT modules for an existing IoT edge

Created on 31 Oct 2019  Â·  6Comments  Â·  Source: MicrosoftDocs/azure-docs

I have an IoT-edge running with 6 IoT-modules. I need to deploy 2 new IoT-modules to that device using a new deployment.json file.
In other words, I should be able to append new IoT modules without effecting existing modules.

For example:

I deployed 'module1' and 'module2' using an azure-container-registry 'XYZ'

"$edgeAgent": {
    "properties.desired": {
        "schemaVersion": "1.0",
        "runtime": {
            "settings":{
                "registryCredentials":{ 
                      XYZ  // give the edge agent access to container images that aren't public
                    }
                }
            }
        },
        "systemModules": {
            "edgeAgent": {
                // configuration and management details
            },
            "edgeHub": {
                // configuration and management details
            }
        },
        "modules": {
            "module1": { // optional
                // configuration and management details
            },
            "module2": { // optional
                // configuration and management details
            }
        }
    }
}

Then, I deploy 'module3' using an azure-container-registry 'ABC' with new deployment.json

"$edgeAgent": {
    "properties.desired": {
        "schemaVersion": "1.0",
        "runtime": {
            "settings":{
                "registryCredentials":{ 
                      ABC // give the edge agent access to container images that aren't public
                    }
                }
            }
        },
        "systemModules": {
            "edgeAgent": {
                // configuration and management details
            },
            "edgeHub": {
                // configuration and management details
            }
        },
        "modules": {
            "module3": { // optional
                // configuration and management details
            }
        }
    }
},

Once this deployment was a success, I could see only 'module3' under that IoT-edge. But, I need all 3 modules running under that device.

Thank you in advance. Looking forward to your answers.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri3 assigned-to-author doc-enhancement iot-edgsvc triaged

All 6 comments

@Sujina-Saddival Thank you for bringing this to our attention. I am making an assumption with regard to the document you are attempting to follow, and hoping you can provide a link to the specific set of instructions if they are not the same. By having the specific link to the document, we can ensure the appropriate updates are made. How are you deploying the additional modules?

Regards,
Mike

@Mike-Ubezzi-MSFT Thank you so much for your response.

I would like to explain my requirement.

There is already an Iotedge running with a set of modules that pulls the image from some docker container registry. I won't be having any details of the device except its IoT-hub connection string and IoT-edge name. Using these two details, I should deploy my modules into that device. These modules are pushed to the Azure-container-registry. So I need to deploy my modules retaining the modules that are running already.

Q: How are you deploying the additional modules?
A: I'm deploying additional modules using a new deployment manifest because I don't have a deployment manifest for already deployed modules.

DOC referred - https://docs.microsoft.com/bs-latn-ba/azure/iot-edge/module-composition

Hi @Sujina-Saddival ,
Azure IoT Edge provides two ways to configure the modules to run on IoT Edge devices: one for development and fast iterations on a single device, and one for managing large fleets of IoT Edge devices. Both of these approaches are available in the Azure portal and programmatically.

Please check the following document: Understand IoT Edge automatic deployments for single devices or at scale

You will need to follow best practices and create IotEdge deployments and "store" them on the respective IoTHub so that you can edit them after. Changes to IoT Edge deployment manifest are not incremental, therefore when deploying a manifest you need to enumerate all modules + the new one.

I am adding @kgremban to add anything I may be missing and evaluate if it would make sense that we add a note on this doc that the deployment manifest cannot be updated with incremental changes.

Hope it helps. Thanks!

@Sujina-Saddival, asergaz is correct in saying that there is currently no way to 'append' modules to an existing IoT Edge device without updating its current deployment manifest. What is preventing you from creating a combined deployment manifest with module1, module2, and module3 listed together? You mentioned in your original post that you have a different container registry for module1 and module2 than for module3, but you can include credentials for multiple registries in a single deployment manifest.

Since we have not heard back from you we will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.

@kgremban @asergaz Thank you much so timely response.
The information was very needful.
You will need to follow best practices and create IotEdge deployments and "store" them on the respective IoTHub so that you can edit them after. Changes to IoT Edge deployment manifest are not incremental, therefore when deploying a manifest you need to enumerate all modules + the new one.

I would follow this method and start deploying.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spottedmahn picture spottedmahn  Â·  3Comments

bityob picture bityob  Â·  3Comments

jamesgallagher-ie picture jamesgallagher-ie  Â·  3Comments

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments