Questions tagged [azure-cosmosdb-sqlapi]
1222 questions
0
votes
1 answer
Cosmos DB partitioned access to a database
I am implementing a multi-tenant application using cosmosDB. I am using partition keys to separate multiple users data. Following best practices i am trying to allow each tenant to have its own db access token.
I create a user and permission and use…

Walid Hanafy
- 1,429
- 2
- 14
- 26
0
votes
1 answer
Querying Cosmos Nested JSON documents
I would like to turn this resultset
[
{
"Document": {
"JsonData": "{\"key\":\"value1\"}"
}
},
{
"Document": {
"JsonData": "{\"key\":\"value2\"}"
}
}
]
into this
[
{
"key": "value1"
},
{
"key":…

Mark A Johnson
- 958
- 9
- 31
0
votes
1 answer
how to deploy Comsos Db stored procedure
I have an Azure Cosmos DB stored procedure and I want it to be included in my Continuous Integration scripts so that it deploys with the solution when the database is deployed. I'm using VSTS to handle my deployments. I'm guessing I have to use a…

Corey Witherow
- 2,472
- 2
- 26
- 37
0
votes
1 answer
Modeling document data and query performance
I have an aggerate data model (think a Customer entity with Widgets that belong to them as a list of embedded entities).
When I search for customers (e.g DocumentDBRepository.GetItemsAsync) That will be hydrating the customer data model along with…

andrew
- 1,260
- 9
- 14
0
votes
2 answers
How to maintain different version JSON document in cosmos db when PK is id and UK is id and version
I have a JSON document with two properties deviceIdentity, version.
Partition Key for my collection is deviceIdentity.
My JSON documents comes with different versions I want to keep all versions of this document.
Like:
deviceIdentity1,…

Ankur
- 31
- 6
0
votes
1 answer
CosmosDB SQL API, still attempting to get list of partitions and their sizes
I've seen a bunch of answers on StackOverflow stating that Microsoft's Cosmosdb simply doesn't support getting a list of partition keys. This has been bothering me as it seems like a sort of a zeroith requirement for any data store, to get a list of…

JakeJ
- 2,361
- 5
- 23
- 35
0
votes
1 answer
Error: upload data to Cosmosdb using pydocumendb
I'm using pydocumentdb to upload some processed data to CosmosDB as a Document on Azure Cloud with a Python script. The files are coming from the same source. The ingestion works well with some files, but gives the next error for the files that are…

Marc
- 17
- 4
-1
votes
1 answer
Azure Cosmos NoSQL RequestCharge higher than expected for Inserts
Using Microsoft.Azure.Cosmos 3.3 we are inserting a message into our Azure Cosmos NoSQL database in batches:
foreach (var item in listOfItems)
{
var task = container.CreateItemAsync(item, new PartitionKey(item.TimestampDate));
…

MattPil29
- 185
- 1
- 11
-1
votes
1 answer
How can we SELECT one or more Cosmos documents using Postman?
Out of morbid curiosity, how can a document be retrieved by directly exercising the Cosmos REST API? For my use case I would like to see it done within Postman.

Nicholas Hill
- 306
- 2
- 18
-1
votes
1 answer
Azure CosmosDb: Fresh read item and restore by ReplaceItemAsync() says 404
Simple process: I am getting items from my container and iterate them. Change a property and store it again.
Method to get items
public async Task GetActionsNotExecutedAsync(string transferId)
{
QueryDefinition query = new("SELECT…

Marcel W.
- 9
- 4
-1
votes
1 answer
How to query in cosmosDB?
I write the following query in my cosmosDb no Sql database: select * from c join t in c.model where t.modelName = "test" and i don't get any result ? why ?

Ptrk12
- 15
- 3
-1
votes
1 answer
select non unique record based on a unique combination of 2 fields cosmos db
I have many records in Cosmos DB container with the following structure (sample):
{
"id": "aaaa",
"itemCode": "1234",
"itemDesc": "TEST",
"otherfileds": ""
}
{
"id": "bbbb",
"itemCode": "1234",
"itemDesc": "TEST2",
…

Vishnuraj
- 1
- 2
-1
votes
1 answer
Not able to connect cosmo table api using datafactory
Keys are stored in secret as "cosmostablekey" for cosmos table api.
Created another secret stored in key valuets as below.
{
"name": "CosmosDbSQLAPILinkedService",
"properties": {
"type": "CosmosDb",
"typeProperties": {
…

Jaya Prakash
- 65
- 1
- 8
-1
votes
1 answer
No data getting pushed from Azure stream analytics to Cosmos DB
I have data getting pushed from Azure IoT Hub -> Stream Analytics -> CosmosDB (Core SQL API)
In stream analytics I can see the data is coming. But I am not seeing the data in cosmos db.
I have created cosmos db and container. And in Stream…

skmaran.nr.iras
- 8,152
- 28
- 81
- 116
-1
votes
1 answer
How can a CosmosDb SQL query projection be done so that the structure of the object is maintained?
I want to project, while maintaining the structure of the object. The below is an example, the solution should work for an arbitrary json schema.
SELECT c["user"]["firstname"] from c
Returns:
{
"firstname": "Foo"
}
Instead, I want it to…

hpatel
- 35
- 6