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.
Choose Create a resource, 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
Click the Create a resource button found on the upper left-hand corner of the Azure portal.
Search the Marketplace for the Device provisioning service. Select IoT Hub Device Provisioning Service and click the Create button.
Provide the following information for your new Device Provisioning service instance and click 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.
Click the notification button to monitor the creation of the resource instance. Once the service is successfully deployed, click 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.
Click 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.
On the Device Provisioning Service summary blade, select Linked IoT hubs. Click 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 click 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 click Refresh to show Linked IoT hubs.
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, click All resources and then select your Device Provisioning service. At the top of the All resources blade, click Delete.
- From the left-hand menu in the Azure portal, click All resources and then select your IoT hub. At the top of the All resources blade, click 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 set up to provision a simulated device, continue to the Quickstart for creating simulated device.