Linking third party IoT Hub

Jerry 36 Reputation points
2020-09-11T18:30:28.68+00:00

I've been running a DPS service with connected IoT hubs in my account.

How would I link a 3rd party IoT Hub to one of my enrollments so I can register to them?

I tried having the third add me to their IoT Hub resource, but it seems like I wind up having a separate directory that I can't access between them.

Is there a good way to give access to our DPS from their IoT Hub so that we can link to it? And what permissions would that need?

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,128 questions
{count} votes

1 answer

Sort by: Most helpful
  1. QuantumCache 20,031 Reputation points
    2020-09-12T02:52:52.747+00:00

    Hello @Jerry , Thanks for reaching out to us!.

    Using the Azure portal:

    Link the IoT hub and your Device Provisioning Service

    Using Azure CLI : az iot dps linked-hub create

    24232-image.png

    Choosing different subscriptions during linking the IoTHub to DPS.

    24157-image.png

    When creating the Azure IoT Hub DPS resource, you can pass the list of IoT Hubs to link to as part of the properties.

    Example:

    {  
      "location": "East US",   
      "type": "Microsoft.Devices/ProvisioningServices",  
      "properties": {  
         "iotHubs": [  
            {  
              "applyAllocationPolicy": true,  
              "allocationWeight": "1",  
              "connectionString": "HostName=iothub-001.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=xxxxxxxx",  
              "location": "East US"  
            },  
            {  
              "applyAllocationPolicy": true,  
              "allocationWeight": "1",  
              "connectionString": "HostName=iothub-002.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=xxxxxxxx",  
              "location": "East US"  
            }  
          ]  
      }  
    }  
    

    More on this in the documentation of the Azure IoT Hub DPS resource. Ref