I'm writing an Azure Function app that'll subscribe to a Cosmos DB change feed. When I use Visual Studio 2019 to run the app locally (F5), I get the following error on the CLI:
Azure Function Core Tools reports "No job functions found."
The entire code snippet is below:
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
namespace ZZZ.ChangeFeedSubscriber
{
public static class ChangeFeedSubscriber
{
[FunctionName("ChangeFeedSubscriber")]
public static void Run([CosmosDBTrigger(
databaseName: "XXX",
collectionName: "YYY",
ConnectionStringSetting = "XXX",
LeaseCollectionName = "leases")] IReadOnlyList<Doc> docs, FunctionContext context)
{
var logger = context.GetLogger("ChangeFeedSubscriber");
if (docs != null && docs.Count > 0)
{
logger.LogInformation("Documents modified: " + docs.Count);
foreach (var doc in docs)
{
logger.LogInformation("ID: " + doc.id);
}
}
}
}
}
I tried to set "--verbose" on the application arguments to see log output but it threw an error.
Adding "--verbose" throws an error.
Result of adding "--verbose" to application arguments.
I also tried setting "start --verbose" but it threw an error, too.
Adding "start --verbose" also throws an error.
Result of adding "start --verbose" to application arguments.
I don't know what else I can check at this point. The application won't start up and I cannot see log output based on the searching I've done.
Any help would be appreciated. TIA!