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

[CosmosDB] Create command doesn't support the full list of DB kinds

Open lostintangent opened this issue 9 years ago • 8 comments

Description

The az cosmosdb create command doesn't seem to support the full set of database "kinds" that are available in the Azure portal. Namely, graph/gremlin, and key-value/Azure Tables aren't available via the --kind flag.


Environment summary

Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here: nightly

CLI Version: What version of the CLI and modules are installed? (Use az --version)
Answer here: nightly

OS Version: What OS and version are you using?
Answer here: macOS

Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here: bash

lostintangent avatar May 15 '17 18:05 lostintangent

This is because the SDK has not been released which reflects the addition of these Kinds.

tjprescott avatar May 15 '17 23:05 tjprescott

@moderakh to comment.

mayurid avatar May 19 '17 20:05 mayurid

I added the dataplane. This is management api: @dmakwana Digvijay are you adding this?

moderakh avatar May 19 '17 22:05 moderakh

Ack, I'll have a look at this

dmakwana avatar May 22 '17 22:05 dmakwana

Until there is an officially supported command, an unofficial workaround could be to create the DB with --kind GlobalDocumentDB and then use az resource tag to create a tag called defaultExperience with value Table or Graph. I guess this may stop working at any time, but based on information described at https://blog.spectologic.com/2017/06/30/digging-into-cosmosdb-storage/ this seems to be the way how the Azure portal does it today.

vjrantal avatar Sep 10 '17 16:09 vjrantal

Shouldn't this be solved by now?

letmaik avatar Jul 26 '18 16:07 letmaik

The capabilities flag should be used in this situation --capabilities EnableTable I think there is a documentation gap here as well as an update to the CLI to include EnableTable to show in any intellisense enabled editors.

az cosmosdb create 
    --resource-group "foo" \
    --capabilities EnableTable \
    --name "foo-table" \
    --locations "West US"=0 "East US"=1 \
    --max-interval 10 \
              --max-staleness-prefix 200

grayjeremy avatar Oct 24 '18 12:10 grayjeremy

Thank you for reporting this lack of documentation. As @grayjeremy mentions, you can select the account "kind" by adding a capability. This functionality is now documented through examples at: https://docs.microsoft.com/en-us/azure/cosmos-db/cli-samples

shurd avatar Jun 05 '19 22:06 shurd