[Cosmos DB] Add support for user identity to 'az cosmosdb identity assign/remove'#19533
Merged
Conversation
Collaborator
|
Cosmos DB |
Contributor
|
Hi, can you extend the description like this: So it makes the commands sets more clear. Thanks a lot! |
xujin-zhang
reviewed
Sep 13, 2021
xujin-zhang
reviewed
Sep 13, 2021
xujin-zhang
reviewed
Sep 13, 2021
j-patrick
suggested changes
Sep 17, 2021
j-patrick
left a comment
There was a problem hiding this comment.
I added one comment, would like to see the test I can't find, then I will sign off. :)
xujin-zhang
reviewed
Sep 20, 2021
xujin-zhang
reviewed
Sep 21, 2021
xujin-zhang
reviewed
Sep 21, 2021
xujin-zhang
reviewed
Sep 21, 2021
xujin-zhang
reviewed
Sep 22, 2021
xujin-zhang
reviewed
Sep 23, 2021
xujin-zhang
approved these changes
Sep 25, 2021
evelyn-ys
approved these changes
Sep 29, 2021
1 task
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for user identity in additional to system manages service identity, along with the relevant tests.
The parameter '--identities' has been added to the commands 'az cosmosdb identity assign' and 'remove' to accept a space-separated list of identities, which, in addition to the existing '[system]' for system-managed identity, supports user-managed identities.
Examples:
Assign an existing user identity to a cosmos db account
az cosmosdb identity assign -g myrg -n mycdbact --identities /subscriptions/00000000-0000-0000-00000000/resourcegroups/MyRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyID
Remove a user identity from a cosmos db account
az cosmosdb identity remove -g myrg -n mycdbact --identities /subscriptions/00000000-0000-0000-00000000/resourcegroups/MyRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyID
Add system managed identity and user identity to a cosmos db account
az cosmosdb identity assign -g myrg -n mycdbact --identities [system] /subscriptions/00000000-0000-0000-00000000/resourcegroups/MyRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyID
Update the default identity to user identity
az cosmosdb update -g myrg -n mycdbact ... --default-identity UserAssignedIdentity=/subscriptions/00000000-0000-0000-00000000/resourcegroups/MyRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyID
Testing Guide
azdev test cosmosdb