Questions tagged [cosmosclient]

10 questions
2
votes
1 answer

While calling CosmosClient(url,key,proxy_config = d) in python i am getting error?

While using client to configure and execute requests to the Azure Cosmos DB service ` d=ProxyConfiguration() d.Host='string' d.Port=int client = CosmosClient(url,key,proxy_config = d) ` I am getting…
Meta
  • 31
  • 3
1
vote
1 answer

How to change ConnectionMode in CosmosClient in Azure Functions?

I'm trying to change the ConnectionMode of my CosmosClient to Gateway. This is my Run() function: public static async Task Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "policy")] HttpRequest req, …
nana
  • 51
  • 6
0
votes
0 answers

I need to mock CosmosClient for writing unit test using xunit and moq

I am using GetItemLinqQueryable().where(predicate).TofeedIterator().readnextasync() to retrieve item from db. how can i mock these cosmosclient method so that i can run unit testing?
aml
  • 91
  • 1
  • 1
  • 5
0
votes
1 answer

CosmosClient : ReadItemAsync succeeds, GetItemLinqQueryable fails

Using .Net 6, Azure.Cosmos 3.33 ============= Some extra context, only to be thorough ============== the question is really about the several ways of querying items in CosmosDb 3, but to avoid misunderstandings here is a full disclaimer of the…
jeancallisti
  • 1,046
  • 1
  • 11
  • 21
0
votes
1 answer

CosmosClient : Custom json converter works out of the box with NewtonSoft, not with System.Text.Json

Scenario : I have a cosmosDb container stored in Azure. I have this kind of data class that I read and write to it : public class MyClass { public Guid Id { get; private set; } public string PartitionKey { get; private set; } …
jeancallisti
  • 1,046
  • 1
  • 11
  • 21
0
votes
0 answers

CosmosClient creation - Only one usage of each socket address (protocol/network address/port) is normally permitted

while connecting to cosmos DB from an API, I am creating a cosmosclient with with following code. var client = new CosmosClient(endPoint, accountKey, new CosmosClientOptions { IdleTcpConnectionTimeout = new TimeSpan(0, 0, 10, 0), PortReuseMode =…
kiran
  • 1
  • 2
0
votes
1 answer

Mock CosmosClient in Java junits

We have a requirement where we are fetching few records from Azure-CosmosDB - sql api For increasing coverage, we want to mock but have searched a lot but didn't find for Java. Could you please guide here My DAO class is as below private…
Wafa Saba
  • 101
  • 1
  • 9
0
votes
0 answers

Creating multiple items in Cosmos DB using CreateItemStreamAsync

I have a file (about 1 GB) containing a JSON array with a large number of items. These items should be read in by a .NET client (using Microsoft.Azure.Cosmos SDK v3.16.0) and created in a Cosmos DB collection using bulk execution. Up to now, I have…
Mo B.
  • 5,307
  • 3
  • 25
  • 42
0
votes
1 answer

How to execute the cosmos db stored procedure in nodejs?

I am trying to execute the stored procedure in nodejs. I am using cosmosclient and when I tried executing the code but I'm not able get the response or data back. Here is my piece of code. private async executeSprocInternal(sprocName, sprocParams)…
virat
  • 45
  • 1
  • 6
0
votes
1 answer

Query CosmosDB with CosmosClient and map to object

Right now I have the following code to query my CosmosDB: var streamIterator = containerLogs.GetItemQueryStreamIterator("SELECT * FROM mycontainer"); while (streamIterator.HasMoreResults) { var results = await streamIterator.ReadNextAsync(); …
Vivendi
  • 20,047
  • 25
  • 121
  • 196