Skip to content

Commit 844c37f

Browse files
authored
Merge pull request #188369 from kanshiG/patch-102
Update continuous-backup-restore-permissions.md
2 parents 6949e2e + 7bd45e0 commit 844c37f

File tree

6 files changed

+778
-26
lines changed

6 files changed

+778
-26
lines changed

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

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ description: Learn how to isolate and restrict the restore permissions for conti
44
author: kanshiG
55
ms.service: cosmos-db
66
ms.topic: how-to
7-
ms.date: 07/29/2021
7+
ms.date: 02/16/2022
88
ms.author: govindk
9-
ms.reviewer: sngun
9+
ms.reviewer: wiassaf
1010
---
1111

1212
# Manage permissions to restore an Azure Cosmos DB account
1313
[!INCLUDE[appliesto-sql-mongodb-api](includes/appliesto-sql-mongodb-api.md)]
1414

15-
Azure Cosmos DB allows you to isolate and restrict the restore permissions for continuous backup account to a specific role or a principal. The owner of the account can trigger a restore and assign a role to other principals to perform the restore operation. These permissions can be applied at the subscription scope or more granularly at the source account scope as shown in the following image:
15+
Azure Cosmos DB allows you to isolate and restrict the restore permissions for continuous backup account to a specific role or a principal. The owner of the account can trigger a restore and assign a role to other principals to perform the restore operation. These permissions can be applied at the subscription scope as shown in the following image:
1616

17-
:::image type="content" source="./media/continuous-backup-restore-permissions/restore-roles-permissions.png" alt-text="List of roles required to perform restore operation." lightbox="./media/continuous-backup-restore-permissions/restore-roles-permissions.png" border="false":::
17+
:::image type="content" source="./media/continuous-backup-restore-permissions/restore-roles-permissions.svg" alt-text="List of roles required to perform restore operation." border="false":::
1818

1919
Scope is a set of resources that have access, to learn more on scopes, see the [Azure RBAC](../role-based-access-control/scope-overview.md) documentation. In Azure Cosmos DB, applicable scopes are the source subscription and database account for most of the use cases. The principal performing the restore actions should have write permissions to the destination resource group.
2020

