Skip to content

Commit 0a5fd4c

Browse files
committed
added images
1 parent 08b002f commit 0a5fd4c

File tree

5 files changed

+49
-45
lines changed

5 files changed

+49
-45
lines changed

articles/iot-dps/how-to-provision-multitenant.md

Lines changed: 49 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
---
22
title: How to provision devices for multitenancy in Azure IoT Hub Device Provisioning Service
33
description: How to provision devices for multitenancy with your Device Provisioning Service (DPS) instance
4-
author: wesmc7777
5-
ms.author: wesmc
6-
ms.date: 04/10/2019
4+
author: anastasia-ms
5+
ms.author: v-stharr
6+
ms.date: 10/05/2021
77
ms.topic: conceptual
88
ms.service: iot-dps
99
services: iot-dps
1010
---
1111

12-
1312
# How to provision for multitenancy
1413

15-
This article demonstrates how to securely provision multiple simulated symmetric key devices to a group of IoT Hubs using an [allocation policy](concepts-service.md#allocation-policy). Allocation policies defined by the provisioning service support a variety of allocation scenarios. Two common scenarios are:
14+
This article demonstrates how to securely provision multiple simulated symmetric key devices to a group of IoT Hubs using an [allocation policy](concepts-service.md#allocation-policy). Allocation policies that are defined by the provisioning service support a variety of allocation scenarios. Two common scenarios are:
1615

17-
* **Geolocation / GeoLatency**: As a device moves between locations, network latency is improved by having the device provisioned to the IoT hub closest to each location. In this scenario, a group of IoT hubs, which span across regions, are selected for enrollments. The **Lowest latency** allocation policy is selected for these enrollments. This policy causes the Device Provisioning Service to evaluate device latency and determine the closet IoT hub out of the group of IoT hubs.
16+
* **Geolocation / GeoLatency**: As a device moves between locations, network latency is improved by having the device provisioned to the IoT hub that's closest to each location. In this scenario, a group of IoT hubs, which span across regions, are selected for enrollments. The **Lowest latency** allocation policy is selected for these enrollments. This policy causes the Device Provisioning Service to evaluate device latency and determine the closet IoT hub out of the group of IoT hubs.
1817

1918
* **Multi-tenancy**: Devices used within an IoT solution may need to be assigned to a specific IoT hub or group of IoT hubs. The solution may require all devices for a particular tenant to communicate with a specific group of IoT hubs. In some cases, a tenant may own IoT hubs and require devices to be assigned to their IoT hubs.
2019

@@ -29,101 +28,104 @@ This article uses a simulated device sample from the [Azure IoT C SDK](https://g
2928
> * Set up the development environment for the Azure IoT C SDK on both Linux VMs
3029
> * Simulate the devices to see that they are provisioned for the same tenant in the closest region.
3130
31+
## Prerequisites
3232

33-
[!INCLUDE [quickstarts-free-trial-note](../../includes/quickstarts-free-trial-note.md)]
34-
33+
* If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio) before you begin.
3534

36-
## Prerequisites
35+
* Complete the steps in [Set up IoT Hub Device Provisioning Service with the Azure portal](./quick-setup-auto-provision.md).
3736

38-
- Completion of the [Set up IoT Hub Device Provisioning Service with the Azure portal](./quick-setup-auto-provision.md) quickstart.
3937
[!INCLUDE [azure-cli-prepare-your-environment-no-header.md](../../includes/azure-cli-prepare-your-environment-no-header.md)]
4038

4139
## Create two regional IoT hubs
4240

43-
In this section, you will use the Azure Cloud Shell to create two new regional IoT hubs in the **West US** and **East US** regions for a tenant.
41+
In this section, you'll create an Azure resource group, and two new regional IoT hub resources for a tenant. One IoT hub will be for the **West US** region and the other is will be for the **East US** regions.
4442

43+
>[!IMPORTANT]
44+
>It is recommended that you use the same resource group for all resources created in this article. This will make clean up easier after you are finished.
4545
46-
1. Use the Azure Cloud Shell to create a resource group with the [az group create](/cli/azure/group#az_group_create) command. An Azure resource group is a logical container into which Azure resources are deployed and managed.
47-
48-
The following example creates a resource group named *contoso-us-resource-group* in the *eastus* region. It is recommended that you use this group for all resources created in this article. This will make clean up easier after you are finished.
46+
1. In the Azure Cloud Shell, create a resource group with the following [az group create](/cli/azure/group#az_group_create) command:
4947

5048
```azurecli-interactive
5149
az group create --name contoso-us-resource-group --location eastus
5250
```
5351
54-
2. Use the Azure Cloud Shell to create an IoT hub in the **eastus** region with the [az iot hub create](/cli/azure/iot/hub#az_iot_hub_create) command. The IoT hub will be added to the *contoso-us-resource-group*.
55-
56-
The following example creates an IoT hub named *contoso-east-hub* in the *eastus* location. You must use your own unique hub name instead of **contoso-east-hub**.
52+
2. Create an IoT hub in the *eastus* location and add it to the resource group you created with the following [az iot hub create](/cli/azure/iot/hub#az_iot_hub_create) command(replace `{unique-hub-name}` with your own unique name):
5753
5854
```azurecli-interactive
59-
az iot hub create --name contoso-east-hub --resource-group contoso-us-resource-group --location eastus --sku S1
55+
az iot hub create --name {unique-hub-name} --resource-group contoso-us-resource-group --location eastus --sku S1
6056
```
61-
62-
This command may take a few minutes to complete.
6357
64-
3. Use the Azure Cloud Shell to create an IoT hub in the **westus** region with the [az iot hub create](/cli/azure/iot/hub#az_iot_hub_create) command. This IoT hub will also be added to the *contoso-us-resource-group*.
58+
This command may take a few minutes to complete.
6559
66-
The following example creates an IoT hub named *contoso-west-hub* in the *westus* location. You must use your own unique hub name instead of **contoso-west-hub**.
60+
3. Finally, create an IoT hub in the *westus* location add it to the resource group you created with the following [az iot hub create](/cli/azure/iot/hub#az_iot_hub_create) command(replace `{unique-hub-name}` with your own unique name):
6761
6862
```azurecli-interactive
69-
az iot hub create --name contoso-west-hub --resource-group contoso-us-resource-group --location westus --sku S1
63+
az iot hub create --name {unique-hub-name} --resource-group contoso-us-resource-group --location westus --sku S1
7064
```
7165
7266
This command may take a few minutes to complete.
7367
74-
75-
7668
## Create the multitenant enrollment
7769
78-
In this section, you will create a new enrollment group for the tenant devices.
70+
In this section, you'll create a new enrollment group for the tenant devices.
7971
8072
For simplicity, this article uses [Symmetric key attestation](concepts-symmetric-key-attestation.md) with the enrollment. For a more secure solution, consider using [X.509 certificate attestation](concepts-x509-attestation.md) with a chain of trust.
8173
82-
1. Sign in to the [Azure portal](https://portal.azure.com), and open your Device Provisioning Service instance.
74+
1. In the Azure portal, select your Device Provisioning Service.
8375
84-
2. Select the **Manage enrollments** tab, and then click the **Add enrollment group** button at the top of the page.
76+
2. In the **Settings** menu, select **Manage enrollments**.
8577
86-
3. On **Add Enrollment Group**, enter the following information, and click the **Save** button.
78+
3. Select **+ Add enrollment group**.
8779
88-
**Group name**: Enter **contoso-us-devices**.
80+
4. On the **Add Enrollment Group** page, enter the following information:
8981
90-
**Attestation Type**: Select **Symmetric Key**.
82+
**Group name**: Enter *contoso-us-devices*.
83+
84+
**Attestation Type**: Select *Symmetric Key*.
9185
9286
**Auto Generate Keys**: This checkbox should already be checked.
9387
94-
**Select how you want to assign devices to hubs**: Select **Lowest latency**.
88+
**Select how you want to assign devices to hubs**: Select *Lowest latency*.
9589
96-
![Add multitenant enrollment group for symmetric key attestation](./media/how-to-provision-multitenant/create-multitenant-enrollment.png)
90+
5. Select **Link a new IoT Hub**
9791
92+
:::image type="content" source="./media/how-to-provision-multitenant/create-multitenant-enrollment.png" alt-text="Add multitenant enrollment group for symmetric key attestation.":::
9893
99-
4. On **Add Enrollment Group**, click **Link a new IoT hub** to link both of your regional hubs.
94+
6. On the **Add link to IoT hub** page, enter the following information:
10095
10196
**Subscription**: If you have multiple subscriptions, choose the subscription where you created the regional IoT hubs.
10297
103-
**IoT hub**: Select one of the regional hubs you created.
98+
**IoT hub**: Select the IoT hub that you created for the *eastus* location.
99+
100+
**Access Policy**: Select *iothubowner*.
101+
102+
:::image type="content" source="./media/how-to-provision-multitenant/link-regional-hubs.png" alt-text="Link the regional IoT hubs with the provisioning service.":::
104103
105-
**Access Policy**: Choose **iothubowner**.
104+
7. Select **Save**.
106105
107-
![Link the regional IoT hubs with the provisioning service](./media/how-to-provision-multitenant/link-regional-hubs.png)
106+
8. Repeat Steps 5 through 7 for the second IoT hub that you created for the *westgus* location.
108107
108+
9. Select the two IoT Hubs you created in the **Select the IoT hubs this group c an be assigned to** drop down.
109109
110-
5. Once both regional IoT hubs have been linked, you must select them for the enrollment group and click **Save** to create the regional IoT hub group for the enrollment.
110+
:::image type="content" source="./media/how-to-provision-multitenant/enrollment-regional-hub-group.png" alt-text="Select the linked IoT hubs.":::
111111
112-
![Create the regional hub group for the enrollment](./media/how-to-provision-multitenant/enrollment-regional-hub-group.png)
112+
10. Select **Save**
113113
114+
11. Select *contoso-us-devices* in the enrollment groups list.
114115
115-
6. After saving the enrollment, reopen it and make a note of the **Primary Key**. You must save the enrollment first to have the keys generated. This key will be used to generate unique device keys for both simulated devices later.
116+
12. Copy the *Primary Key*. This key will be used later to generate unique device keys for both simulated devices.
116117
118+
:::image type="content" source="./media/how-to-provision-multitenant/copy-primary-key.png" alt-text="Copy the primary key.":::
117119
118120
## Create regional Linux VMs
119121
120-
In this section, you will create two regional Linux virtual machines (VMs). These VMs will run a device simulation sample from each region to demonstrate device provisioning for tenant devices from both regions.
122+
In this section, you'll create two regional Linux virtual machines (VMs). These VMs will run a device simulation sample from each region to demonstrate device provisioning for tenant devices from both regions.
121123
122124
To make clean-up easier, these VMs will be added to the same resource group that contains the IoT hubs that were created, *contoso-us-resource-group*. However, the VMs will run in separate regions (**West US** and **East US**).
123125
124-
1. In the Azure Cloud Shell, execute the following command to create an **East US** region VM after making the following parameter changes in the command:
126+
1. In the Azure Cloud Shell, run the following command to create an **East US** region VM after making the following parameter changes in the command:
125127
126-
**--name**: Enter a unique name for your **East US** regional device VM.
128+
**--name**: Enter a unique name for your **East US** regional device VM.
127129
128130
**--admin-username**: Use your own admin user name.
129131
@@ -138,11 +140,12 @@ To make clean-up easier, these VMs will be added to the same resource group that
138140
--admin-username contosoadmin \
139141
--admin-password myContosoPassword2018 \
140142
--authentication-type password
143+
--public-ip-sku Standard
141144
```
142145
143146
This command will take a few minutes to complete. Once the command has completed, make a note of the **publicIpAddress** value for your East US region VM.
144147
145-
1. In the Azure Cloud Shell, execute the command to create a **West US** region VM after making the following parameter changes in the command:
148+
2. In the Azure Cloud Shell, execute the command to create a **West US** region VM after making the following parameter changes in the command:
146149
147150
**--name**: Enter a unique name for your **West US** regional device VM.
148151
@@ -159,11 +162,12 @@ To make clean-up easier, these VMs will be added to the same resource group that
159162
--admin-username contosoadmin \
160163
--admin-password myContosoPassword2018 \
161164
--authentication-type password
165+
--public-ip-sku Standard
162166
```
163167
164168
This command will take a few minutes to complete. Once the command has completed, make a note of the **publicIpAddress** value for your West US region VM.
165169
166-
1. Open two command-line shells. Connect to one of the regional VMs in each shell using SSH.
170+
3. Open two command-line shells. Connect to one of the regional VMs in each shell using SSH.
167171
168172
Pass your admin username, and the public IP address you noted for the VM as parameters to SSH. Enter the admin password when prompted.
169173
37 KB
Loading
-8.46 KB
Loading
-24.7 KB
Loading
-10.4 KB
Loading

0 commit comments

Comments
 (0)