Skip to content

Commit faada0e

Browse files
author
Olivier Bloch
committed
Updated IoT Hub setup instructions
1 parent d6cc553 commit faada0e

6 files changed

+89
-59
lines changed

media/create-iot-hub1.png

-37.5 KB
Binary file not shown.

media/create-iot-hub2.png

-38.7 KB
Binary file not shown.

media/create-iot-hub3.png

-10.3 KB
Binary file not shown.

media/create-iot-hub4.png

-74.3 KB
Binary file not shown.

media/create-iot-hub5.png

-62.4 KB
Binary file not shown.

setup_iothub.md

+89-59
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,90 @@
1-
# Set up IoT Hub
2-
3-
[Azure IoT Hub][iothub-landing] is a fully managed service that enables reliable and secure bi-directional communications between millions of IoT devices and an application back end. Azure IoT Hub offers reliable device-to-cloud and cloud-to-device hyper-scale messaging, enables secure communications using per-device security credentials and access control, and includes device libraries for the most popular languages and platforms.
4-
5-
Before you can communicate with IoT Hub from a device you must create an IoT hub instance in your Azure subscription and then provision your device in your IoT hub. You must complete these steps before you try to run any of the sample IoT Hub device client applications in this repository ([azure-iot-sdks](https://github.com/Azure/azure-iot-sdks)).
6-
7-
## Create an IoT hub
8-
9-
You can use the [Azure Portal][azure-portal] to create an IoT hub to use with your devices.
10-
11-
1. Log on to the [Azure Portal][azure-portal].
12-
13-
2. In the jumpbar, click **New**, then click **Internet of Things**, and then click **Azure IoT Hub**.
14-
15-
![][1]
16-
17-
3. In the **New IoT Hub** blade, specify the desired configuration for the IoT Hub.
18-
19-
![][2]
20-
21-
* In the **Name** box, enter a name to identify your IoT hub. When the **Name** is validated, a green check mark appears in the **Name** box.
22-
* Change the **Pricing and scale tier** as desired. The getting started samples do not require a specific tier.
23-
* In the **Resource group** box, create a new resource group, or select and existing one. For more information, see [Using resource groups to manage your Azure resources][resource-group-portal].
24-
* Use **Location** to specify the geographic location in which to host your IoT hub.
25-
26-
27-
4. Once the new IoT hub options are configured, click **Create**. It can take a few minutes for the IoT hub to be created. To check the status, you can monitor the progress on the Startboard. Or, you can monitor your progress from the Notifications section.
28-
29-
![][3]
30-
31-
32-
5. After the IoT hub has been created successfully, open the blade of the new IoT hub, take note of the hostname URI, and click **Shared access policies**.
33-
34-
![][4]
35-
36-
6. Select the Shared access policy called **iothubowner**, then copy and take note of the connection string on the right blade.
37-
38-
![][5]
39-
40-
Your IoT hub is now created, and you have the connection string you need to use the [iothub-explorer or the Device Explorer][lnk-manage-iothub] tool. This connection string enables applications to perform management operations on the IoT hub such as adding a new device to the IoT hub.
41-
42-
43-
## Add devices to IoT Hub
44-
45-
You must add details your device to IoT Hub before that device can communicate with the hub. When you add a device to an IoT hub, the hub generates the connection string that the device must use when it establishes the secure connection to the IoT hub.
46-
47-
To add a device to your IoT hub, you can use the [iothub-explorer or the Device Explorer][lnk-manage-iothub] utility in this repository ([azure-iot-sdks](https://github.com/Azure/azure-iot-sdks)). These tools will generate a device specific connection string that you need to copy and paste in the source code of the application running on the device.
48-
49-
50-
[iothub-landing]: http://azure.microsoft.com/documentation/services/iot-hub/
1+
# Set up and manage Azure IoT Hub
2+
3+
Azure IoT Hub is a fully managed service that enables reliable and secure bi-directional communications between millions of IoT devices and an application back end. You can learn more about Azure IoT Hub visiting the [documentation site][iothub-landing].
4+
5+
Before you can communicate with IoT Hub from a device you must **create an IoT hub instance** in your Azure subscription and then **provision your device in your IoT hub**.
6+
7+
Because of developers preferences and constrains, there are several ways you can create an instance of Azure IoT Hub service and manage this instance. Below are links to resources that will walk you through the steps required to setup an IoT hub and manage it.
8+
9+
## Create an Azure IoT hub...
10+
* ... [using the Azure portal]
11+
* ... [using the Azure CLI 2.0] (Python command line)
12+
* ... [using the Azure CLI 1.0] (Node.js command line)
13+
* ... [using PowerShell and a resource manager template]
14+
* ... [using C# and a resource manager template]
15+
* ... [using C# and the resource provider REST APIs]
16+
17+
18+
## Manage an Azure IoT hub
19+
Once you have an Azure IoT hub instance deployed, you will need to manage and interact with it to perform the following operations:
20+
* Work with the device registry (Create, Update, Delete device IDs)
21+
* Retrieve device credentials
22+
* Retrieve user credentials
23+
* Send Cloud to Device messages to devices
24+
* Work with Device Twins
25+
* Invoke Device Direct Methods
26+
* Monitor operations of the service
27+
28+
There is some of this interaction that can happen through the [Azure portal], but most of the interaction will happen through tools and leveraging the various service client SDKs.
29+
30+
### Retrieving user credentials to interact with the service (not as a device!)
31+
The first thing you will need to do before you can use a tool or start developing an application that will interact with the IoT hub using one of the service client SDKs is to retrieve user credentials.
32+
33+
> It is important to understand the different between user credentials and device credentials:
34+
> * The device credentials are managed by the [IoT Hub identity registry](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-identity-registry) and are to be used by code on **devices**
35+
> * The user credentials are set at the IoT Hub settings level and allow to define user access policies for applications that will **manage** the IoT hub.
36+
> Details on Control access to IoT Hub cabn be found [here](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-security).
37+
38+
You will need to get user credentials with the right permissions to interact with the identity registry, to send C2D messages, and to work with the Device Twins and Methods.
39+
The user credentials can easily be found on the [Azure portal] in the "Shared Access Policies" section of the [IoT hub settings blade](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-create-through-portal#change-the-settings-of-the-iot-hub).
40+
Now you have the credentials, you can create
41+
42+
### Create new device in the IoT Hub device identity registry...
43+
* ... using [iothub-explorer] (node.js command line tool)
44+
* ... using [Device Explorer] (Windows desktop application)
45+
* ... using the service client SDK ...
46+
* ... [for C#]
47+
* ... [for Node.js]
48+
* ... [for java]
49+
* ... [for Python]
50+
* ... [using Azure CLI v2.0] (Python command line tool)
51+
52+
### Monitor IoT Hub operations
53+
There is a way to monitor an Azure IoT hub operations as all of these are logged into an Event Hub. This can help debug applications developed to interact and manage an IoT hub.
54+
Every you need to know about IoT Hub operations monitoring is [here][azure iot operations monitoring].
55+
56+
### Work and interact with Devices using the tools and SDKs
57+
Once you have a device ID, you can provision your device with it and start interacting with it from the Cloud through IoT Hub.
58+
59+
When developing, you can leverage some tools that will make your life easier. The below will allow you to do pretty much eveything you need to do when developing and testing IoT devices connecting to Azure IoT:
60+
* [iothub-explorer] (node.js command line tool)
61+
* [Device Explorer] (Windows desktop application)
62+
63+
To build applications to manage the IoT hub and interact with devices from the Cloud, you can leverage one of our service client SDKs:
64+
* [Azure IoT service client SDK for C#]
65+
* [Azure IoT service client SDK for Node.js]
66+
* [Azure IoT service client SDK for Java]
67+
* [Azure IoT service client SDK for Python]
68+
69+
70+
[iothub-landing]: https://docs.microsoft.com/en-us/azure/iot-hub
71+
[Azure portal]: https://portal.azure.com
72+
[using the Azure portal]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-create-through-portal
73+
[using the Azure CLI 2.0]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-create-using-cli
74+
[using the Azure CLI 1.0]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-create-using-cli-nodejs
75+
[using C# and a resource manager template]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-rm-template
76+
[using PowerShell and a resource manager template]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-rm-template-powershell
77+
[using C# and the resource provider REST APIs]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-rm-rest
5178
[azure-portal]: https://portal.azure.com
52-
[manage-iothub-portal]: http://azure.microsoft.com/documentation/articles/iot-hub-manage-portal/
53-
[lnk-manage-iothub]: manage_iot_hub.md
54-
[resource-group-portal]: https://azure.microsoft.com/documentation/articles/resource-group-portal/
55-
56-
[1]: media/create-iot-hub1.png
57-
[2]: media/create-iot-hub2.png
58-
[3]: media/create-iot-hub3.png
59-
[4]: media/create-iot-hub4.png
60-
[5]: media/create-iot-hub5.png
79+
[azure iot operations monitoring]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-operations-monitoring
80+
[iothub-explorer]: https://github.com/Azure/iothub-explorer
81+
[Device Explorer]: https://github.com/Azure/azure-iot-sdk-csharp/tree/master/tools/DeviceExplorer
82+
[for C#]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-csharp-csharp-getstarted#create-a-device-identity
83+
[for Node.js]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-node-node-getstarted#create-a-device-identity
84+
[for java]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-java-java-getstarted#create-a-device-identity
85+
[for Python]: https://github.com/Azure/azure-iot-sdk-python/tree/master/service/samples
86+
[using Azure CLI v2.0]: https://docs.microsoft.com/en-us/cli/azure/iot/device#create
87+
[Azure IoT service client SDK for C#]: https://github.com/Azure/azure-iot-sdk-csharp/tree/master/service
88+
[Azure IoT service client SDK for Node.js]: https://github.com/azure/azure-iot-sdk-node/tree/master/service
89+
[Azure IoT service client SDK for Java]: https://github.com/azure/azure-iot-sdk-java/tree/master/service
90+
[Azure IoT service client SDK for Python]: https://github.com/azure/azure-iot-sdk-python/tree/master/service

0 commit comments

Comments
 (0)