Quickstart: Set up the IoT Hub Device Provisioning Service with the Azure portal
These steps show how to set up the Azure cloud resources in the portal for provisioning your devices. This article includes steps for: creating your IoT hub, creating a new IoT Hub Device Provisioning Service, and linking the two services together.
If you don't have an Azure subscription, create a free account before you begin.
Create an IoT hub
This section describes how to create an IoT hub using the Azure portal.
Sign in to the Azure portal.
From the Azure homepage, select the + Create a resource button, and then enter IoT Hub in the Search the Marketplace field.
Select IoT Hub from the search results, and then select Create.
On the Basics tab, complete the fields as follows:
Subscription: Select the subscription to use for your hub.
Resource Group: Select a resource group or create a new one. To create a new one, select Create new and fill in the name you want to use. To use an existing resource group, select that resource group. For more information, see Manage Azure Resource Manager resource groups.
Region: Select the region in which you want your hub to be located. Select the location closest to you.
IoT Hub Name: Enter a name for your hub. This name must be globally unique. If the name you enter is available, a green check mark appears.
Because the IoT hub will be publicly discoverable as a DNS endpoint, be sure to avoid entering any sensitive or personally identifiable information when you name it.
Select Next: Size and scale to continue creating your hub.
This screen allows you to set the following values:
Pricing and scale tier: Your selected tier. You can choose from several tiers, depending on how many features you want and how many messages you send through your solution per day. The free tier is intended for testing and evaluation. It allows 500 devices to be connected to the hub and up to 8,000 messages per day. Each Azure subscription can create one IoT hub in the free tier.
IoT Hub units: The number of messages allowed per unit per day depends on your hub's pricing tier. For example, if you want the hub to support ingress of 700,000 messages, you choose two S1 tier units. For details about the other tier options, see Choosing the right IoT Hub tier.
Advanced Settings > Device-to-cloud partitions: This property relates the device-to-cloud messages to the number of simultaneous readers of the messages. Most hubs need only four partitions.
For this article, accept the default choices, and then select Review + create to review your choices. You see something similar to this screen.
Select Create to create your new hub. Creating the hub takes a few minutes.
Create a new instance for the IoT Hub Device Provisioning Service
Select the + Create a resource button again.
Search the Marketplace for the Device Provisioning Service. Select IoT Hub Device Provisioning Service and hit the Create button.
Provide the following information for your new Device Provisioning Service instance and hit Create.
Name: Provide a unique name for your new Device Provisioning Service instance. If the name you enter is available, a green check mark appears.
Subscription: Choose the subscription that you want to use to create this Device Provisioning Service instance.
Resource group: This field allows you to create a new resource group, or choose an existing one to contain the new instance. Choose the same resource group that contains the Iot hub you created above, for example, TestResources. By putting all related resources in a group together, you can manage them together. For example, deleting the resource group deletes all resources contained in that group. For more information, see Manage Azure Resource Manager resource groups.
Location: Select the closest location to your devices.
Select the notification button to monitor the creation of the resource instance. Once the service is successfully deployed, select Pin to dashboard, and then Go to resource.
Link the IoT hub and your Device Provisioning Service
In this section, you will add a configuration to the Device Provisioning Service instance. This configuration sets the IoT hub for which devices will be provisioned.
Select the All resources button from the left-hand menu of the Azure portal. Select the Device Provisioning Service instance that you created in the preceding section.
From the Device Provisioning Service's menu, select Linked IoT hubs. Hit the + Add button seen at the top.
On the Add link to IoT hub page, provide the following information to link your new Device Provisioning Service instance to an IoT hub. Then hit Save.
Subscription: Select the subscription containing the IoT hub that you want to link with your new Device Provisioning Service instance.
Iot hub: Select the IoT hub to link with your new Device Provisioning Service instance.
Access Policy: Select iothubowner as the credentials for establishing the link with the IoT hub.
Now you should see the selected hub under the Linked IoT hubs blade. You might need to hit Refresh for it to show up.
Clean up resources
Other quickstarts in this collection build upon this quickstart. If you plan to continue on to work with subsequent quickstarts or with the tutorials, do not clean up the resources created in this quickstart. If you do not plan to continue, use the following steps to delete all resources created by this quickstart in the Azure portal.
- From the left-hand menu in the Azure portal, select All resources and then select your Device Provisioning Service. At the top of the device detail pane, select Delete.
- From the left-hand menu in the Azure portal, select All resources and then select your IoT hub. At the top of the hub detail pane, select Delete.
In this quickstart, you’ve deployed an IoT hub and a Device Provisioning Service instance, and linked the two resources. To learn how to use this setup to provision a simulated device, continue to the quickstart for creating a simulated device.