You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-hub/authenticate-authorize-azure-ad.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,9 +22,9 @@ Authenticating access by using Microsoft Entra ID and controlling permissions by
22
22
23
23
## Authentication and authorization
24
24
25
-
*Authentication* is the process of proving that you are who you say you are. Authentication verifies the identity of a user or device to IoT Hub. It's sometimes shortened to *AuthN*.
25
+
*Authentication* is the process of proving that you're who you say you are. Authentication verifies the identity of a user or device to IoT Hub. Authentication is sometimes shortened to *AuthN*.
26
26
27
-
*Authorization* is the process of confirming permissions for an authenticated user or device on IoT Hub. It specifies what resources and commands you're allowed to access, and what you can do with those resources and commands. Authorization is sometimes shortened to *AuthZ*.
27
+
*Authorization* is the process of confirming permissions for an authenticated user or device on IoT Hub. Authorization specifies what resources and commands you're allowed to access, and what you can do with those resources and commands. Authorization is sometimes shortened to *AuthZ*.
28
28
29
29
When a Microsoft Entra security principal requests access to an IoT Hub service API, the principal's identity is first *authenticated*. For authentication, the request needs to contain an OAuth 2.0 access token at runtime. The resource name for requesting the token is `https://iothubs.azure.net`. If the application runs in an Azure resource like an Azure VM, Azure Functions app, or Azure App Service app, it can be represented as a [managed identity](/entra/identity/managed-identities-azure-resources/how-managed-identities-work-vm).
30
30
@@ -34,8 +34,8 @@ After the Microsoft Entra principal is authenticated, the next step is *authoriz
34
34
35
35
With Microsoft Entra ID and RBAC, IoT Hub requires that the principal requesting the API have the appropriate level of permission for authorization. To give the principal the permission, give it a role assignment.
36
36
37
-
- If the principal is a user, group, or application service principal, follow the guidance in [Assign Azure roles by using the Azure portal](../role-based-access-control/role-assignments-portal.yml).
38
-
- If the principal is a managed identity, follow the guidance in [Assign a managed identity access to a resource](/entra/identity/managed-identities-azure-resources/how-to-assign-access-azure-resource).
37
+
- If the principal is a user, group, or application service principal, follow the guidance in [Assign Azure roles using the Azure portal](../role-based-access-control/role-assignments-portal.yml).
38
+
- If the principal is a managed identity, follow the guidance in [Assign a managed identity access to an Azure resource or another resource](/entra/identity/managed-identities-azure-resources/how-to-assign-access-azure-resource).
39
39
40
40
To ensure least privilege, always assign the appropriate role at the lowest possible [resource scope](#resource-scope), which is probably the IoT Hub scope.
41
41
@@ -48,7 +48,7 @@ IoT Hub provides the following Azure built-in roles for authorizing access to Io
48
48
|[IoT Hub Registry Contributor](../role-based-access-control/built-in-roles.md#iot-hub-registry-contributor)| Allows full access to the IoT Hub device registry. |
49
49
|[IoT Hub Twin Contributor](../role-based-access-control/built-in-roles.md#iot-hub-twin-contributor)| Allows read and write access to all IoT Hub device and module twins. |
50
50
51
-
You can also define custom roles to use with IoT Hub by combining the [permissions](#permissions-for-iot-hub-service-apis) that you need. For more information, see [Create custom roles for Azure role-based access control](../role-based-access-control/custom-roles.md).
51
+
You can also define custom roles to use with IoT Hub by combining the [permissions](#permissions-for-iot-hub-service-apis) that you need. For more information, see [Azure custom roles](../role-based-access-control/custom-roles.md).
52
52
53
53
### Resource scope
54
54
@@ -89,8 +89,8 @@ The following table describes the permissions available for IoT Hub service API
89
89
90
90
> [!TIP]
91
91
>
92
-
> - The [Bulk Registry Update](/rest/api/iothub/service/bulkregistry/updateregistry) operation requires both `Microsoft.Devices/IotHubs/devices/write` and `Microsoft.Devices/IotHubs/devices/delete`.
93
-
> - The [Twin Query](/rest/api/iothub/service/query/gettwins) operation requires `Microsoft.Devices/IotHubs/twins/read`.
92
+
> - The [Update Registry](/rest/api/iothub/service/bulkregistry/updateregistry) operation requires both `Microsoft.Devices/IotHubs/devices/write` and `Microsoft.Devices/IotHubs/devices/delete`.
93
+
> - The [Get Twins](/rest/api/iothub/service/query/gettwins) operation requires `Microsoft.Devices/IotHubs/twins/read`.
94
94
> -[Get Digital Twin](/rest/api/iothub/service/digitaltwin/getdigitaltwin) requires `Microsoft.Devices/IotHubs/twins/read`. [Update Digital Twin](/rest/api/iothub/service/digitaltwin/updatedigitaltwin) requires `Microsoft.Devices/IotHubs/twins/write`.
95
95
> - Both [Invoke Component Command](/rest/api/iothub/service/digitaltwin/invokecomponentcommand) and [Invoke Root Level Command](/rest/api/iothub/service/digitaltwin/invokerootlevelcommand) require `Microsoft.Devices/IotHubs/directMethods/invoke/action`.
96
96
@@ -105,13 +105,13 @@ By default, IoT Hub supports service API access through both Microsoft Entra ID
105
105
106
106
> [!WARNING]
107
107
>
108
-
> By denying connections using shared access policies, all users and services that connect using this method lose access immediately. Notably, since Device Provisioning Service (DPS) only supports linking IoT hubs using shared access policies, all device provisioning flows will fail with "unauthorized" error. Proceed carefully and plan to replace access with Microsoft Entra role based access.
108
+
> By denying connections using shared access policies, all users and services that connect using this method lose access immediately. Notably, since Device Provisioning Service (DPS) only supports linking IoT hubs using shared access policies, all device provisioning flows fail with "unauthorized" error. Proceed carefully and plan to replace access with Microsoft Entra role based access.
109
109
>
110
110
> **Do not proceed if you use Device Provisioning Service**.
111
111
112
112
1. Ensure that your service clients and users have [sufficient access](#manage-access-to-iot-hub-by-using-azure-rbac-role-assignment) to your IoT hub. Follow the [principle of least privilege](../security/fundamentals/identity-management-best-practices.md).
113
-
1.In the [Azure portal](https://portal.azure.com), go to your IoT hub.
114
-
1.On the left pane, select **Shared access policies**.
113
+
1.Sign in to the [Azure portal](https://portal.azure.com) and navigate to your IoT hub.
114
+
1.Select **Shared access policies** from the **Security settings** section of the navigation menu.
115
115
1. Under **Connect using shared access policies**, select **Deny**, and review the warning.
116
116
117
117
:::image type="content" source="media/iot-hub-dev-guide-azure-ad-rbac/disable-local-auth.png" alt-text="Screenshot that shows how to turn off IoT Hub shared access policies." border="true":::
@@ -126,7 +126,7 @@ Your IoT Hub service APIs can now be accessed only through Microsoft Entra ID an
126
126
127
127
You can provide access to IoT Hub from the Azure portal with either shared access policies or Microsoft Entra permissions.
128
128
129
-
When you try to access IoT Hub from the Azure portal, the Azure portal first checks whether you've been assigned an Azure role with `Microsoft.Devices/iotHubs/listkeys/action`. If you have, the Azure portal uses the keys from shared access policies to access IoT Hub. If not, the Azure portal tries to access data by using your Microsoft Entra account.
129
+
When you try to access IoT Hub from the Azure portal, the Azure portal first checks whether you're assigned an Azure role with `Microsoft.Devices/iotHubs/listkeys/action`. If you have, the Azure portal uses the keys from shared access policies to access IoT Hub. If not, the Azure portal tries to access data by using your Microsoft Entra account.
130
130
131
131
To access IoT Hub from the Azure portal by using your Microsoft Entra account, you need permissions to access IoT Hub data resources (like devices and twins). You also need permissions to go to the IoT Hub resource in the Azure portal. The built-in roles provided by IoT Hub grant access to resources like devices and twin but they don't grant access to the IoT Hub resource. So access to the portal also requires the assignment of an Azure Resource Manager role like [Reader](../role-based-access-control/built-in-roles.md#reader). The reader role is a good choice because it's the most restricted role that lets you navigate the portal. It doesn't include the `Microsoft.Devices/iotHubs/listkeys/action` permission (which provides access to all IoT Hub data resources via shared access policies).
132
132
@@ -159,5 +159,5 @@ For more information, see the [Azure IoT extension for Azure CLI release page](h
159
159
## Next steps
160
160
161
161
- For more information on the advantages of using Microsoft Entra ID in your application, see [Integrating with the Microsoft identity platform](/entra/identity-platform/how-to-integrate).
162
-
- To learn how access tokens, refresh tokens, and ID tokens are used in authorization and authentication, see [Security tokens](/entra/identity-platform/security-tokens).
162
+
- To learn how access tokens, refresh tokens, and ID tokens are used in authorization and authentication, see [Tokens and claims overview](/entra/identity-platform/security-tokens).
0 commit comments