Skip to content

Commit 69f0be1

Browse files
Merge pull request #292243 from v-thepet/iot5
Freshness Edit: IoT-hub-device 5
2 parents 46b2dc8 + d1c447a commit 69f0be1

10 files changed

+165
-164
lines changed
Lines changed: 54 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,123 +1,117 @@
11
---
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.
44
author: eshashah-msft
55
ms.author: eshashah
6-
ms.date: 10/31/2022
6+
ms.date: 12/30/2024
77
ms.topic: how-to
88
ms.service: azure-iot-hub
99
ms.subservice: device-update
1010
---
1111

12-
# Configure access control roles for Device Update resources
12+
# Configure access control for Device Update resources
1313

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).
1521

1622
## Configure access control for Device Update account
1723

18-
# [Azure portal](#tab/portal)
24+
The following roles are available for assigning access to Device Update:
1925

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
2132

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).
2334

24-
2. Select **Add role assignments**.
35+
# [Azure portal](#tab/portal)
2536

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**.
2738

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":::
3440

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**.
3642

3743
:::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":::
3844

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.
4146

4247
:::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":::
4348

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.
4752

4853
# [Azure CLI](#tab/cli)
4954

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:
6456

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`.
6860

6961
```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>
7163
```
7264
---
7365

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
7568

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.
7770

7871
# [Azure portal](#tab/portal)
7972

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.
8174

8275
:::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":::
8376

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**.
8580

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":::
8782

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**.
8984

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":::
9186

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**.
9390

9491
:::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":::
9592

96-
6. Select **Next** > **Review + Assign**
93+
6. Select **Review + assign** and then select **Review + assign** again.
9794

98-
To validate that you've set permissions correctly:
95+
To validate that you set permissions correctly:
9996

10097
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.
10299
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**.
105102

106103
# [Azure CLI](#tab/cli)
107104

108105
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.
109106

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`.
111108

112109
```azurecli
113110
az role assignment create --role "IoT Hub Data Contributor" --assignee https://api.adu.microsoft.com/ --scope <resource_id>
114111
```
115112
---
116113

117-
## Next steps
118-
119-
Try updating a device using one of the following quick tutorials:
114+
## Related content
120115

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

Comments
 (0)