@@ -40,24 +40,29 @@ To perform a restore, a user or a principal need the permission to restore (that
4040
|---------|---------|
4141
|Subscription | /subscriptions/00000000-0000-0000-0000-000000000000 |
4242
|Resource group | /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Example-cosmosdb-rg |
43-
|CosmosDB restorable account resource | /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/West US/restorableDatabaseAccounts/23e99a35-cd36-4df4-9614-f767a03b9995|
4443

45-
The restorable account resource can be extracted from the output of the `az cosmosdb restorable-database-account list --account-name <accountname>` command in CLI or `Get-AzCosmosDBRestorableDatabaseAccount -DatabaseAccountName <accountname>` cmdlet in PowerShell. The name attribute in the output represents the `instanceID` of the restorable account.
46-
47-
## Permissions
4844

45+
## Permissions on the source account
4946
Following permissions are required to perform the different activities pertaining to restore for continuous backup mode accounts:
5047

5148
> [!NOTE]
52-
> Permission can be assigned to restorable database account at account scope or subscription scope. Assigning permissions at resource group scope is not supported.
53-
54-
|Permission |Impact |Minimum scope |Maximum scope |
55-
|---------|---------|---------|---------|
56-
|`Microsoft.Resources/deployments/validate/action`, `Microsoft.Resources/deployments/write` | These permissions are required for the ARM template deployment to create the restored account. See the sample permission [RestorableAction](#custom-restorable-action) below for how to set this role. | Not applicable | Not applicable |
57-
|`Microsoft.DocumentDB/databaseAccounts/write` | This permission is required to restore an account into a resource group | Resource group under which the restored account is created. | Subscription under which the restored account is created |
58-
|`Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restore/action` </br> You can't choose resource group as the permission scope. |This permission is required on the source restorable database account scope to allow restore actions to be performed on it. | The *RestorableDatabaseAccount* resource belonging to the source account being restored. This value is also given by the `ID` property of the restorable database account resource. An example of restorable account is */subscriptions/subscriptionId/providers/Microsoft.DocumentDB/locations/regionName/restorableDatabaseAccounts/\<guid-instanceid\>* | The subscription containing the restorable database account. |
59-
|`Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read` </br> You can't choose resource group as the permission scope. |This permission is required on the source restorable database account scope to list the database accounts that can be restored. | The *RestorableDatabaseAccount* resource belonging to the source account being restored. This value is also given by the `ID` property of the restorable database account resource. An example of restorable account is */subscriptions/subscriptionId/providers/Microsoft.DocumentDB/locations/regionName/restorableDatabaseAccounts/\<guid-instanceid\>*| The subscription containing the restorable database account. |
60-
|`Microsoft.DocumentDB/locations/restorableDatabaseAccounts/*/read` </br> You can't choose resource group as the permission scope. | This permission is required on the source restorable account scope to allow reading of restorable resources such as list of databases and containers for a restorable account. | The *RestorableDatabaseAccount* resource belonging to the source account being restored. This value is also given by the `ID` property of the restorable database account resource. An example of restorable account is */subscriptions/subscriptionId/providers/Microsoft.DocumentDB/locations/regionName/restorableDatabaseAccounts/\<guid-instanceid\>*| The subscription containing the restorable database account. |
49+
> Assigning permissions at resource group scope is not supported.
50+
51+
|Permission |Impact |
52+
|---------|---------|
53+
|`Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restore/action` </br> You can't choose resource group as the permission scope. |This permission is required on the source restorable database account scope to allow restore actions to be performed on it. |
54+
|`Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read` </br> You can't choose resource group as the permission scope. |This permission is required on the source restorable database account scope to list the database accounts that can be restored. |
55+
|`Microsoft.DocumentDB/locations/restorableDatabaseAccounts/*/read` </br> You can't choose resource group as the permission scope. | This permission is required on the source restorable account scope to allow reading of restorable resources such as list of databases and containers for a restorable account. |
56+
## Permissions on the destination account
57+
58+
Following permissions are required to perform the different activities pertaining to restore for continuous backup mode accounts:
59+
60+
61+
|Permission |Impact |
62+
|---------|---------|
63+
|`Microsoft.Resources/deployments/validate/action`, `Microsoft.Resources/deployments/write` | These permissions are required for the ARM template deployment to create the restored account. See the sample permission [RestorableAction](#custom-restorable-action) below for how to set this role.
64+
|`Microsoft.DocumentDB/databaseAccounts/write` | This permission is required to restore an account into a resource group |
65+
6166

6267
## Azure CLI role assignment scenarios to restore at different scopes
6368

articles/cosmos-db/how-to-setup-rbac.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ description: Learn how to configure role-based access control with Azure Active
44
author: ThomasWeiss
55
ms.service: cosmos-db
66
ms.topic: how-to
7-
ms.date: 07/21/2021
7+
ms.date: 02/16/2022
88
ms.author: thweiss
9+
ms.reviewer: wiassaf
910
---
1011

1112
# Configure role-based access control with Azure Active Directory for your Azure Cosmos DB account
@@ -30,7 +31,7 @@ The Azure Cosmos DB data plane RBAC is built on concepts that are commonly found
3031
- An Azure Cosmos DB database,
3132
- An Azure Cosmos DB container.
3233

33-
:::image type="content" source="./media/how-to-setup-rbac/concepts.png" alt-text="RBAC concepts":::
34+
:::image type="content" source="./media/how-to-setup-rbac/concepts.svg" alt-text="RBAC concepts":::
3435

3536
## <a id="permission-model"></a> Permission model
3637

@@ -62,7 +63,7 @@ The table below lists all the actions exposed by the permission model.
6263
| `Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create` | Create a new item. |
6364
| `Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read` | Read an individual item by its ID and partition key (point-read). |
6465
| `Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/replace` | Replace an existing item. |
65-
| `Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/upsert` | "Upsert" an item, which means create it if it doesn't exist, or replace it if it exists. |
66+
| `Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/upsert` | "Upsert" an item, which means to create or insert an item if it doesn't already exist, or to update or replace an item if it exists. |
6667
| `Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/delete` | Delete an item. |
6768
| `Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/executeQuery` | Execute a [SQL query](sql-query-getting-started.md). |
6869
| `Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/readChangeFeed` | Read from the container's [change feed](read-change-feed.md). |
@@ -96,7 +97,7 @@ The actual metadata requests allowed by the `Microsoft.DocumentDB/databaseAccoun
9697

9798
## Built-in role definitions
9899

99-
Azure Cosmos DB exposes 2 built-in role definitions:
100+
Azure Cosmos DB exposes two built-in role definitions:
100101

101102
| ID | Name | Included actions |
102103
|---|---|---|
@@ -342,9 +343,9 @@ See [this page](/rest/api/cosmos-db-resource-provider/2021-04-01-preview/sql-res
342343

343344
## Initialize the SDK with Azure AD
344345

345-
To use the Azure Cosmos DB RBAC in your application, you have to update the way you initialize the Azure Cosmos DB SDK. Instead of passing your account's primary key, you have to pass an instance of a `TokenCredential` class. This instance provides the Azure Cosmos DB SDK with the context required to fetch an AAD token on behalf of the identity you wish to use.
346+
To use the Azure Cosmos DB RBAC in your application, you have to update the way you initialize the Azure Cosmos DB SDK. Instead of passing your account's primary key, you have to pass an instance of a `TokenCredential` class. This instance provides the Azure Cosmos DB SDK with the context required to fetch an Azure AD (AAD) token on behalf of the identity you wish to use.
346347

347-
The way you create a `TokenCredential` instance is beyond the scope of this article. There are many ways to create such an instance depending on the type of AAD identity you want to use (user principal, service principal, group etc.). Most importantly, your `TokenCredential` instance must resolve to the identity (principal ID) that you've assigned your roles to. You can find examples of creating a `TokenCredential` class:
348+
The way you create a `TokenCredential` instance is beyond the scope of this article. There are many ways to create such an instance depending on the type of Azure AD identity you want to use (user principal, service principal, group etc.). Most importantly, your `TokenCredential` instance must resolve to the identity (principal ID) that you've assigned your roles to. You can find examples of creating a `TokenCredential` class:
348349

349350
- [In .NET](/dotnet/api/overview/azure/identity-readme#credential-classes)
350351
- [In Java](/java/api/overview/azure/identity-readme#credential-classes)
@@ -414,18 +415,18 @@ When you access the [Azure Cosmos DB Explorer](https://cosmos.azure.com/?feature
414415

415416
## Audit data requests
416417

417-
When using the Azure Cosmos DB RBAC, [diagnostic logs](cosmosdb-monitor-resource-logs.md) get augmented with identity and authorization information for each data operation. This lets you perform detailed auditing and retrieve the AAD identity used for every data request sent to your Azure Cosmos DB account.
418+
When using the Azure Cosmos DB RBAC, [diagnostic logs](cosmosdb-monitor-resource-logs.md) get augmented with identity and authorization information for each data operation. This lets you perform detailed auditing and retrieve the Azure AD identity used for every data request sent to your Azure Cosmos DB account.
418419

419420
This additional information flows in the **DataPlaneRequests** log category and consists of two extra columns:
420421

421-
- `aadPrincipalId_g` shows the principal ID of the AAD identity that was used to authenticate the request.
422+
- `aadPrincipalId_g` shows the principal ID of the Azure AD identity that was used to authenticate the request.
422423
- `aadAppliedRoleAssignmentId_g` shows the [role assignment](#role-assignments) that was honored when authorizing the request.
423424

424425
## <a id="disable-local-auth"></a> Enforcing RBAC as the only authentication method
425426

426427
In situations where you want to force clients to connect to Azure Cosmos DB through RBAC exclusively, you have the option to disable the account's primary/secondary keys. When doing so, any incoming request using either a primary/secondary key or a resource token will be actively rejected.
427428

428-
### Using Azure Resource Manager templates
429+
### Use Azure Resource Manager templates
429430

430431
When creating or updating your Azure Cosmos DB account using Azure Resource Manager templates, set the `disableLocalAuth` property to `true`:
431432

0 commit comments

Comments
 (0)