azure-cosmosdb

Is there a way to programmatically change TTL on a cosmos db Table

↘锁芯ラ 提交于 2020-08-11 18:39:51
问题 As the title describes, I'm trying to change the TTL of a cosmos db table. I couldn't find anything in c#/powershell/arm templates Here is what I'm trying to achieve The only thing I was able to find is the api call that is triggered in azure portal, but I'm wondering if it is safe to use this API directly? 回答1: In Cosmos DB Table API, Tables are essentially Containers thus you can use Cosmos DB SQL API SDK to manipulate the Table. Here's the sample code to do so: var cosmosClient = new

The connection string is missing a required property: AccountEndpoint error while using the new CosmosClient(CosmosConnectionString)

雨燕双飞 提交于 2020-08-10 19:21:50
问题 I am getting The connection string is missing a required property: AccountEndpoint error while using the new CosmosClient(CosmosConnectionString) constructor for CosmosClient with assembly Microsoft.Azure.Cosmos.Client, Version=3.11.0.0 - How to fix it? The connection string from the account looks like (AccountEndpoint is missing: DefaultEndpointsProtocol=https;AccountName=devdb;AccountKey=xxxx;TableEndpoint=https://devdb.table.cosmos.azure.com:443/; 回答1: The connection string you're

The connection string is missing a required property: AccountEndpoint error while using the new CosmosClient(CosmosConnectionString)

╄→尐↘猪︶ㄣ 提交于 2020-08-10 19:20:24
问题 I am getting The connection string is missing a required property: AccountEndpoint error while using the new CosmosClient(CosmosConnectionString) constructor for CosmosClient with assembly Microsoft.Azure.Cosmos.Client, Version=3.11.0.0 - How to fix it? The connection string from the account looks like (AccountEndpoint is missing: DefaultEndpointsProtocol=https;AccountName=devdb;AccountKey=xxxx;TableEndpoint=https://devdb.table.cosmos.azure.com:443/; 回答1: The connection string you're

Selecting values from objects in document nested array in CosmosDB

﹥>﹥吖頭↗ 提交于 2020-08-07 05:18:26
问题 Imagine we have a such collection (example taken from https://www.documentdb.com/sql/demo) { "_id" : "19015", "description" : "Snacks, granola bars, hard, plain", "servings" : [ { "amount" : 1, "description" : "bar", "weightInGrams" : 21 }, { "amount" : 1, "description" : "bar (1 oz)", "weightInGrams" : 28 }, { "amount" : 1, "description" : "bar", "weightInGrams" : 25 } ] } How i can query CosmosDB in SQL api to get results such like this? { "_id" : "19015", "servings" : [ { "description" :

How to populate a CosmosDB collection by command line?

只谈情不闲聊 提交于 2020-07-23 03:59:11
问题 I am developing a set of Scripts for Azure and I would like to know how to populate a CosmosDB collection with az . Currently, I know how to create a Database and Collection but how to initialize the Database? az cosmosdb create \ --resource-group $RESOURCE_GROUP \ --name $COSMOS_DB_ACCOUNT az cosmosdb database create \ --resource-group-name $RESOURCE_GROUP \ --name $COSMOS_DB_ACCOUNT \ --db-name $COSMOS_DB_NAME az cosmosdb collection create \ --resource-group-name $RESOURCE_GROUP \ --name

How to populate a CosmosDB collection by command line?

耗尽温柔 提交于 2020-07-23 03:58:05
问题 I am developing a set of Scripts for Azure and I would like to know how to populate a CosmosDB collection with az . Currently, I know how to create a Database and Collection but how to initialize the Database? az cosmosdb create \ --resource-group $RESOURCE_GROUP \ --name $COSMOS_DB_ACCOUNT az cosmosdb database create \ --resource-group-name $RESOURCE_GROUP \ --name $COSMOS_DB_ACCOUNT \ --db-name $COSMOS_DB_NAME az cosmosdb collection create \ --resource-group-name $RESOURCE_GROUP \ --name

How to populate a CosmosDB collection by command line?

丶灬走出姿态 提交于 2020-07-23 03:57:34
问题 I am developing a set of Scripts for Azure and I would like to know how to populate a CosmosDB collection with az . Currently, I know how to create a Database and Collection but how to initialize the Database? az cosmosdb create \ --resource-group $RESOURCE_GROUP \ --name $COSMOS_DB_ACCOUNT az cosmosdb database create \ --resource-group-name $RESOURCE_GROUP \ --name $COSMOS_DB_ACCOUNT \ --db-name $COSMOS_DB_NAME az cosmosdb collection create \ --resource-group-name $RESOURCE_GROUP \ --name

Azure Cosmos DB, Delete IDS (definitely exist)

北慕城南 提交于 2020-07-22 21:21:43
问题 This is probably a very simple and silly mistake but I am unsure of how this is failing. I have used the https://github.com/Azure/azure-cosmos-python#insert-data tutorial. How can I query a database then used those ids to delete and then they don't exist. Can anyone help before the weekend sets in? Thanks, struggling to see how this fails! Error: azure.cosmos.errors.HTTPFailure: Status code: 404 {"code":"NotFound","message":"Entity with the specified id does not exist in the system., \r

Azure Cosmos DB, Delete IDS (definitely exist)

眉间皱痕 提交于 2020-07-22 21:19:18
问题 This is probably a very simple and silly mistake but I am unsure of how this is failing. I have used the https://github.com/Azure/azure-cosmos-python#insert-data tutorial. How can I query a database then used those ids to delete and then they don't exist. Can anyone help before the weekend sets in? Thanks, struggling to see how this fails! Error: azure.cosmos.errors.HTTPFailure: Status code: 404 {"code":"NotFound","message":"Entity with the specified id does not exist in the system., \r

Get distinct values in Cosmos DB

喜你入骨 提交于 2020-07-21 03:53:06
问题 I need to get the distinct value. The query is SELECT DISTINCT c.Column1 FROM c . This query applies distinct with in the page instead of the entire collection. If i run the same above query again, it returns the next set of distinct values with continuation Token. I want the distinct needs to be applied to the entire collection, then the results can be paged. But it applies distinct with in the page and returns the results with continuation token. I want to achieve this without increasing