Skip to content

Add identity to cosmosdb-preview extension#3915

Open
zehende wants to merge 2 commits into
Azure:mainfrom
zehende:user-identity
Open

Add identity to cosmosdb-preview extension#3915
zehende wants to merge 2 commits into
Azure:mainfrom
zehende:user-identity

Conversation

@zehende
Copy link
Copy Markdown

@zehende zehende commented Sep 25, 2021

Support for the 'identity' group of commands in Cosmos DB:

  • az cosmosdb identity show
  • az cosmosdb identity assign
  • as cosmosdb identity remove

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


This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • [x ] Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • [x ] Have you run python scripts/ci/test_index.py -q locally?

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your PR is merged into master branch, a new PR will be created to update src/index.json automatically.
The precondition is to put your code inside this repo and upgrade the version in the PR but do not modify src/index.json.

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Sep 25, 2021

cosmosdb

Copy link
Copy Markdown

@wmengmsft wmengmsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@evelyn-ys
Copy link
Copy Markdown
Member

Why do we need this since this has been added in CLI main repo Azure/azure-cli#19533?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants