Skip to content

Commit 725dd77

Browse files
authored
Merge pull request #302153 from DENKEN02MSFT/FreshnessMay2025-sonialopez-Row50
Freshness - May 2025 - Row 50
2 parents 0b08061 + 1ddbb88 commit 725dd77

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

articles/iot-hub/iot-hub-managed-identity.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ author: SoniaLopezBravo
66
ms.author: sonialopez
77
ms.service: azure-iot-hub
88
ms.topic: how-to
9-
ms.date: 08/23/2024
9+
ms.date: 07/01/2025
1010
ms.custom: subject-rbac-steps
1111
---
1212

1313
# IoT Hub support for managed identities
1414

15-
Managed identities provide Azure services with an automatically managed identity in Microsoft Entra ID in a secure manner. This eliminates the need for developers having to manage credentials by providing an identity. There are two types of managed identities: system-assigned and user-assigned. IoT Hub supports both.
15+
Managed identities provide Azure services with an automatically managed identity in Microsoft Entra ID in a secure manner. This feature eliminates the need for developers having to manage credentials by providing an identity. There are two types of managed identities: system-assigned and user-assigned. IoT Hub supports both.
1616

1717
In IoT Hub, managed identities can be used to connect IoT Hub to other Azure services for features such as [message routing](iot-hub-devguide-messages-d2c.md), [file upload](iot-hub-devguide-file-upload.md), and [bulk device import/export](iot-hub-bulk-identity-mgmt.md). In this article, you learn how to use system-assigned and user-assigned managed identities in your IoT hub for different functionalities.
1818

1919
## Prerequisites
2020

2121
- Understand the differences between *system-assigned* and *user-assigned* managed identity in [What are managed identities for Azure resources?](/entra/identity/managed-identities-azure-resources/overview)
2222

23-
- An IoT hub in your Azure subscription. If you don't have a hub yet, you can follow the steps in [Create an IoT hub](create-hub.md).
23+
- An IoT hub in your Azure subscription. If you don't have a hub yet, you can follow the steps in [Create an IoT hub](create-hub.md#create-an-iot-hub).
2424

2525
## System-assigned managed identity
2626

@@ -42,7 +42,7 @@ You can enable or disable system-assigned managed identity in Azure portal
4242

4343
You can enable system-assigned managed identity at hub creation time using ARM template
4444

45-
To enable the system-assigned managed identity in your IoT hub at resource provisioning time, use the Azure Resource Manager (ARM) template below.
45+
To enable the system-assigned managed identity in your IoT hub at resource provisioning time, use the following Azure Resource Manager (ARM) template.
4646

4747
```json
4848
{
@@ -111,7 +111,7 @@ To enable the system-assigned managed identity in your IoT hub at resource provi
111111
}
112112
```
113113

114-
After substituting the values for your resource `name`, `location`, `SKU.name` and `SKU.tier`, you can use Azure CLI to deploy the resource in an existing resource group using:
114+
After substituting the values for your resource `name`, `location`, `SKU.name`, and `SKU.tier`, you can use Azure CLI to deploy the resource in an existing resource group using:
115115

