How to add IoTHub in Networking port rules of a VM

Satyam Chauhan 607 Reputation points
2022-11-11T09:44:13.01+00:00

I want to add the IoT Hub and Azure Container Registry in the Destination of Outbound port rule of a azure VM where IoT Edge runtime is installed, so that IoT Edge can send data only to specific IoT Hub. I tried by adding the hostname of the IoT Hub but it is not helping. Providing Any in the destination is working but I want the port to be accessible only to IoT Hub.259934-screenshot-145.png

Please let me know if there is a way to achieve this.

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
407 questions
Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
581 questions
.NET Internet of things
.NET Internet of things
.NET: Microsoft Technologies based on the .NET software framework.Internet of things: A concept that aims to extend the benefits of the regular internet, including constant connectivity, remote control ability, and data sharing, to goods in the physical world.
30 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Vishu Tyagi 1 Reputation point
    2022-11-28T09:50:30.08+00:00

    @Satyam Chauhan
    I think you can use the service tags ,AzureIoTHub is servcie tag .
    Below is the list of service tags with ip ranges.
    https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519

    To add a service tag you may need to use azure cli as i believe the azure portal do not support adding service tags.

    az network nsg rule create --resource-group myResourceGroup --nsg-name myNSG --name RDP-rule --priority 300 \
    --destination-address-prefixes '*' --destination-port-ranges "AzureIoTHub " --protocol Tcp --description "Allow RDP"

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.