Edit

Managed HSM role management

Note

Key Vault supports two types of resources: vaults and managed HSMs. This article is about Managed HSM. To learn how to manage a vault, see Quickstart: Create a key vault using the Azure CLI.

This article provides practical instructions for managing roles and role assignments for a Managed HSM. It implements the role-based access control model described in Access control for Managed HSM by using the built-in roles documented in Local RBAC built-in roles for Managed HSM.

For an overview of Managed HSM, see What is Managed HSM? If you don't have an Azure subscription, create a free account before you begin.

To allow a security principal (such as a user, a service principal, group, or a managed identity) to perform managed HSM data plane operations, assign them a role that permits those operations. For example, if you want to allow an application to perform a sign operation by using a key, assign it a role that contains the Microsoft.KeyVault/managedHSM/keys/sign/action as one of the data actions. Assign a role at a specific scope. Managed HSM local RBAC supports two scopes, HSM-wide (/ or /keys) and per key (/keys/<key-name>).

For a list of all Managed HSM built-in roles and the operations they permit, see Managed HSM built-in roles.

Prerequisites

An Azure subscription is required. If you don't have one, create a free account before you begin.

You also need:

Create a new role assignment

  1. In the Azure portal, navigate to your Managed HSM resource.

  2. In the left menu, under Settings, select Local RBAC.

  3. Select Add role assignment, choose the role, scope, and principal, then save.

List existing role assignments

  1. In the Azure portal, navigate to your Managed HSM resource.

  2. In the left menu, under Settings, select Local RBAC.

    The portal displays all role assignments for the Managed HSM. You can filter by principal or scope.

    Screenshot of the Local RBAC blade in the Azure portal for a Managed HSM.

Delete a role assignment

  1. In the Azure portal, navigate to your Managed HSM resource.

  2. In the left menu, under Settings, select Local RBAC.

  3. Locate the role assignment you want to remove.

  4. Select the Delete (trash can) icon next to the assignment.

  5. Confirm the deletion when prompted.

List all available role definitions

  1. In the Azure portal, navigate to your Managed HSM resource.

  2. In the left menu, under Settings, select Local RBAC.

  3. Select the Roles tab to view all available built-in and custom role definitions.

Create a new role definition

Note

Custom role definitions can only be managed by using Azure CLI or Azure PowerShell.

Managed HSM has several built-in (pre-defined) roles that are useful for most common usage scenarios. You can define your own role with a list of specific actions that the role is allowed to perform. Then you can assign this role to principals to grant them the permission to the specified actions.

Custom role creation isn't currently available in the Azure portal. Use the Azure CLI or Azure PowerShell.

Show details of a role definition

Viewing custom role definition details isn't currently available in the Azure portal. Use the Azure CLI or Azure PowerShell.

Update a custom role definition

Updating custom role definitions isn't currently available in the Azure portal. Use the Azure CLI or Azure PowerShell.

Delete custom role definition

Deleting custom role definitions isn't currently available in the Azure portal. Use the Azure CLI or Azure PowerShell.

Note

Built-in roles cannot be deleted. When custom roles are deleted, all the role assignments using that custom role become defunct.

Next steps