Open
Description
I have a function app using the @azure/functions
npm package version 4.5.1
, with the following triggers defined:
app.http('info', {
methods: ['GET'],
authLevel: 'anonymous',
handler: <info-handler-function>,
route: 'info',
});
app.cosmosDB('consumer', {
connection: 'ConsumerConnection',
databaseName: <database-name>,
containerName: <container-name>,
leaseContainerName: <lease-container-name>,
leaseContainerPrefix: <lease-container-prefix>,
handler: <consumer-handler-function>,
});
If I omit the ConsumerConnection
environment variable and run the app, the function still works (e.g., the HTTP endpoints respond) even if the consumer trigger is not properly configured.
When running locally and removing ConsumerConnection
from the local.settings.json file
, the function still works but logs this message:
Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.consumer'. Microsoft.Azure.WebJobs.Extensions.CosmosDB:
Cannot create container information for <container-name> in database <database-name> with lease <lease-container-name> in database <database-name> :
Cosmos DB connection configuration 'ConsumerConnection' does not exist. Make sure that it is a defined App Setting.
Microsoft.Azure.WebJobs.Extensions.CosmosDB: Cosmos DB connection configuration 'ConsumerConnection' does not exist.
Make sure that it is a defined App Setting.
My goal is to return a 500
error on the /info
endpoint if there are issues (like with the cosmosDB
trigger). Is there a method within the nodejs-sdk
that exposes the status of a function?
Metadata
Metadata
Assignees
Labels
No labels