- I have an API module running in the linux VM (as Iot Edge EFLOW) which is exposing certain port, let's take 8000. This module is the one which is taking the data and sending it to the other iot edge custom modules for processing before sending it to the iot hub.
- I have created 2 modules, 1 Web API (net6) and 1 CSharpModule(netcoreapp3.1, which comes out of the box when creating using VS Code).
- I deployed both the modules and they ran successfully and i was able to do a curl inside the linux kernel(EFlow kernel) with my REST calls.
e.g
curl -XPOST -H "Content-type: application/json" -d '{ "date":"2022-04-19T11:17:06Z", "temperature":"10", "pressure":"120", "batterylife":"100" }' 'http://localhost:8000/edgesensor'
Now, the problem statement, I would like to call the same endpoint via my windows host and reach that port 8000, which is not happening and I getting a connection refused.
The configurations I have for that API module is as below.
"createOptions": {
"ExposedPorts": {
"8000/tcp": {}
},
"HostConfig": {
"PortBindings": {
"8000/tcp": [
{
"HostPort": "8000"
}
]
}
}
}
I have tried looking at the samples provided, like below github link for EFlow.
https://github.com/Azure/iotedge-eflow
But this sample makes the iot edge act as a device gateway and the console app that is calling it as a child device.
Is this the only way to connect to the EFlow IoT Edge device, that is to make it act as a gateway or can it be called in the manner I am trying to call?
Port forwarding is one such method as well. but is there something in the config that Azure IoT Edge module offers to do this, am I missing something ?
Any inputs appreciated.
Cheers!