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)