How to get private IP of the IoT Hub?

António Sérgio Azevedo 7,646 Reputation points Microsoft Employee

Is there any way to get private IP of the IoT Hub?

[Note: As we migrate from MSDN, this question has been posted by an Azure Cloud Engineer as a frequently asked question]

Source: MSDN

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
753 questions
No comments
1 vote

Accepted answer
  1. AshokPeddakotla-MSFT 11,061 Reputation points

    You can use “nslookup” to get the IP address of the IoT Hub.

    Ex: nslookup 

    Note that, once you have created an IoT hub in an Azure region, the IoT hub keeps the same IP address for the lifetime of that IoT hub. However, if Microsoft moves the IoT hub to a different scale unit to maintain quality of service, then it is assigned a new IP address.

    The IP address prefixes of IoT hub are subject to change. These changes are published periodically via service tags before taking effect. It is therefore important that you develop processes to regularly retrieve and use the latest service tags. This process can be automated via the service tags discovery API . Note that Service tags discovery API is still in preview and in some cases may not produce the full list of tags and IP addresses. Until discovery API is generally available, consider using the service tags in downloadable JSON format. 

    Doc Reference: 

    Source: MSDN

    1 person found this answer helpful.
    No comments

1 additional answer

Sort by: Most helpful
  1. Sander van de Velde 16,136 Reputation points MVP

    At this moment, the IoT Hub service tags are not yet available in the CLI, Powershell, or Rest API access. The JSON file download is the solution for now.

    If you want to see how to automate the retrieval of service tags, here it is shown using the REST API:

    1 person found this answer helpful.
    No comments