microsoft / vscode-azure-iot-tools

The ultimate collection of extensions for working with Azure IoT in VS Code!
https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-tools
MIT License
20 stars 19 forks source link

Extension won't generate deployment manifests if the template contains a comment #33

Open ethanshea-ms opened 3 years ago

ethanshea-ms commented 3 years ago

When I right click a deployment template that contains comments and select "Generate IoT Edge Deployment Manifest", I see an error message like the one below.

image

There are two problems here:

  1. The error message only contains a position, and not a line/column number making the source of the problem difficult to track down.
  2. The command does not accept templates which contain comments. This makes it difficult to document my deployments.
Reproducing file (deployment.template.json) ```jsonc { "modulesContent": { "$edgeAgent": { // This is a comment "properties.desired": { "modules": {}, "runtime": { "settings": { "minDockerVersion": "v1.25" }, "type": "docker" }, "schemaVersion": "1.0", "systemModules": { "edgeAgent": { "settings": { "image": "mcr.microsoft.com/azureiotedge-agent:1.0" }, "type": "docker" }, "edgeHub": { "settings": { "image": "mcr.microsoft.com/azureiotedge-hub:1.0" } }, "type": "docker", "status": "running", "restartPolicy": "always" } } } }, "$edgeHub": { "properties.desired": { "routes": { "route": "FROM /messages/* INTO $upstream" }, "schemaVersion": "1.0", "storeAndForwardConfiguration": { "timeToLiveSecs": 7200 } } } } } ```