none
IoT Hub URI RRS feed

All replies

  • Hello Karthik,

    It depends what resource you are going to access or what operation do you want to do.

    For example, if you want to send device event using REST. The POST request URI is 

    https://fully-qualified-iothubname.azure-devices.net/devices/{id}/messages/events?api-version=2018-06-30


    Azure IoT Hub connection string has the following format:

    HostName=<Host Name>;SharedAccessKeyName=<Key Name>;SharedAccessKey=<SAS Key>

    It can give you some permission to access azure iot hub. Ref "Access control and permissions".

    Please let me know if it helps. If you have any concern feel free let me know.

    Best regards,

    Rita


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, August 14, 2018 9:59 AM
    Moderator
  • Hello Karthik,

    If you are talking about connecting to azure iot hub using sdks. You can either use connection string or host name and device authentication information.

    Using connection string:

                    string DeviceConnectionString = "HostName=[YOUR HUB NAME].azure-devices.net;DeviceId=device1;SharedAccessKey=[KEY VALUE]";
                    DeviceClient deviceClient = DeviceClient.CreateFromConnectionString(DeviceConnectionString, TransportType.Mqtt);


    Using host name and device authentication information:

                    string iothubHostname = "[YOUR HUB NAME].azure-devices.net";
                    string deviceId = "device1";
                    string deviceKey = "[KEY VALUE]";
                    DeviceClient deviceClient = DeviceClient.Create(iothubHostname, new DeviceAuthenticationWithRegistrySymmetricKey(deviceId, deviceKey));

    Note: Azure IoT Hub connection string and device connection string are different.

    Best regards,

    Rita

     

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, August 15, 2018 8:06 AM
    Moderator