|
| 1 | +--- |
| 2 | +title: Custom RBAC for your resources |
| 3 | +description: Use the Azure portal to secure access to Azure IoT Operations resources such as data flows and assets by using Azure role-based access control. |
| 4 | +author: dominicbetts |
| 5 | +ms.author: dobett |
| 6 | +ms.topic: reference |
| 7 | +ms.date: 04/16/2025 |
| 8 | + |
| 9 | +#CustomerIntent: As an IT administrator, I want configure Azure RBAC custom roles on resources in my Azure IoT Operations instance to control access to them. |
| 10 | +--- |
| 11 | + |
| 12 | +# Custom RBAC for your Azure IoT Operations resources |
| 13 | + |
| 14 | +To define custom roles that grant specific permissions to users, you can use Azure RBAC. For example, you can define an **Onboarding** role that grants sufficient permissions to a user to complete the Azure Arc connect process and deploy Azure IoT Operations securely. |
| 15 | + |
| 16 | +This article includes a list of example that you can download and use in your environment. These custom roles are JSON files that list the specific permissions and scope for the role. |
| 17 | + |
| 18 | +To learn more about custom roles in Azure RBAC, see [Azure custom roles](/azure/role-based-access-control/custom-roles). |
| 19 | + |
| 20 | +## Example custom roles |
| 21 | + |
| 22 | +The following sections list the example Azure IoT Operations custom roles you can download and use: |
| 23 | + |
| 24 | +### Onboarding roles |
| 25 | + |
| 26 | +| Custom role | Description | |
| 27 | +| ----------- | ----------- | |
| 28 | +| [Onboarding](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/custom-rbac/Onboarding.json) | This is privileged role. The user can complete Azure Arc connect process and deploy Azure IoT Operations securely. | |
| 29 | + |
| 30 | +### Viewer roles |
| 31 | + |
| 32 | +| Custom role | Description | |
| 33 | +| ----------- | ----------- | |
| 34 | +| [Instance viewer](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/custom-rbac/Instance%20Viewer.json) | This role allows the user to view the Azure IoT Operations instance. | |
| 35 | +| [Asset viewer](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/custom-rbac/Asset%20Viewer.json) | This role allows the user to view the assets in the Azure IoT Operations instance. | |
| 36 | +| [Asset endpoint viewer](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/custom-rbac/Asset%20Endpoint%20Viewer.json) | This role allows the user to view the asset endpoints in the Azure IoT Operations instance. | |
| 37 | +| [Data flow viewer](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/custom-rbac/Data%20Flow%20Viewer.json) | This role allows the user to view the data flows in the Azure IoT Operations instance. | |
| 38 | +| [Data flow destination viewer](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/custom-rbac/Data%20Flow%20Destination%20Viewer.json) | This role allows the user to view the data flow destinations in the Azure IoT Operations instance. | |
| 39 | +| [MQ viewer](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/custom-rbac/MQ%20Viewer.json) | This role allows the user to view the MQTT broker in the Azure IoT Operations instance. | |
| 40 | +| [Viewer](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/custom-rbac/Viewer.json) | This role allows the user to view the Azure IoT Operations instance. This role is a combination of the **Instance viewer**, **Asset viewer**, **Asset endpoint viewer**, **Data flow viewer**, **Data flow destination viewer**, and **MQ viewer** roles. | |
| 41 | + |
| 42 | +### Administrator roles |
| 43 | + |
| 44 | +| Custom role | Description | |
| 45 | +| ----------- | ----------- | |
| 46 | +| [Instance administrator](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/custom-rbac/Instance%20Administrator.json) | This is privileged role. The user can deploy an instance. The role includes permissions to create and update instances, brokers, authentications, listeners, dataflow profiles, dataflow endpoints, schema registries, and user assigned identities. The role also includes permission to delete instances. | |
| 47 | +| [Asset administrator](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/custom-rbac/Asset%20Administrator.json) | The user can create and manage assets in the Azure IoT Operations instance. | |
| 48 | +| [Asset endpoint administrator](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/custom-rbac/Asset%20Endpoint%20Administrator.json) | The user can create and manage asset endpoints in the Azure IoT Operations instance. | |
| 49 | +| [Data flow administrator](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/custom-rbac/Data%20Flow%20Administrator.json) | The user can create and manage data flows in the Azure IoT Operations instance. | |
| 50 | +| [Data flow destination administrator](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/custom-rbac/Data%20Flow%20Destination%20Administrator.json) | The user can create and manage data flow destinations in the Azure IoT Operations instance. | |
| 51 | +| [MQ administrator](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/custom-rbac/MQ%20Administrator.json) | The user can create and manage the MQTT broker in the Azure IoT Operations instance. | |
| 52 | +| [Administrator](https://github.com/Azure-Samples/explore-iot-operations/blob/main/samples/custom-rbac/Administrator.json) | This is privileged role. The user can create and manage the Azure IoT Operations instance. This role is a combination of the **Instance administrator**, **Asset administrator**, **Asset endpoint administrator**, **Data flow administrator**, **Data flow destination administrator**, and **MQ administrator** roles. | |
| 53 | + |
| 54 | +> [!NOTE] |
| 55 | +> The example _Assets endpoint administrator_ and _Data flow destination administrator_ roles have access to Azure Key Vault and the **Manage secrets** page in the operations experience web UI. However, even if these custom roles are assigned at the subscription level, users can only see the list of key vaults from the specific resource group. Access to schema registries is also restricted to the resource group level. |
| 56 | +
|
| 57 | +> [!IMPORTANT] |
| 58 | +> Currently, the operations experience web UI displays a misleading error message when a user tries to access a resource they don't have permissions for. Access to the resource is blocked as expected. |
| 59 | +
|
| 60 | +## Create a custom role definition |
| 61 | + |
| 62 | +To prepare one of the sample custom roles: |
| 63 | + |
| 64 | +1. Download the JSON file for the custom role you want to create. The JSON file contains the role definition, including the permissions and scope for the role. |
| 65 | + |
| 66 | +1. Edit the JSON file to replace the placeholder value in the `assignableScopes` field with your subscription ID. Save your changes. |
| 67 | + |
| 68 | +To add the custom role to your Azure subscription using the Azure portal: |
| 69 | + |
| 70 | +1. Go to your subscription in the Azure portal. |
| 71 | + |
| 72 | +1. Select **Access control (IAM)**. |
| 73 | + |
| 74 | +1. Select **Add > Add custom role**. |
| 75 | + |
| 76 | +1. Enter a name, such as **Onboarding**, and a description for the role. |
| 77 | + |
| 78 | +1. Select **Start from JSON** and then select the JSON file you downloaded. The custom role name and description are populated from the file. |
| 79 | + |
| 80 | +1. Optionally, review the permissions and assignable scopes. |
| 81 | + |
| 82 | +1. To add the custom role to your subscription, select **Review + create** and then **Create**. |
| 83 | + |
| 84 | +## Configure and use a custom role |
| 85 | + |
| 86 | +After you create the custom roles in your subscription, you can assign them to users, groups, or applications. You can assign roles at the subscription or resource group level. Assigning roles at the level of a resource group enables the most granular control. |
| 87 | + |
| 88 | +To assign the custom role to a user at the resource group level using the Azure portal: |
| 89 | + |
| 90 | +1. Go to your resource group in the Azure portal. |
| 91 | + |
| 92 | +1. Select **Access control (IAM)**. |
| 93 | + |
| 94 | +1. Select **Add > Add role assignment**. |
| 95 | + |
| 96 | +1. Search for and select the custom role you want to assign. Select **Next**. |
| 97 | + |
| 98 | +1. Select the user or users you want to assign the role to. You can search for users by name or email address. |
| 99 | + |
| 100 | +1. Select **Review + assign** to review the role assignment. If everything looks good, select **Assign**. |
0 commit comments