-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #415 from MicrosoftDocs/main
Publish to live, Tuesday 4 AM PST, 10/1
- Loading branch information
Showing
48 changed files
with
1,977 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
599 changes: 599 additions & 0 deletions
599
articles/cosmos-db/includes/grant-control-plane-role-based-access.md
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+16.9 KB
...des/media/grant-control-plane-role-based-access/access-control-roles-option.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+19.4 KB
...des/media/grant-control-plane-role-based-access/access-control-service-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16 KB
...mos-db/includes/media/grant-control-plane-role-based-access/add-custom-role.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.9 KB
...db/includes/media/grant-control-plane-role-based-access/add-role-assignment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.48 KB
...ncludes/media/grant-control-plane-role-based-access/assignment-members-pane.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.2 KB
...s/media/grant-control-plane-role-based-access/assignment-review-assign-pane.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.8 KB
...b/includes/media/grant-control-plane-role-based-access/assignment-role-pane.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.2 KB
...control-plane-role-based-access/assignment-select-members-dialog-selections.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.2 KB
...edia/grant-control-plane-role-based-access/assignment-select-members-dialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+29.9 KB
...-db/includes/media/grant-control-plane-role-based-access/global-search-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.6 KB
...osmos-db/includes/media/grant-control-plane-role-based-access/global-search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.1 KB
...smos-db/includes/media/grant-control-plane-role-based-access/resource-group.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.4 KB
...rant-control-plane-role-based-access/role-add-permissions-dialog-selections.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.46 KB
...des/media/grant-control-plane-role-based-access/role-add-permissions-dialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.5 KB
...os-db/includes/media/grant-control-plane-role-based-access/role-basics-pane.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+18 KB
...includes/media/grant-control-plane-role-based-access/role-definition-dialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+19.1 KB
.../includes/media/grant-control-plane-role-based-access/role-definitions-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+40.8 KB
...es/media/grant-control-plane-role-based-access/role-permissions-pane-filled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.2 KB
.../includes/media/grant-control-plane-role-based-access/role-permissions-pane.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+20.8 KB
...ncludes/media/grant-control-plane-role-based-access/role-review-create-pane.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+18 KB
...smos-db/includes/media/grant-control-plane-role-based-access/search-results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
articles/cosmos-db/includes/validate-control-plane-role-based-access.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
--- | ||
ms.service: azure-cosmos-db | ||
ms.topic: include | ||
ms.date: 10/01/2024 | ||
zone_pivot_groups: azure-interface-portal-cli-powershell-bicep | ||
--- | ||
|
||
## Validate control plane access in code | ||
|
||
Finally, validate that you correctly granted access using application code and the Azure Management SDK in your preferred programming language. | ||
|
||
### [C#](#tab/csharp) | ||
|
||
```csharp | ||
using Azure.Identity; | ||
using Azure.ResourceManager; | ||
|
||
DefaultAzureCredential credential = new(); | ||
|
||
ArmClient client = new(credential); | ||
``` | ||
|
||
> [!IMPORTANT] | ||
> This code sample uses the [`Azure.ResourceManager.CosmosDB`](https://www.nuget.org/packages/Azure.ResourceManager.CosmosDB) and [`Azure.Identity`](https://www.nuget.org/packages/Azure.Identity) libraries from NuGet. | ||
### [JavaScript](#tab/javascript) | ||
|
||
```javascript | ||
const { CosmosDBManagementClient } = require('@azure/arm-cosmosdb'); | ||
const { DefaultAzureCredential } = require('@azure/identity'); | ||
|
||
const subscriptionId = "<subscription-id>"; | ||
|
||
const credential = new DefaultAzureCredential(); | ||
|
||
const client = new CosmosDBManagementClient(credential, subscriptionId); | ||
``` | ||
|
||
> [!IMPORTANT] | ||
> This code sample uses the [`@azure/arm-cosmosdb`](https://www.npmjs.com/package/@azure/arm-cosmosdb) and [`@azure/identity`](https://www.npmjs.com/package/@azure/identity) libraries from npm. | ||
### [TypeScript](#tab/typescript) | ||
|
||
```typescript | ||
import { CosmosDBManagementClient } from '@azure/arm-cosmosdb'; | ||
import { TokenCredential, DefaultAzureCredential } from '@azure/identity'; | ||
|
||
let subscriptionId: string = "<subscription-id>"; | ||
|
||
let credential: TokenCredential = new DefaultAzureCredential(); | ||
|
||
const client: CosmosDBManagementClient = new CosmosDBManagementClient(credential, subscriptionId); | ||
``` | ||
|
||
> [!IMPORTANT] | ||
> This code sample uses the [`@azure/arm-cosmosdb`](https://www.npmjs.com/package/@azure/arm-cosmosdb) and [`@azure/identity`](https://www.npmjs.com/package/@azure/identity) libraries from npm. | ||
### [Python](#tab/python) | ||
|
||
```python | ||
from azure.mgmt.cosmosdb import CosmosDBManagementClient | ||
from azure.identity import DefaultAzureCredential | ||
|
||
subscription_id = "<subscription-id>" | ||
|
||
credential = DefaultAzureCredential() | ||
|
||
client = CosmosDBManagementClient(credential=credential, subscription=subscription_id) | ||
``` | ||
|
||
> [!IMPORTANT] | ||
> This code sample uses the [`azure-mgmt-cosmosdb`](https://pypi.org/project/azure-mgmt-cosmosdb/) and [`azure-identity`](https://pypi.org/project/azure-identity/) libraries from PyPI. | ||
### [Go](#tab/go) | ||
|
||
```go | ||
package main | ||
|
||
import ( | ||
"github.com/Azure/azure-sdk-for-go/sdk/azidentity" | ||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" | ||
) | ||
|
||
const subscriptionId = "<subscription-id>" | ||
|
||
func main() { | ||
credential, _ := azidentity.NewDefaultAzureCredential(nil) | ||
|
||
client, _ := armcosmos.NewDatabaseClient(subscriptionId, credential, nil) | ||
} | ||
``` | ||
|
||
> [!IMPORTANT] | ||
> This code sample uses the [`azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos`](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos) and [`azure/azure-sdk-for-go/sdk/azidentity`](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity) libraries from Go. | ||
### [Java](#tab/java) | ||
|
||
```java | ||
package com.example; | ||
|
||
import com.azure.core.management.profile.AzureProfile; | ||
import com.azure.core.management.AzureEnvironment; | ||
import com.azure.identity.DefaultAzureCredential; | ||
import com.azure.identity.DefaultAzureCredentialBuilder; | ||
import com.azure.resourcemanager.cosmos.CosmosManager; | ||
|
||
public class CosmosDB { | ||
public static void main(String[] args) { | ||
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); | ||
DefaultAzureCredential credential = new DefaultAzureCredentialBuilder() | ||
.build(); | ||
|
||
CosmosManager manager = CosmosManager.authenticate(credential, profile); | ||
} | ||
} | ||
``` | ||
|
||
> [!IMPORTANT] | ||
> This code sample uses the [`com.azure.resourcemanager/azure-resourcemanager-cosmos`](https://mvnrepository.com/artifact/com.azure.resourcemanager/azure-resourcemanager-cosmos) and [`com.azure/azure-identity`](https://mvnrepository.com/artifact/com.azure/azure-identity) libraries from Maven. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.