116116
```azurecli-interactive
117117
az deployment group create --name <deployment-name> --resource-group <resource-group-name> --template-file <template-file.json> --parameters iotHubName=<valid-iothub-name> skuName=<sku-name> skuTier=<sku-tier> location=<any-of-supported-regions>
@@ -132,11 +132,12 @@ az resource show --resource-type Microsoft.Devices/IotHubs --name <iot-hub-resou
132132
In this section, you learn how to add and remove a user-assigned managed identity from an IoT hub using Azure portal.
133133

134134
1. First you need to create a user-assigned managed identity as a standalone resource. To do so, you can follow the instructions in [Manage user-assigned managed identities](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities).
135-
2. Go to your IoT hub, navigate to the **Identity** in the IoT Hub portal.
136-
3. Under **User-Assigned** tab, click **Associate a user-assigned managed identity**. Choose the user-assigned managed identity you want to add to your hub and then click **Select**.
137-
4. You can remove a user-assigned identity from an IoT hub. Choose the user-assigned identity you want to remove, and click **Remove** button. Note you are only removing it from IoT hub, and this removal does not delete the user-assigned identity as a resource. To delete the user-assigned identity as a resource, follow the instructions in [Manage user-assigned managed identities](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities).
135+
2. Go to your IoT hub, then select **Identity** under **Security settings** from the service menu in Azure portal.
136+
3. Under the **User-Assigned** tab, select **Associate a user-assigned managed identity**. Choose the user-assigned managed identity you want to add to your hub and then select **Add**.
138137

139-
:::image type="content" source="./media/iot-hub-managed-identity/user-assigned.png" alt-text="Screenshot showing how to add user-assigned managed identity for an IoT hub." lightbox="./media/iot-hub-managed-identity/user-assigned.png":::
138+
:::image type="content" source="./media/iot-hub-managed-identity/user-assigned.png" alt-text="Screenshot showing how to add a user-assigned managed identity for an IoT hub." lightbox="./media/iot-hub-managed-identity/user-assigned.png":::
139+
140+
4. You can remove a user-assigned identity from an IoT hub. Choose the user-assigned identity you want to remove, and select **Remove**. You're removing it only from your IoT hub, and this removal doesn't delete the user-assigned identity as a resource. To delete the user-assigned identity as a resource, follow the instructions in [Manage user-assigned managed identities](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities).
140141

141142
### [Azure Resource Manager](#tab/arm)
142143

@@ -269,10 +270,10 @@ In this section, we use the [message routing](iot-hub-devguide-messages-d2c.md)
269270

270271
For more information about role assignments, see [Assign Azure roles using the Azure portal](../role-based-access-control/role-assignments-portal.yml).
271272

272-
1. If you need to restrict the connectivity to your custom endpoint through a VNet, you need to turn on the trusted Microsoft first party exception, to give your IoT hub access to the specific endpoint. For example, if you're adding an event hub custom endpoint, navigate to the **Firewalls and virtual networks** tab in your event hub and enable **Allow access from selected networks** option. Under the **Exceptions** list, check the box for **Allow trusted Microsoft services to access event hubs**. Click the **Save** button. This also applies to storage account and service bus. Learn more about [IoT Hub support for virtual networks](./virtual-network-support.md).
273+
1. If you need to restrict the connectivity to your custom endpoint through a virtual network, you need to turn on the trusted Microsoft first party exception, to give your IoT hub access to the specific endpoint. For example, if you're adding an event hub custom endpoint, navigate to the **Firewalls and virtual networks** tab in your event hub and enable **Allow access from selected networks** option. Under the **Exceptions** list, check the box for **Allow trusted Microsoft services to access event hubs**, then select **Save**. This requirement also applies to storage account and service bus. Learn more about [IoT Hub support for virtual networks with Azure Private Link](./virtual-network-support.md).
273274

274275
> [!NOTE]
275-
> You need to complete above steps to assign the managed identity the right access before adding the event hub as a custom endpoint in IoT Hub. Please wait a few minutes for the role assignment to propagate.
276+
> You need to complete above steps to assign the managed identity the right access before adding the event hub as a custom endpoint in IoT Hub. Wait a few minutes for the role assignment to propagate.
276277
277278
1. Next, go to your IoT hub. In your hub, navigate to **Message Routing**, then select **Add**.
278279

@@ -322,23 +323,23 @@ IoT Hub's [file upload](iot-hub-devguide-file-upload.md) feature allows devices
322323

323324
For more information about role assignments, see [Assign Azure roles using the Azure portal](../role-based-access-control/role-assignments-portal.yml).
324325

325-
If you need to restrict the connectivity to your storage account through a VNet, you need to turn on the trusted Microsoft first party exception, to give your IoT hub access to the storage account. On your storage account resource page, navigate to the **Firewalls and virtual networks** tab and enable **Allow access from selected networks** option. Under the **Exceptions** list, check the box for **Allow trusted Microsoft services to access this storage account**. Click the **Save** button. Learn more about [IoT Hub support for virtual networks](./virtual-network-support.md).
326+
If you need to restrict the connectivity to your storage account through a virtual network, you need to turn on the trusted Microsoft first party exception, to give your IoT hub access to the storage account. On your storage account resource page, navigate to the **Firewalls and virtual networks** tab and enable **Allow access from selected networks** option. Under the **Exceptions** list, check the box for **Allow trusted Microsoft services to access this storage account**, and then select **Save**. Learn more about [IoT Hub support for virtual networks with Azure Private Link](./virtual-network-support.md).
326327

327328
> [!NOTE]
328-
> You need to complete above steps to assign the managed identity the right access before saving the storage account in IoT Hub for file upload using the managed identity. Please wait a few minutes for the role assignment to propagate.
329+
> You need to complete above steps to assign the managed identity the right access before saving the storage account in IoT Hub for file upload using the managed identity. Wait a few minutes for the role assignment to propagate.
329330
330331
1. On your IoT hub's resource page, navigate to **File upload** tab.
331332

332-
1. On the page that shows up, select the container that you intend to use in your blob storage, configure the **File notification settings, SAS TTL, Default TTL, and Maximum delivery count** as desired. Choose the preferred authentication type, and click **Save**. If you get an error at this step, temporarily set your storage account to allow access from **All networks**, then try again. You can configure firewall on the storage account once the File upload configuration is complete.
333+
1. On the page that shows up, select the container that you intend to use in your blob storage, configure the **File notification settings, SAS TTL, Default TTL, and Maximum delivery count** as desired. Choose the preferred authentication type, and select **Save**. If you get an error at this step, temporarily set your storage account to allow access from **All networks**, then try again. You can configure firewall on the storage account once the File upload configuration is complete.
333334

334335
:::image type="content" source="./media/iot-hub-managed-identity/file-upload.png" alt-text="Screen shot that shows file upload with msi.":::
335336

336337
> [!NOTE]
337-
> In the file upload scenario, both hub and your device need to connect with your storage account. The steps above are for connecting your IoT hub to your storage account with desired authentication type. You still need to connect your device to storage using the SAS URI. Today the SAS URI is generated using connection string. We'll add support to generate SAS URI with managed identity soon. Please follow the steps in [file upload](iot-hub-devguide-file-upload.md).
338+
> In the file upload scenario, both hub and your device need to connect with your storage account. The previous steps are for connecting your IoT hub to your storage account with desired authentication type. You must connect your device to storage using the SAS URI. Currently, the SAS URI is generated using the connection string. Follow the steps in [Upload files with IoT Hub](iot-hub-devguide-file-upload.md).
338339
339340
## Configure bulk device import/export with managed identities
340341

341-
IoT Hub supports the functionality to [import/export device information in bulk](iot-hub-bulk-identity-mgmt.md) from or to a customer-provided storage blob. This functionality requires connectivity from IoT Hub to the storage account.
342+
IoT Hub supports the functionality to [import and export device information in bulk](iot-hub-bulk-identity-mgmt.md) from or to a customer-provided storage blob. This functionality requires connectivity from IoT Hub to the storage account.
342343

343344
1. In the Azure portal, navigate to your storage account.
344345

@@ -362,7 +363,7 @@ IoT Hub supports the functionality to [import/export device information in bulk]
362363

363364
### Using REST API or SDK for import and export jobs
364365

365-
You can now use the Azure IoT REST APIs for creating import and export jobs. You will need to provide the following properties in the request body:
366+
You can now use the Azure IoT REST APIs for creating import and export jobs. You need to provide the following properties in the request body:
366367

367368
- **storageAuthenticationType**: Set the value to **identityBased**.
368369
- **inputBlobContainerUri**: Set this property only in the import job.
@@ -430,11 +431,11 @@ result = iothub_job_manager.create_import_export_job(JobProperties(
430431

431432
> [!NOTE]
432433
>
433-
> - If **storageAuthenticationType** is set to **identityBased** and **userAssignedIdentity** property is not **null**, the jobs will use the specified user-assigned managed identity.
434-
> - If the IoT hub is not configured with the user-assigned managed identity specified in **userAssignedIdentity**, the job will fail.
435-
> - If **storageAuthenticationType** is set to **identityBased** the **userAssignedIdentity** property is null, the jobs will use system-assigned identity.
436-
> - If the IoT hub is not configured with the user-assigned managed identity, the job will fail.
437-
> - If **storageAuthenticationType** is set to **identityBased** and neither **user-assigned** nor **system-assigned** managed identities are configured on the hub, the job will fail.
434+
> - If **storageAuthenticationType** is set to **identityBased** and **userAssignedIdentity** property isn't **null**, the jobs use the specified user-assigned managed identity.
435+
> - If the IoT hub isn't configured with the user-assigned managed identity specified in **userAssignedIdentity**, the job fails.
436+
> - If **storageAuthenticationType** is set to **identityBased** the **userAssignedIdentity** property is null, the jobs use system-assigned identity.
437+
> - If the IoT hub isn't configured with the user-assigned managed identity, the job fails.
438+
> - If **storageAuthenticationType** is set to **identityBased** and **user-assigned** or **system-assigned** managed identities aren't configured on the hub, the job fails.
438439
439440
## SDK samples
440441

@@ -444,8 +445,8 @@ result = iothub_job_manager.create_import_export_job(JobProperties(
444445

445446
## Next steps
446447

447-
Use the links below to learn more about IoT Hub features:
448+
Use the following links to learn more about IoT Hub features:
448449

449-
- [Message routing](./iot-hub-devguide-messages-d2c.md)
450-
- [File upload](./iot-hub-devguide-file-upload.md)
451-
- [Bulk device import/export](./iot-hub-bulk-identity-mgmt.md)
450+
- [Use IoT Hub message routing to send device-to-cloud messages to Azure services](./iot-hub-devguide-messages-d2c.md)
451+
- [Upload files with IoT Hub](./iot-hub-devguide-file-upload.md)
452+
- [Import and export IoT Hub device identities in bulk](./iot-hub-bulk-identity-mgmt.md)
41.6 KB
Loading

0 commit comments

Comments
 (0)