I'm interested by getting the public IP address of a connected device on Azure IoT Hub.
I've checked the SDK's but I cannot see any method to get it.
My purpose is to geolocate the device by IP (That's not accurate, but works for me!).
Any clues?
I'm interested by getting the public IP address of a connected device on Azure IoT Hub.
I've checked the SDK's but I cannot see any method to get it.
My purpose is to geolocate the device by IP (That's not accurate, but works for me!).
Any clues?
There seems no such function out-of-box.
A workaround is to save device IP address in device twin and update it when the IP changed.
There is Reported properties in device twin that device app can set and update and the solution backend read and query them.
How to update reported property from device app you can reference this tutorial:
Update:
Another option, it is suggesting to store device location in device twin in cloud. Ref: Understand and use device twin.