|
| 1 | +--- |
| 2 | +title: Manage access to the de-identification service (preview) with Azure role-based access control (RBAC) in Azure Health Data Services |
| 3 | +description: Learn how to manage access to the de-identification service (preview) using Azure role-based access control. |
| 4 | +author: jovinson-ms |
| 5 | +ms.author: jovinson |
| 6 | +ms.service: azure-health-data-services |
| 7 | +ms.subservice: deidentification-service |
| 8 | +ms.topic: how-to |
| 9 | +ms.date: 07/16/2024 |
| 10 | +--- |
| 11 | + |
| 12 | +# Use Azure role-based access control with the de-identification service (preview) |
| 13 | + |
| 14 | +Microsoft Entra ID authorizes access rights to secured resources through Azure role-based access control (RBAC). The de-identification service (preview) defines a set of |
| 15 | +built-in roles that encompass common sets of permissions used to access de-identification functionality. |
| 16 | + |
| 17 | +Microsoft Entra ID uses the concept of a security principal, which can be a user, a group, an application service principal, or a [managed identity for Azure resources](/entra/identity/managed-identities-azure-resources/overview). |
| 18 | + |
| 19 | +When an Azure role is assigned to a Microsoft Entra ID security principal over a specific scope, Azure grants access to that scope for that security principal. For more information about scopes, see |
| 20 | +[Understand scope for Azure RBAC](/azure/role-based-access-control/scope-overview). |
| 21 | + |
| 22 | +## Prerequisites |
| 23 | + |
| 24 | +- A de-identification service (preview) in your Azure subscription. If you don't have a de-identification service, follow the steps in [Quickstart: Deploy the de-identification service](quickstart.md). |
| 25 | + |
| 26 | +## Available built-in roles |
| 27 | + |
| 28 | +The de-identification service (preview) has the following built-in roles available: |
| 29 | + |
| 30 | +|Role |Description | |
| 31 | +|-----|------------| |
| 32 | +|DeID Data Owner |Full access to de-identification functionality. | |
| 33 | +|DeID Real-time Data User |Execute requests against de-identification API endpoints. | |
| 34 | +|DeID Batch Owner |Create and manage de-identification batch jobs. | |
| 35 | +|DeID Batch Reader |Read-only access to de-identification batch jobs. | |
| 36 | + |
| 37 | +## Assign a built-in role |
| 38 | + |
| 39 | +Keep in mind the following points about Azure role assignments with the de-identification service (preview): |
| 40 | + |
| 41 | +- When you create a de-identification service, you aren't automatically assigned permissions to access data via Microsoft Entra ID. You need to explicitly assign yourself an applicable Azure role. You can assign it at the level of your subscription, resource group, or de-identification service. |
| 42 | +- When roles are assigned, it can take up to 10 minutes for changes to take effect. |
| 43 | +- When the de-identification service is locked with an [Azure Resource Manager read-only lock](/azure/azure-resource-manager/management/lock-resources), the lock prevents the assignment of Azure roles that are scoped to the de-identification service. |
| 44 | +- When Azure deny assignments have been applied, your access might be blocked even if you have a role assignment. For more information, see [Understand Azure deny assignments](/azure/role-based-access-control/deny-assignments). |
| 45 | + |
| 46 | +You can use different tools to assign built-in roles. |
| 47 | + |
| 48 | +# [Azure portal](#tab/azure-portal) |
| 49 | + |
| 50 | +To use the de-identification service (preview), with Microsoft Entra ID credentials, a security principal must be assigned one of the built-in roles. To learn how to assign these roles to a security |
| 51 | +principal, follow the steps in [Assign Azure roles using the Azure portal](/azure/role-based-access-control/role-assignments-portal). |
| 52 | + |
| 53 | +# [Azure PowerShell](#tab/azure-powershell) |
| 54 | + |
| 55 | +To assign an Azure role to a security principal with PowerShell, call the [New-AzRoleAssignment](/powershell/module/az.resources/new-azroleassignment) command. In order to run the command, you must have a role that includes **Microsoft.Authorization/roleAssignments/write** permissions assigned to you at the corresponding scope or higher. |
| 56 | + |
| 57 | +The format of the command can differ based on the scope of the assignment, but `ObjectId` and `RoleDefinitionName` are required parameters. While the `Scope` parameter is optional, you should set it to retain the principle of least privilege. By limiting roles and scopes, you limit the resources that are at risk if the security principal is ever compromised. |
| 58 | + |
| 59 | +The scope for a de-identification service (preview) is in the form `/subscriptions/<Subscription ID>/resourceGroups/<Resource Group Name>/providers/Microsoft.HealthDataAIServices/deidServices/<Deidentification Service Name>` |
| 60 | + |
| 61 | +The example assigns the **DeID Data Owner** built-in role to a user, scoped to a specific de-identification service. Make sure to replace the placeholder values |
| 62 | +in angle brackets `<>` with your own values: |
| 63 | + |
| 64 | +```azurepowershell |
| 65 | +New-AzRoleAssignment |
| 66 | + -SignInName <Email> ` |
| 67 | + -RoleDefinitionName "DeID Data Owner" ` |
| 68 | + -Scope "/subscriptions/<Subscription ID>/resourceGroups/<Resource Group Name>/providers/Microsoft.HealthDataAIServices/deidServices/<Deidentification Service Name>" |
| 69 | +``` |
| 70 | + |
| 71 | +A successful response should look like: |
| 72 | + |
| 73 | +``` |
| 74 | +
|
| 75 | +console |
| 76 | +RoleAssignmentId : /subscriptions/<Subscription ID>/resourceGroups/<Resource Group Name>/providers/Microsoft.HealthDataAIServices/deidServices/<Deidentification Service Name>/providers/Microsoft.Authorization/roleAssignments/<Role Assignment ID> |
| 77 | +Scope : /subscriptions/<Subscription ID>/resourceGroups/<Resource Group Name>/providers/Microsoft.HealthDataAIServices/deidServices/<Deidentification Service Name> |
| 78 | +DisplayName : Mark Patrick |
| 79 | + |
| 80 | +RoleDefinitionName : DeID Data Owner |
| 81 | +RoleDefinitionId : <Role Definition ID> |
| 82 | +ObjectId : <Object ID> |
| 83 | +ObjectType : User |
| 84 | +CanDelegate : False |
| 85 | +
|
| 86 | +``` |
| 87 | + |
| 88 | +For more information, see [Assign Azure roles using Azure PowerShell](/azure/role-based-access-control/role-assignments-powershell). |
| 89 | + |
| 90 | +# [Azure CLI](#tab/azure-pcli) |
| 91 | + |
| 92 | +To assign an Azure role to a security principal with Azure CLI, use the [az role assignment create](/cli/azure/role/assignment) command. In order to run the command, you must have a role that includes |
| 93 | +**Microsoft.Authorization/roleAssignments/write** permissions assigned to you at the corresponding scope or higher. |
| 94 | + |
| 95 | +The format of the command can differ based on the type of security principal, but `role` and `scope` are required parameters. |
| 96 | + |
| 97 | +The scope for a de-identification service (preview) is in the form `/subscriptions/<Subscription ID>/resourceGroups/<Resource Group Name>/providers/Microsoft.HealthDataAIServices/deidServices/<Deidentification Service Name>` |
| 98 | + |
| 99 | +The following example assigns the **DeID Data Owner** built-in role to a user, scoped to a specific de-identification service. Make sure to replace the placeholder values |
| 100 | +in angle brackets `<>` with your own values: |
| 101 | + |
| 102 | +```azurecli |
| 103 | +az role assignment create \ |
| 104 | + --assignee <Email> \ |
| 105 | + --role "DeID Data Owner" \ |
| 106 | + --scope "/subscriptions/<Subscription ID>/resourceGroups/<Resource Group Name>/providers/Microsoft.HealthDataAIServices/deidServices/<Deidentification Service Name>" |
| 107 | +``` |
| 108 | + |
| 109 | +For more information, see [Assign Azure roles using Azure PowerShell](/azure/role-based-access-control/role-assignments-cli). |
| 110 | + |
| 111 | +# [ARM template](#tab/azure-resource-manager) |
| 112 | + |
| 113 | +To learn how to use an Azure Resource Manager template to assign an Azure role, see [Assign Azure roles using Azure Resource Manager templates](/azure/role-based-access-control/role-assignments-template). |
| 114 | + |
| 115 | +--- |
| 116 | + |
| 117 | +## Related content |
| 118 | + |
| 119 | +- [What is Azure role-based access control (Azure RBAC)?](/azure/role-based-access-control/overview) |
| 120 | +- [Best practices for Azure RBAC](/azure/role-based-access-control/best-practices) |
0 commit comments