azure-cli-extensions icon indicating copy to clipboard operation
azure-cli-extensions copied to clipboard

Add identity to cosmosdb-preview extension

Open zehende opened this issue 3 years ago • 2 comments

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.

zehende avatar Sep 25 '21 01:09 zehende

cosmosdb

yonzhan avatar Sep 25 '21 02:09 yonzhan

Why do we need this since this has been added in CLI main repo https://github.com/Azure/azure-cli/pull/19533?

evelyn-ys avatar Sep 29 '21 06:09 evelyn-ys