Long road of learning, and wading through older documents, I finally deploying my IOT Edge module to IOT Hub using this command:
az iot edge set-modules --hubname xxx --device-Id yy --content ./deployment.arm64vf8.json
When I run this command, i review these screens:
However, how do I set Environmental Variables from the JSON file?
The environment variables are in env
section of the deployment JSON.
Example:
{
"modulesContent": {
"$edgeAgent": {
"properties.desired.modules.EdgeModule": {
"version": "1.0.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/dotnet/samples:aspnetapp",
"createOptions": "{\"PortBindings\":{\"80/tcp\":[{\"HostPort\":\"8080\"}]}}}"
},
"env": {
"ASPNETCORE_ENVIRONMENT": {
"value": "Production"
}
}
}
}
}
}