You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* If the account isn't eligible for MSI certificate renewal, an error message communicates the date and time when the account is eligible. It's recommended you run this operation periodically (for example, daily) to prevent the certificate from expiring and from the customer-managed key volume going offline.
49
-
49
+
* If you are using the CLI or PowerShell, you must take additional steps to enable access from the NetApp account to the customer-managed keys.
50
50
* Applying Azure network security groups on the private link subnet to Azure Key Vault isn't supported for Azure NetApp Files customer-managed keys. Network security groups don't affect connectivity to Private Link unless `Private endpoint network policy` is enabled on the subnet. It's recommended to keep this option disabled.
51
51
* If Azure NetApp Files fails to create a customer-managed key volume, error messages are displayed. Refer to the [Error messages and troubleshooting](#error-messages-and-troubleshooting) section for more information.
52
52
* If Azure Key Vault becomes inaccessible, Azure NetApp Files loses its access to the encryption keys and the ability to read or write data to volumes enabled with customer-managed keys. In this situation, create a support ticket to have access manually restored for the affected volumes.
@@ -116,6 +116,8 @@ For more information about Azure Key Vault and Azure Private Endpoint, refer to:
116
116
117
117
## Configure a NetApp account to use customer-managed keys
118
118
119
+
### [Portal](#tab/azure-portal)
120
+
119
121
1. In the Azure portal and under Azure NetApp Files, select **Encryption**.
120
122
121
123
The **Encryption** page enables you to manage encryption settings for your NetApp account. It includes an option to let you set your NetApp account to use your own encryption key, which is stored in [Azure Key Vault](../key-vault/general/basic-concepts.md). This setting provides a system-assigned identity to the NetApp account, and it adds an access policy for the identity with the required key permissions.
@@ -146,7 +148,180 @@ For more information about Azure Key Vault and Azure Private Endpoint, refer to:
146
148
*`Microsoft.KeyVault/vaults/keys/decrypt/action`
147
149
The user-assigned identity you select is added to your NetApp account. Due to the customizable nature of role-based access control (RBAC), the Azure portal doesn't configure access to the key vault. See [Provide access to Key Vault keys, certificates, and secrets with an Azure role-based access control](../key-vault/general/rbac-guide.md) for details on configuring Azure Key Vault.
148
150
149
-
1. After selecting **Save** button, you'll receive a notification communicating the status of the operation. If the operation was not successful, an error message displays. Refer to [error messages and troubleshooting](#error-messages-and-troubleshooting) for assistance in resolving the error.
151
+
1. Select **Save** then observe the notification communicating the status of the operation. If the operation was not successful, an error message displays. Refer to [error messages and troubleshooting](#error-messages-and-troubleshooting) for assistance in resolving the error.
152
+
153
+
### [Azure CLI](#tab/azure-cli)
154
+
155
+
The process to configure a NetApp account with customer-managed keys in the Azure CLI depends on whether you are using a [system-assigned identity](#use-a-system-assigned-idenitty) or an [user-assigned identity](#use-a-new-user-assigned-identity).
156
+
157
+
#### Use a system-assigned identity
158
+
159
+
1. Update your NetApp account to use a system-assigned identity.
160
+
161
+
```azurecli
162
+
az netappfiles account update \
163
+
--name <account_name> \
164
+
--resource-group <resource_group> \
165
+
--identity-type SystemAssigned
166
+
```
167
+
168
+
1. To use an access policy, create a variable that includes the principal ID of the account identity, then run `az keyvault set-policy` and assign permissions of "Get", "Encrypt", and "Decrypt".
169
+
170
+
```azurecli
171
+
netapp_account_principal=$(az netappfiles account show \
172
+
--name <account_name> \
173
+
--resource-group <resource_group> \
174
+
--query identity.principalId \
175
+
--output tsv)
176
+
177
+
az keyvault set-policy \
178
+
--name <key_vault_name> \
179
+
--resource-group <resource-group> \
180
+
--object-id $netapp_account_principal \
181
+
--key-permissions get encrypt decrypt
182
+
```
183
+
184
+
1. Update the NetApp account with your key vault.
185
+
186
+
```azurecli
187
+
key_vault_uri=$(az keyvault show \
188
+
--name <key-vault> \
189
+
--resource-group <resource_group> \
190
+
--query properties.vaultUri \
191
+
--output tsv)
192
+
az netappfiles account update --name <account_name> \
193
+
--resource-group <resource_group> \
194
+
--key-source Microsoft.Keyvault \
195
+
--key-vault-uri $key_vault_uri \
196
+
--key-name <key>
197
+
```
198
+
199
+
#### Use a new user-assigned identity
200
+
201
+
1. Create a new user-assigned identity.
202
+
203
+
```azurecli
204
+
az identity create \
205
+
--name <identity_name> \
206
+
--resource-group <resource_group>
207
+
```
208
+
209
+
1. Set an access policy for the key vault.
210
+
```azurecli
211
+
user_assigned_identity_principal=$(az identity show \
212
+
--name <identity_name> \
213
+
--resource-group <resource_group> \
214
+
--query properties.principalId \
215
+
-output tsv)
216
+
az keyvault set-policy \
217
+
--name <key_vault_name> \
218
+
--resource-group <resource-group> \
219
+
--object-id $user_assigned_identity_principal \
220
+
--key-permissions get encrypt decrypt
221
+
```
222
+
223
+
>[!NOTE]
224
+
>You can alternately [use role-based access control to grant access to the key vault](#use-role-based-access-control).
225
+
226
+
1. Assign the user-assigned identity to the NetApp account and update the key vault encryption.
227
+
228
+
```azurecli
229
+
key_vault_uri=$(az keyvault show \
230
+
--name <key-vault> \
231
+
--resource-group <resource_group> \
232
+
--query properties.vaultUri \
233
+
--output tsv)
234
+
user_assigned_identity=$(az identity show \
235
+
--name <identity_name> \
236
+
--resource-group <resource_group> \
237
+
--query id \
238
+
-output tsv)
239
+
az netappfiles account update --name <account_name> \
240
+
--resource-group <resource_group> \
241
+
--identity-type UserAssigned \
242
+
--user-identity-id $user-assigned-identity \
243
+
--key-source Microsoft.Keyvault \
244
+
--key-vault-uri $key_vault_uri \
245
+
--key-name <key> \
246
+
--keyvault-resource-id <key-vault> \
247
+
--user-assigned-identity $user_assigned_identity
248
+
```
249
+
250
+
### [Azure PowerShell](#tab/azure-powershell)
251
+
252
+
The process to configure a NetApp account with customer-managed keys in the Azure CLI depends on whether you are using a [system-assigned identity](#enable-access-for-system-assigned-identity) or an [user-assigned identity](#enable-access-for-user-assigned-identityy).
253
+
254
+
#### Enable access for system-assigned identity
255
+
256
+
1. Update your NetApp account to use system-assigned identity.
1. To use an access policy, run `Set-AzKeyVaultAccessPolicy` with the key vault name, the principal ID of the account identity, and the permissions "Get", "Encrypt", and "Decrypt".
0 commit comments