Skip to content Skip to sidebar Skip to footer

Azure Iot Edge Api Module Cannot Be Accessed . Request Timed Out

I'm implementing API on azure IoT edge runtime installed on a Ubuntu hyper-v VM. I have a flask API module implemented and up and running in the edge runtime on Ubuntu vm. So i hav

Solution 1:

For anyone who is struggling to solve such a scenario, you should expose your edge module container running on a guest VM by adding ExposedPorts in createOptions section in deployment.template.json as following. And also IPv4 address of the VM should be used with the relevant port.

        "modules": {
        "test_flask_api": {
        "version": "1.0",
        "type": "docker",
        "status": "running",
        "restartPolicy": "always",
        "settings": {
          "image": "${MODULES.test_flask_api}",
          "createOptions": {
            "ExposedPorts": {
              "5000/tcp": {}
            },
            "HostConfig": {
              "PortBindings": {
                "5000/tcp": [
                  {
                    "HostPort": "5000"
                  }
                ]
              }
            }
          }
        }
      }
    }

Post a Comment for "Azure Iot Edge Api Module Cannot Be Accessed . Request Timed Out"