Error when using cosmosDB in Python function on Azure

Wim L 1 Reputation point
2020-12-12T16:50:33.99+00:00

I followed the Python Azure function tutorial.
And now I'm trying to add a Cosmos DB output binding following this example.

Why I try to run the function I get following error:
System.Private.CoreLib: Exception while executing function: Functions.HttpExample. Microsoft.Azure.DocumentDB.Core: Value cannot be null. (Parameter 'serviceEndpoint').
Am I missing a setting somewhere? In my app or on the Azure portal?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jaliya Udagedara 2,856 Reputation points MVP Volunteer Moderator
    2020-12-12T19:15:19.41+00:00

    Is the serviceEndpoint the connectionString to Cosmos DB? Have you set that under app settings in Azure?

    Basically what the error says is whatever this serviceEndpoint is, it is required and wasn't set. I am suspecting it's the connectionString. Can you try setting it to through AppSettings in Azure Portal (under Configuration)


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.