|
1 | 1 | ---
|
2 |
| -title: Configure Access Control in Device Update for IoT Hub |
3 |
| -description: Configure Access Control in Device Update for IoT Hub. |
| 2 | +title: Configure access control for Azure Device Update for IoT Hub |
| 3 | +description: Learn how to configure access control for the Azure Device Update for IoT Hub account and service principal. |
4 | 4 | author: eshashah-msft
|
5 | 5 | ms.author: eshashah
|
6 |
| -ms.date: 10/31/2022 |
| 6 | +ms.date: 12/30/2024 |
7 | 7 | ms.topic: how-to
|
8 | 8 | ms.service: azure-iot-hub
|
9 | 9 | ms.subservice: device-update
|
10 | 10 | ---
|
11 | 11 |
|
12 |
| -# Configure access control roles for Device Update resources |
| 12 | +# Configure access control for Device Update resources |
13 | 13 |
|
14 |
| -In order for users to have access to Device Update, they must be granted access to the Device Update account, Instance and set the required access to the linked IoT hub. |
| 14 | +For users to access Azure Device Update for IoT Hub, you must grant them access to the Device Update account and instance. You must also grant the Device Update service principal access to the linked IoT hub so it can manage updates and gather information. This article describes how to grant the necessary access by using Azure role-based access control (RBAC) in the Azure portal or Azure CLI. |
| 15 | + |
| 16 | +## Prerequisites |
| 17 | + |
| 18 | +- **Owner** or **User Access Administrator** role in your Azure subscription. |
| 19 | +- A [Device Update account and instance configured with an IoT hub](create-device-update-account.md). |
| 20 | +- To run Azure CLI commands, the Bash environment in [Azure Cloud Shell](/azure/cloud-shell/quickstart) or [Azure CLI installed locally](/cli/azure/install-azure-cli). |
15 | 21 |
|
16 | 22 | ## Configure access control for Device Update account
|
17 | 23 |
|
18 |
| -# [Azure portal](#tab/portal) |
| 24 | +The following roles are available for assigning access to Device Update: |
19 | 25 |
|
20 |
| -1. In your Device Update account, select **Access control (IAM)** from the navigation menu. |
| 26 | +- Device Update Administrator |
| 27 | +- Device Update Reader |
| 28 | +- Device Update Content Administrator |
| 29 | +- Device Update Content Reader |
| 30 | +- Device Update Deployments Administrator |
| 31 | +- Device Update Deployments Reader |
21 | 32 |
|
22 |
| - :::image type="content" source="media/create-device-update-account/account-access-control.png" alt-text="Screenshot of access Control within Device Update account." lightbox="media/create-device-update-account/account-access-control.png"::: |
| 33 | +For more information, see [Azure role-based access control (RBAC) and Device Update](device-update-control-access.md). |
23 | 34 |
|
24 |
| -2. Select **Add role assignments**. |
| 35 | +# [Azure portal](#tab/portal) |
25 | 36 |
|
26 |
| -3. On the **Role** tab, select a Device Update role from the available options: |
| 37 | +1. In your Device Update account in the Azure portal, select **Access control (IAM)** from the navigation menu, and then select **Add role assignment**. |
27 | 38 |
|
28 |
| - * Device Update Administrator |
29 |
| - * Device Update Reader |
30 |
| - * Device Update Content Administrator |
31 |
| - * Device Update Content Reader |
32 |
| - * Device Update Deployments Administrator |
33 |
| - * Device Update Deployments Reader |
| 39 | + :::image type="content" source="media/create-device-update-account/account-access-control.png" alt-text="Screenshot of access Control within Device Update account." lightbox="media/create-device-update-account/account-access-control.png"::: |
34 | 40 |
|
35 |
| - For more information, [Learn about Role-based access control in Device Update for IoT Hub](device-update-control-access.md). |
| 41 | +1. On the **Role** tab, select a Device Update role from the available options, and then select **Next**. |
36 | 42 |
|
37 | 43 | :::image type="content" source="media/create-device-update-account/role-assignment.png" alt-text="Screenshot of access Control role assignments within Device Update account." lightbox="media/create-device-update-account/role-assignment.png":::
|
38 | 44 |
|
39 |
| -4. Select **Next** |
40 |
| -5. On the **Members** tab, select the users or groups that you want to assign the role to. |
| 45 | +1. On the **Members** tab, select **Select members**, and add the users or groups that you want to assign the role to. |
41 | 46 |
|
42 | 47 | :::image type="content" source="media/create-device-update-account/role-assignment-2.png" alt-text="Screenshot of access Control member selection within Device Update account." lightbox="media/create-device-update-account/role-assignment-2.png":::
|
43 | 48 |
|
44 |
| -6. Select **Review + assign** |
45 |
| -7. Review the new role assignments and select **Review + assign** again |
46 |
| -8. You're now ready to use Device Update from within your IoT Hub |
| 49 | +1. Select **Review + assign**. |
| 50 | +1. Review the new role assignments and select **Review + assign** again. |
| 51 | +1. Azure RBAC adds the role assignments, and the selected members can now use Device Update from within your IoT Hub. |
47 | 52 |
|
48 | 53 | # [Azure CLI](#tab/cli)
|
49 | 54 |
|
50 |
| -The following roles are available for assigning access to Device Update: |
51 |
| - |
52 |
| -* Device Update Administrator |
53 |
| -* Device Update Reader |
54 |
| -* Device Update Content Administrator |
55 |
| -* Device Update Content Reader |
56 |
| -* Device Update Deployments Administrator |
57 |
| -* Device Update Deployments Reader |
58 |
| - |
59 |
| -For more information, [Learn about Role-based access control in Device Update for IoT Hub](device-update-control-access.md). |
60 |
| - |
61 |
| -Use the [az role assignment create](/cli/azure/role/assignment#az-role-assignment-create) command to configure access control for your Device Update account. |
62 |
| - |
63 |
| -Replace the following placeholders with your own information: |
| 55 | +Use the [az role assignment create](/cli/azure/role/assignment#az-role-assignment-create) command to configure access control for your Device Update account. In the command, replace the following placeholders with your own information: |
64 | 56 |
|
65 |
| -* *\<role>*: The Device Update role that you're assigning. |
66 |
| -* *\<user_group>*: The user or group that you want to assign the role to. |
67 |
| -* *\<account_id>*: The resource ID for the Device Update account that the user or group will get access to. You can retrieve the resource ID by using the [az iot du account show](/cli/azure/iot/du/account#az-iot-du-account-show) command and querying for the ID value: `az iot du account show -n <account_name> --query id`. |
| 57 | +- `<role>`: The Device Update role you're assigning. |
| 58 | +- `<user_or_group`: The user or group you want to assign the role to. |
| 59 | +- `<account_id>`: The resource ID for the Device Update account to grant access to. You can get the resource ID by using [az iot du account show](/cli/azure/iot/du/account#az-iot-du-account-show) and querying for the ID value with `az iot du account show -n <account_name> --query id`. |
68 | 60 |
|
69 | 61 | ```azurecli-interactive
|
70 |
| -az role assignment create --role '<role>' --assignee <user_group> --scope <account_id> |
| 62 | +az role assignment create --role '<role>' --assignee <user_or_group> --scope <account_id> |
71 | 63 | ```
|
72 | 64 | ---
|
73 | 65 |
|
74 |
| -## Configure access for Azure Device Update service principal in linked IoT hub |
| 66 | +<a name="configure-access-for-azure-device-update-service-principal-in-linked-iot-hub"></a> |
| 67 | +## Configure IoT hub access for the Device Update service principal |
75 | 68 |
|
76 |
| -Device Update for IoT Hub communicates with IoT Hub to manage deployments and updates and to get information about devices. To enable the access, you need to give the **Azure Device Update** service principal access with the **IoT Hub Data Contributor** role. |
| 69 | +Device Update communicates with IoT Hub to manage deployments and updates and to get information about devices. To enable this communication, you need to give the Azure Device Update service principal access to the IoT hub with the **IoT Hub Data Contributor** role. |
77 | 70 |
|
78 | 71 | # [Azure portal](#tab/portal)
|
79 | 72 |
|
80 |
| -1. In the Azure portal, navigate to the IoT hub connected to your Device Update instance. |
| 73 | +1. In your Device Update instance in the Azure portal, select the IoT hub connected to the instance. |
81 | 74 |
|
82 | 75 | :::image type="content" source="media/create-device-update-account/navigate-to-iot-hub.png" alt-text="Screenshot of instance and linked IoT hub." lightbox="media/create-device-update-account/navigate-to-iot-hub.png":::
|
83 | 76 |
|
84 |
| -1. Select **Access Control(IAM)** from the navigation menu. Select **Add** > **Add role assignment**. |
| 77 | +1. On the IoT hub page, select **Access Control (IAM)** from the left navigation menu. |
| 78 | + |
| 79 | +1. Select **Add** > **Add role assignment**. |
85 | 80 |
|
86 |
| - :::image type="content" source="media/create-device-update-account/iot-hub-access-control.png" alt-text="Screenshot of access Control within IoT Hub." lightbox="media/create-device-update-account/iot-hub-access-control.png"::: |
| 81 | + :::image type="content" source="media/create-device-update-account/iot-hub-access-control.png" alt-text="Screenshot of access control within IoT Hub." lightbox="media/create-device-update-account/iot-hub-access-control.png"::: |
87 | 82 |
|
88 |
| -3. In the **Role** tab, select **IoT Hub Data Contributor**. Select **Next**. |
| 83 | +1. On the **Role** tab, select **IoT Hub Data Contributor**, and then select **Next**. |
89 | 84 |
|
90 |
| - :::image type="content" source="media/create-device-update-account/role-assignment-iot-hub.png" alt-text="Screenshot of access Control role assignment within IoT Hub." lightbox="media/create-device-update-account/role-assignment-iot-hub.png":::** |
| 85 | + :::image type="content" source="media/create-device-update-account/role-assignment-iot-hub.png" alt-text="Screenshot of access control role assignment within IoT Hub." lightbox="media/create-device-update-account/role-assignment-iot-hub.png"::: |
91 | 86 |
|
92 |
| -4. For **Assign access to**, select **User, group, or service principal**. Select **Select Members** and search for '**Azure Device Update**' |
| 87 | +1. On the **Members** tab, select **User, group, or service principal** for **Assign access to**, and then select **Select members**. |
| 88 | + |
| 89 | +1. On the **Select members** screen, search for and select **Azure Device Update**, and then select **Select**. |
93 | 90 |
|
94 | 91 | :::image type="content" source="media/create-device-update-account/assign-role-to-du-service-principal.png" alt-text="Screenshot of access Control member selection for IoT Hub." lightbox="media/create-device-update-account/assign-role-to-du-service-principal.png":::
|
95 | 92 |
|
96 |
| -6. Select **Next** > **Review + Assign** |
| 93 | +6. Select **Review + assign** and then select **Review + assign** again. |
97 | 94 |
|
98 |
| -To validate that you've set permissions correctly: |
| 95 | +To validate that you set permissions correctly: |
99 | 96 |
|
100 | 97 | 1. In the Azure portal, navigate to the IoT hub connected to your Device Update instance.
|
101 |
| -1. Select **Access Control(IAM)** from the navigation menu. |
| 98 | +1. Select **Access Control (IAM)** from the left navigation menu. |
102 | 99 | 1. Select **Check access**.
|
103 |
| -1. Select **User, group, or service principal** and search for '**Azure Device Update**' |
104 |
| -1. After clicking on **Azure Device Update**, verify that the **IoT Hub Data Contributor** role is listed under **Role assignments** |
| 100 | +1. Select **User, group, or service principal**, and search for and select **Azure Device Update**. |
| 101 | +1. Verify that the **IoT Hub Data Contributor** role is listed under **Role assignments**. |
105 | 102 |
|
106 | 103 | # [Azure CLI](#tab/cli)
|
107 | 104 |
|
108 | 105 | Use the [az role assignment create](/cli/azure/role/assignment#az-role-assignment-create) command to create a role assignment for the Azure Device Update service principal.
|
109 | 106 |
|
110 |
| -Replace *\<resource_id>* with the resource ID of your IoT hub. You can retrieve the resource ID by using the [az iot hub show](/cli/azure/iot/hub#az-iot-hub-show) command and querying for the ID value: `az iot hub show -n <hub_name> --query id`. |
| 107 | +In the command, replace `<resource_id>` with the resource ID of your IoT hub. You can retrieve the resource ID by using the [az iot hub show](/cli/azure/iot/hub#az-iot-hub-show) command and querying for the ID value with `az iot hub show -n <hub_name> --query id`. |
111 | 108 |
|
112 | 109 | ```azurecli
|
113 | 110 | az role assignment create --role "IoT Hub Data Contributor" --assignee https://api.adu.microsoft.com/ --scope <resource_id>
|
114 | 111 | ```
|
115 | 112 | ---
|
116 | 113 |
|
117 |
| -## Next steps |
118 |
| - |
119 |
| -Try updating a device using one of the following quick tutorials: |
| 114 | +## Related content |
120 | 115 |
|
121 |
| -* [Update a simulated IoT Edge device](device-update-simulator.md) |
122 |
| -* [Update a Raspberry Pi](device-update-raspberry-pi.md) |
123 |
| -* [Update an Ubuntu Server 18.04 x64 Package agent](device-update-ubuntu-agent.md) |
| 116 | +- [Azure role-based access control (RBAC) and Device Update](device-update-control-access.md) |
| 117 | +- [Command reference for az role assignment](/cli/azure/role/assignment) |
0 commit comments