Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Cross-tenant customer-managed keys (CMK) for Azure NetApp Files volume encryption allows service providers based on Azure to offer customer-managed key encryption. In the cross-tenant scenario, the NetApp account resides in a tenant managed by an independent software vendor, while the key used for encryption of volumes in that NetApp account resides in a key vault in a tenant that you manage.
Cross-tenant customer-managed keys is available in all Azure NetApp Files supported regions.
Understand cross-tenant customer-managed keys
The following diagram illustrates a sample cross-tenant CMK configuration. In the diagram, there are two Azure tenants: a service provider's tenant (Tenant 1) and your tenant (Tenant 2). Tenant 1 hosts the NetApp Account (source Azure resource). Tenant 2 hosts your key vault.
A multitenant application registration is created by the service provider in Tenant 1. A federated identity credential is created on this application using a user-assigned managed identity along with a private endpoint to the key vault. Then, the name and application ID of the app are shared.
Following these steps, you install the service provider's application in your tenant (tenant 2) then grant the service principal associated with the installed application access to the key vault. You also store the encryption key (that is, the customer-managed key) in the key vault. You also share the key ___location (the URI of the key) with the service provider. Following configuration, the service provider has:
- An application ID for a multitenant application installed in the customer's tenant, which has been granted access to the customer-managed key.
- A managed identity configured as the credential on the multitenant application. The ___location of the key in the key vault.
With these three parameters, the service provider provisions Azure resources in tenant 1 that can be encrypted with the customer-managed key in tenant 2.
Register the feature
This feature is currently in preview. You need to register the feature before using it for the first time. After registration, the feature is enabled and works in the background. No UI control is required.
Register the feature:
Register-AzProviderFeature -ProviderNamespace Microsoft.NetApp -FeatureName ANFCrossTenantCMK
Check the status of the feature registration:
Note
The RegistrationState can remain in the
Registering
state for up to 60 minutes before changing toRegistered
. Wait until the status is Registered before continuing.Get-AzProviderFeature -ProviderNamespace Microsoft.NetApp -FeatureName ANFCrossTenantCMK
You can also use Azure CLI commands az feature register
and az feature show
to register the feature and display the registration status.
Configure cross-tenant customer-managed keys for Azure NetApp Files
The configuration process for cross-tenant customer-managed keys has portions that can only be completed using the REST API and Azure CLI.
Configure a NetApp account to use a key from a vault in another tenant
- Create the application registration.
- Navigate to Microsoft Entra ID in the Azure portal
- Select Manage > App registrations from the left pane.
- Select + New registration.
- Provide the name for the application registration then select Account in any organizational directory.
- Select Register.
- Take note of the ApplicationID/ClientID of the application.
- Create a user-assigned managed identity.
- Navigate to Managed Identities in the Azure portal.
- Select + Create.
- Provide the resource group, region, and name for the managed identity.
- Select Review + create.
- On successful deployment, note the Azure ResourceId of the user-assigned managed identity, which is available under Properties. For example:
/subscriptions/aaaaaaaa-0000-aaaa-0000-aaaa0000aaaa/resourcegroups/<resourceGroup>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<identityTitle>
- Configure the user-assigned managed identity as a federated credential on the application
- Navigate to Microsoft Entra ID > App registrations > your application.
- Select Certificates & secrets.
- Select Federated credentials.
- Select + Add credential.
- Under Federated credential scenario, select Customer Managed Keys.
- Choose Select a managed identity. From the pane, select the subscription. Under Managed identity, select User-assigned managed identity. In the Select box, search for the managed identity you created earlier, then choose Select at the bottom of the pane.
- Under Credential details, provide a name and optional description for the credential. Select Add.
- Create a private endpoint to your key vault:
- Share the full Azure ResourceId of their Key Vault.
- Navigate to Private Endpoints.
- Select + Create.
- Choose your subscription and resource group, and enter a name for the Private Endpoint, then select Next > Resource.
- In the Resource tab, enter the following:
- Under Connection Method, select Connect to an Azure resource by resource ID or alias.
- Under Resource ID or alias, enter the ResourceID of the customer’s key vault.
- Under target subresource, enter "vault". Then select Next > Virtual Network.
- In the Virtual Network tab, select a virtual network and subnet for the private endpoint. The endpoint must be in the same virtual network as the volumes you wish to create. The subnet must be a different subnet than the one delegated to
Microsoft.NetApp/volumes
. - Select Next on the next few tabs. Finally, select Create on the final tab.
Authorize access to the key vault
- Install the service provider application in the customer tenant
- Get the Admin Consent URL from the provider for their cross-tenant application. In our example the URL would look like:
https://login.microsoftonline.com/<tenant1-tenantId>/adminconsent/client_id=<client/application-ID-for-the-cross-tenant-application>
. The URL opens a sign-in page prompting you to enter your credentials. Once you enter your credentials, you might see an error stating there's no redirect URL configured; this is OK.
- Get the Admin Consent URL from the provider for their cross-tenant application. In our example the URL would look like:
- Grant the service provider application access to the key vault.
- Navigate to your key vault. Select Access Control (IAM) from the left pane.
- Under Grant access to this resource, select Add role assignment.
- Search for then select Key Vault Crypto User.
- Under Members, select User, group, or service principal.
- Select Members. Search for the application name of the application you installed from the service provider.
- Select Review + Assign.
- Accept the incoming private endpoint connection to the key vault.
- Navigate to your key vault. Select Networking from the left pane.
- Under Private Endpoint Connections, select the incoming Private Endpoint from the provider’s tenant, then select Approve.
- Set an optional description or accept the default.
Configure the NetApp account to use your keys
Note
Using the az rest
command is the only supported way to configure your NetApp account to use CMK in a different tenant.
With the
az rest
command, configure the NetApp account to use CMK in a different tenant:az rest --method put --uri "/subscriptions/<subscription Id>/resourceGroups/<resourceGroupName>/providers/Microsoft.NetApp/netAppAccounts/<NetAppAccountName>?api-version=2024-01-01-preview" --body '{ \"properties\": { \"encryption\": { \"keySource\": \"Microsoft.KeyVault\", \"keyVaultProperties\": {\"keyVaultUri\": \"<URI to the key vault>\", \"keyVaultResourceId\": \"/<full resource ID of the key vault>\", \"keyName\": \"<customer’s key name>\" }, \"identity\": { \"userAssignedIdentity\": \"<full resource ID of the user-assigned identity>", \"federatedClientId\": \"<clientId of multi-tenant application>\" } } }, \"___location\": \"southcentralus\", \"identity\": {\"type\": \"userAssigned\", \"userAssignedIdentities\": { \"<full resource ID of the user-assigned identity>\": { } } } }' --verbose
Once you have sent the
az rest
command, your NetApp Account has been successfully configured with cross-tenant CMK.
Create a volume
Note
To create a volume using cross-tenant CMK, you must use the Azure CLI.
- Create the volume using the CLI:
az netappfiles volume create -g <resource group name> --account-name <NetApp account name> --pool-name <pool name> --name <volume name> -l southcentralus --service-level premium --usage-threshold 100 --file-path "<file path>" --vnet <virtual network name> --subnet default --network-features Standard --encryption-key-source Microsoft.KeyVault --kv-private-endpoint-id <full resource ID to the private endpoint to the customer's vault> --debug