I created a Azure function that is triggered by Cosmos DB on local.
And my function.json looks like below.
{
"bindings": [
{
"type": "cosmosDBTrigger",
"name": "documents",
"direction": "in",
"leaseCollectionName": "leases",
"connectionStringSetting": "DB_URI",
"databaseName": "test",
"collectionName": "messages",
"createLeaseCollectionIfNotExists": true
},
...
And I tried to run this function locally, then I got this error.
Microsoft.Azure.WebJobs.Extensions.CosmosDB: Cannot create Collection Information for messages in database test with lease leases in database test : The connection string for the monitored collection is in an invalid format, please use AccountEndpoint=XXXXXX;AccountKey=XXXXXX;.
This error says I should use this format AccountEndpoint=XXXXXX;AccountKey=XXXXXX; as my connection string but my value looks like this currently.
local.settings.json
"DB_URI": "mongodb://...",
How and where can I get the valid value which I should put here? On Connection String page, I cannot find the value which uses the format above.