Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When generating the config json. The docker image does not get set correctly #664

Open
AnOdyssey opened this issue Dec 14, 2023 · 2 comments

Comments

@AnOdyssey
Copy link

AnOdyssey commented Dec 14, 2023

  • VSCode Version: 1.85.0
  • OS Version: Microsoft Windows 10 Pro Version 10.0.19045 Build 19045
  • Extension Version: v1.25.11

Steps to Reproduce:

  1. Generate a new project. Parameters don't mather neither does the container registry that gets entered
  2. Generate the config file for running on the simulator
{
  "modulesContent": {
    "$edgeAgent": {
      "properties.desired": {
        "schemaVersion": "1.4",
        "runtime": {
          "type": "docker",
          "settings": {
            "minDockerVersion": "v1.25",
            "loggingOptions": "",
            "registryCredentials": {
              "**Redacted**": {
                "username": "**Redacted**",
                "password": "**Redacted**",
                "address": "**Redacted**"
              }
            }
          }
        },
        "systemModules": {
          "edgeAgent": {
            "type": "docker",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-agent:1.4",
              "createOptions": "{}"
            }
          },
          "edgeHub": {
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-hub:1.4",
              "createOptions": "{\"HostConfig\":{\"PortBindings\":{\"5671/tcp\":[{\"HostPort\":\"5671\"}],\"8883/tcp\":[{\"HostPort\":\"8883\"}],\"443/tcp\":[{\"HostPort\":\"443\"}]}}}"
            }
          }
        },
        "modules": {
          "modbusmodule": {
            "version": "1.0",
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "${MODULES.modbusmodule.debug}",
              "createOptions": "{}"
            }
          },
          "SimulatedTemperatureSensor": {
            "version": "1.0",
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.4",
              "createOptions": "{}"
            }
          },
          "testmodule": {
            "version": "1.0",
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "${MODULES.testmodule}",
              "createOptions": "{}"
            }
          }
        }
      }
    },
    "$edgeHub": {
      "properties.desired": {
        "schemaVersion": "1.4",
        "routes": {
          "modbusmoduleToIoTHub": "FROM /messages/modules/modbusmodule/outputs/* INTO $upstream",
          "sensorTomodbusmodule": "FROM /messages/modules/SimulatedTemperatureSensor/outputs/temperatureOutput INTO BrokeredEndpoint(\"/modules/modbusmodule/inputs/input1\")",
          "testmoduleToIoTHub": "FROM /messages/modules/testmodule/outputs/* INTO $upstream"
        },
        "storeAndForwardConfiguration": {
          "timeToLiveSecs": 7200
        }
      }
    }
  }
}

This is the generated deployment.debug.amd64.json
It seems like the Image url of the modules does not get set correctly.

Does this issue occur when all other extensions are disabled?: Yes

Is this a bug or why is thing happening. Am I missing something else?

@AnOdyssey
Copy link
Author

AnOdyssey commented Dec 14, 2023

So after some debugging and allot of troubleshooting with different project types and old iotedge projects. I have found what was giving the issues.

When generating a new csharp module the following files are missing and need to be added manually.

  1. All the docker files for the module
  2. module.json

Once these files are added in the output file the image will be set correctly and the docker-compose error will stop.

@rido-min
Copy link
Member

Hi @AnOdyssey

Thanks for reporting this issue.

The VSCode IoT Edge extension is in maintenance mode, so new updates to the dotnet template wont be applicable.

If you want to still use this extension it needs to be configured File->Preferences->Settings->IoT Edge configuration->Version Csharpmodule to use 3.2.0

image

or in settings.json

{
   "azure-iot-edge.version.csharpmodule": "3.2.0"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants