1

is it possible to define PRIMARY key in azure cosmosdb cassandra arm template ?

Let's say I have next table:

CREATE TABLE foo
(
 id text
 name test
 PRIMARY KEY (id)
)

And my ARM template:

"schema":{
 "columns":[
   {
   "name":"id",
   "type":"text"
   }   
  ],
  "partitionKeys":[
    {"name":"id"} // how to define primary key ?
 }
David Makogon
  • 69,407
  • 21
  • 141
  • 189

1 Answers1

2

Primary key in Cassandra consists of one or more partition columns, and zero or more clustering columns. In ARM templates they are defined as partitionKeys and clusterKeys arrays of objects. Here is the example from documentation:

"partitionKeys": [
    { "name": "machine" },
    { "name": "cpu" },
    { "name": "mtime" }
],
"clusterKeys": [
    {
      "name": "loadid",
      "orderBy": "asc"
    }
]
Alex Ott
  • 80,552
  • 8
  • 87
  • 132