An Azure NoSQL database service for app development.
I resolved this issue by removing the MongoDb .NET connector, and instead installed the Microsoft.Azure.Cosmos NuGet package.
I could then write to the database without any issues.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have an Azure function, I can connect to my CosmosDb in Azure fine, and even get the database.
var client = new MongoClient("mongodb://stor-cosmos-db:[MY_PRIMARY_ACCOUNT_KEY]@stor-cosmos-db.documents.azure.com:443/?ssl=true");
var database = client.GetDatabase("stor-db2");
When debugging my code, I get back values from these two rows, so it seems the connection is valid.
But as soon as I try to write something to the database, it just times out...
await database.CreateCollectionAsync("raceresult", new CreateCollectionOptions
{
Capped = true,
MaxSize = 1024,
MaxDocuments = 10,
});
I get the value for MY_PRIMARY_ACCOUNT_KEY from the Read/Write keys in the Azure Portal.
So if these are read/write keys, why do I get a timeout after 30 seconds whenever I try to write something?
An Azure NoSQL database service for app development.
I resolved this issue by removing the MongoDb .NET connector, and instead installed the Microsoft.Azure.Cosmos NuGet package.
I could then write to the database without any issues.