Skip to content

Commit f2178c0

Browse files
Merge pull request #218904 from dileepraotv-github/new_cmk_upd
New cmk upd
2 parents 8c6794e + 32a59db commit f2178c0

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

articles/cosmos-db/how-to-setup-customer-managed-keys.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ Because a system-assigned managed identity can only be retrieved after the creat
291291
},
292292
// ...
293293
"properties": {
294-
"defaultIdentity": "UserAssignedIdentity=<identity-resource-id>",
294+
"defaultIdentity": "UserAssignedIdentity=<identity-resource-id>"
295295
"keyVaultKeyUri": "<key-vault-key-uri>"
296296
// ...
297297
}
@@ -319,6 +319,14 @@ You can create a continuous backup account by using the Azure CLI or an Azure Re
319319

320320
Currently, only user-assigned managed identity is supported for creating continuous backup accounts.
321321

322+
Once the account has been created, user can update the identity to system-assigned managed identity using these instructions [Configure customer-managed keys for your Azure Cosmos DB account](./how-to-setup-customer-managed-keys.md#to-use-a-system-assigned-managed-identity).
323+
324+
> [!NOTE]
325+
> System-assigned identity and continuous backup mode is currently under Public Preview and may change in the future.
326+
327+
Alternatively, user can also create a system identity with periodic backup mode first, then migrate the account to Continuous backup mode using these instructions [Migrate an Azure Cosmos DB account from periodic to continuous backup mode](./migrate-continuous-backup.md)
328+
329+
322330
### To create a continuous backup account by using the Azure CLI
323331

324332
```azurecli
@@ -358,13 +366,47 @@ When you create a new Azure Cosmos DB account through an Azure Resource Manager
358366
// ...
359367
"properties": {
360368
"backupPolicy": { "type": "Continuous" },
361-
"defaultIdentity": "UserAssignedIdentity=<identity-resource-id>",
369+
"defaultIdentity": "UserAssignedIdentity=<identity-resource-id>"
362370
"keyVaultKeyUri": "<key-vault-key-uri>"
363371
// ...
364372
}
365373
}
366374
```
367375

376+
### To restore a continuous account that is configured with managed identity using CLI
377+
378+
#### Restore source account with system-assigned identity
379+
380+
> [!NOTE]
381+
> This feature is currently under Public Preview and requires Cosmos DB CLI Extension version 0.20.0 or higher.
382+
383+
System Identity is tied to one specific account and cannot be reused in another account. So, a new user-assigned identity is required during the restore process. This newly created user assigned identity is only needed during the restore and can be cleaned up once the restore has completed.
384+
385+
386+
1. Create a new user-assigned identity (or use an existing one) for the restore process.
387+
388+
1. Create the new access policy in your Azure Key Vault account as described above, use the Object ID of the managed identity from step 1.
389+
390+
1. Trigger the restore using Azure CLI:
391+
392+
```azurecli
393+
az cosmosdb restore \
394+
 --target-database-account-name {targetAccountName} \
395+
 --account-name {sourceAccountName} \
396+
 --restore-timestamp {timestampInUTC} \
397+
 --resource-group {resourceGroupName} \
398+
 --location {locationName} \
399+
 --assign-identity {userIdentity} \
400+
 --default-identity {defaultIdentity}
401+
```
402+
1. Once the restore has completed, the target (restored) account will have the user-assigned identity. If desired, user can update the account to use System-Assigned managed identity.
403+
404+
#### Restore source account with user-assigned identity
405+
406+
By default, when user trigger a restore for an account with user-assigned managed identity, the user-assigned identity will be passed to the target account automatically.
407+
408+
If desired, the user can also trigger a restore using a different user-assigned identity than the source account by specifying it in the restore parameters. Please follow the steps in [Restore source account with system-assigned identity](./how-to-setup-customer-managed-keys.md#restore-source-account-with-system-assigned-identity)
409+
368410
## Customer-managed keys and double encryption
369411

370412
The data you store in your Azure Cosmos DB account when using customer-managed keys ends up being encrypted twice:

articles/cosmos-db/restore-account-continuous-backup.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ Restore-AzCosmosDBAccount `
192192
-TablesToRestore $tablesToRestore
193193
-Location "West US"
194194
```
195+
### To restore a continuous account that is configured with managed identity using CLI
196+
197+
To restore Customer Managed Key (CMK) continuous account please refer to the steps provided [here](./how-to-setup-customer-managed-keys.md#to-restore-a-continuous-account-that-is-configured-with-managed-identity-using-cli)
195198

196199
### <a id="get-the-restore-details-powershell"></a>Get the restore details from the restored account
197200

0 commit comments

Comments
 (0)