Identifying the connection string to connect to IOThub

Category: azure iot hub


Stephen-logicsupply on Fri, 02 Feb 2018 20:03:38


I've been working my way through the "Data visualization with Web Apps" tutorial, and I seem to have run into a snag. I am uncertain as to which connection string to use. I tried to follow the directions and get the connection string that is created for my device with the iothub-explorer tool, but that caused the site to give me a 500 error. Could someone explain which connection string I need, and how I should go about generating it?


Jiong Shi on Mon, 05 Feb 2018 01:32:07

Dear Stephen,

Do you mean IoT Hub connection string? 

If you mean this, you can open your Azure Portal( , Login with your username and password.

Then click All-resources->your IotHub->Shared access policies->iothubowner->

Connection string—primary key. You will find the connection string for your IoTHub.

Rita Han on Mon, 05 Feb 2018 05:37:31

Hello Stephen,

You need IoT Hub Connection String and you can find it from device explorer like this:

Or as @Jiong Shi pointed out you can get it from Azure Portal.

I followed "Data visualization with Web Apps" tutorial and saw the see real-time temperature and humidity data like this:

Best regards,


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

Sasindu Kavinda on Mon, 05 Feb 2018 06:21:19

When you log in to your Azure portal, you can find "Shared Access Policies".

From there, you can find the "iothubowner" policy, if you didn't change any configuration when you create the IOT hub in Azure. By clicking the iothubowner, you can find the connection string as per the key you used.

Stephen-logicsupply on Mon, 05 Feb 2018 13:45:12

Thank you very much! The test samples are working now!