Azure-Samples / iot-edge-sample-c

Azure IoT Edge Sample project for C
2 stars 2 forks source link

Variables in azure iot edge deployment template #2

Open kiranpradeep opened 4 years ago

kiranpradeep commented 4 years ago

This is not an issue ticket, but more of a request for documentation on azure iot edge deployment template. I like to know, how variables in deployment template are populated. Eg. How is the variable MODULES.SampleModule.debug populated? Is there a documentation on the same?

Of lesser importance: I also raised the same as a SO question with no replies yet.

blackchoey commented 4 years ago

You can refer following document to learn more about the deployment template: https://github.com/microsoft/vscode-azure-iot-edge/wiki/How-to-edit-deployment.*.template.json

kiranpradeep commented 4 years ago

To confirm the understanding the file deployment.*.template.json is only for being used from vscode. This file will never be referred to when running any CI/CD pipelines or any other programs. Is that correct?

blackchoey commented 4 years ago

The IoT Edge task in Azure Pipelines will also use the deployment template to decide how to build images and generate deployment manifest.

kiranpradeep commented 4 years ago

Thanks for the reply. But there is some important point missing. The documentation shared above on deployment template: https://github.com/microsoft/vscode-azure-iot-edge/wiki/How-to-edit-deployment.*.template.json is specific to vscode iot edge extension. From that, I can understand the vscode will be able to interpret MODULES.SampleModule.debug variable in the template.

But then, how is the IoT Edge task in Azure pipelines able to understand that variable MODULES.SampleModule.debug is referrring to the SampleModule under modules folder and then make an appropriate variable replacement? Is there a documentation for that?

blackchoey commented 4 years ago

The IoT Edge Azure Pipelines task will parse the template in the same way as how VS Code IoT Edge extension does. You can inspect the source code of https://github.com/Azure/iotedgedev to see how it parses the template.

Can you share which part of the wiki confuses you that it's only for VS Code IoT Edge extension? There should be some improvement to the document to avoid confusing.

kiranpradeep commented 4 years ago

Kindly think in terms of a strict CI/CD developer (not a module developer using vscode). He sees variables MODULES.SampleModule.debug in the template and have no clue. He looks at iotedge task documentation [1]. He finds no references about MODULES.*.debug. He is confused. What should he do know? There is no way for him to link that variable to a vscode extension documentaiton.

As initially pointed out, this ticket is not a bug and I close this ticket if you feel so. But I feel there is some documentation missing.

blackchoey commented 4 years ago

Thank you for the clarification. We will improve the document.