[Cosmos DB] Support for managed service identity & default identity#17583
Merged
[Cosmos DB] Support for managed service identity & default identity#17583
Conversation
Collaborator
|
Cosmos DB |
MehaKaushik
reviewed
Apr 6, 2021
MehaKaushik
reviewed
Apr 6, 2021
MehaKaushik
reviewed
Apr 6, 2021
MehaKaushik
approved these changes
Apr 7, 2021
evelyn-ys
reviewed
Apr 7, 2021
evelyn-ys
reviewed
Apr 7, 2021
evelyn-ys
reviewed
Apr 7, 2021
evelyn-ys
reviewed
Apr 7, 2021
Member
evelyn-ys
left a comment
There was a problem hiding this comment.
Can you add examples for new changed commands in _help.py so that customers will be aware.
evelyn-ys
reviewed
Apr 7, 2021
evelyn-ys
reviewed
Apr 7, 2021
evelyn-ys
reviewed
Apr 7, 2021
evelyn-ys
approved these changes
Apr 7, 2021
Juliehzl
reviewed
Apr 7, 2021
Juliehzl
reviewed
Apr 7, 2021
Juliehzl
reviewed
Apr 7, 2021
Juliehzl
reviewed
Apr 7, 2021
Juliehzl
reviewed
Apr 7, 2021
Juliehzl
reviewed
Apr 7, 2021
Juliehzl
reviewed
Apr 7, 2021
Juliehzl
reviewed
Apr 7, 2021
src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_commands.py
Show resolved
Hide resolved
Juliehzl
reviewed
Apr 7, 2021
Juliehzl
reviewed
Apr 8, 2021
Contributor
Juliehzl
left a comment
There was a problem hiding this comment.
Another concern is that should we support assign identity for existing cosmosdb resource with az cosmosdb update command?
Juliehzl
reviewed
Apr 8, 2021
Juliehzl
reviewed
Apr 8, 2021
xujin-zhang
commented
Apr 8, 2021
Contributor
Author
xujin-zhang
left a comment
There was a problem hiding this comment.
Another concern is that should we support assign identity for existing cosmosdb resource with
az cosmosdb updatecommand?
We don't support that because we want to enforce the customer to use "az cosmosdb identity XXX" once the db account is created. So there's no need to support that for az cosmosdb update. I think Azure storage support that but as I remember Azure VM doesn't
Juliehzl
approved these changes
Apr 8, 2021
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 introduces "SystemAssigned" identity support & "defaultIdentity" for Cosmos DB CMK related features.
Enable during account creation
az cosmosdb create --resource-group $rg --name $dbname ...(omitted) --assigned-identity
Enable on existing account
az cosmosdb identity assign --resource-group $rg --name $dbname
Disable/Remove identity
az cosmosdb identity remove --resource-group $rg --name $dbname
Show identity
az cosmosdb identity show --resource-group $rg --name $dbname
User can set the "defaultIdentity" during db account provision or update.
For example:
az cosmosdb update --resource-group $rg --name $dbname ...(omitted) --default-identity SystemAssignedIdentity.
Today the allowed "defaultIdentity" can be "SystemAssignedIdentity" and "FirstPartyIdentity". We will support more in near future. If the user doesn't specify the --default-identity, then the default identity of the account will not be updated.
Notice in our internal RP code, the change of default identity will have some key vault access validation, which indicate if the request doesn't pass the validation then the request will be rejected as a Bad Request to the user, and the default identity will stay unchanged.
Testing Guide
We have live tests in test_cosmosdb_commands.py, the manual tests would be similar to that in the "test_cosmosdb_managed_service_identity".
History Notes
[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.