IoT Hub network Address
We are looking at ways to restrict access on data simcards to only be able to access and send data to IoT Hub however we can't identify the IP addresses of our IoT Hub. Is there anyway to find this?
As a workaround, the IoT Hub IP address can be discovered by using a reverse DNS lookup on the cname (*.azure-devices.net). However, the IP mapped is subject to change without notice. This also doesn’t help discover the geo-paired Hub IP address, that would be needed in case of a failover/disaster recovery.
Something we’re considering is to add a new API which would return the current IP address for an IoT Hub + the geo-paired IP address. This API could be queried frequently to keep firewall rules up-to-date. Please comment and vote on the potential usefulness of this proposed feature.
John Lian commented
To folks finding this now: we published a doc on this subject https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-understand-ip-address
Hariharan Anantharaman commented
I would like to know if this has been completed. We have a similar requirement.
You can always do an nslookup on the iothub DNS e.g. nslookup acme.azure-devices.net to figure out the IP address. However this address is not guaranteed to stay the same (e.g. in disaster recovery scenarios where service fails over to a different region potentially).