Azure / Azure/azure-powershell

Id parameter should be Object Id, not Role Definition Id

Open
#25,715 4 comments 0 reactions 0 assignees View on GitHub
act-codegen-extensibility-squad CosmosDB customer-reported Doc - Reference Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Type of issue

Other (describe below)

### Feedback

When running the `Get-AzCosmosDBSqlRoleAssignment` command with `-id` parameter using the Rule Definition Id as defined in the documentation, an error is received.
Where `$roleId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/$accountName/sqlRoleDefinitions/00000000-0000-0000-0000-000000000002"`
Command:
`Get-AzCosmosDBSqlRoleAssignment -AccountName $accountName -ResourceGroupName $resourceGroupName -Id $roleId`
Error:
```
Get-AzCosmosDBSqlRoleAssignment: The request path https://cdbmgmtprodyt.documents.azure.com:450/subscriptions//resourceGroups//providers/Microsoft.DocumentDB/databaseAccounts//sqlRoleAssignments/subscriptions//resourceGroups//providers/Microsoft.DocumentDB/databaseAccounts//sqlRoleDefinitions/00000000-0000-0000-0000-000000000002?api-version=2023-11-15 is invalid.
ActivityId: 1da3024b-956b-4b29-b822-b08065a19c31, Microsoft.Azure.Documents.Common/2.14.0
```
However, it provides a result when using the (object) Id of the role assignment.

### Page URL

https://learn.microsoft.com/en-us/powershell/module/az.cosmosdb/get-azcosmosdbsqlroleassignment?view=azps-12.1.0

### Content source URL

https://github.com/Azure/azure-powershell/blob/main/src/CosmosDB/CosmosDB/help/Get-AzCosmosDBSqlRoleAssignment.md

### Author

@mikefrobbins

### Document Id

2b4f4fbf-d0a3-e287-cdec-ed5efcb02260

Contributor guide

Open the contributing guide

Research direction

Open src/CosmosDB/CosmosDB/help/Get-AzCosmosDBSqlRoleAssignment.md and inspect the -Id parameter description and examples. Compare the documented Role Definition Id with the reported command behavior, then update the documentation to identify the object Id expected by Get-AzCosmosDBSqlRoleAssignment and ensure the example is consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.