I have two Azure Functions inside the same Visual Studio 2019 project. From the documentation I read it's a good practice to have all of your Functions inside the same project. In my case, they're a scheduled one and an HTTP-triggered one. The latter one works just fine, while the former one display this error when I debug it locally from Visual Studio with F5:
Cannot bind parameter '$return' to type IActionResult&. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
This is the code of the scheduled function:
namespace MyNamespace {
public static class MyFunction {
[FunctionName("Test")]
public static async Task<IActionResult> Run([TimerTrigger("* * 00 * * *")]TimerInfo myTimer, ILogger log) {
return new OkObjectResult("...");
}
}
}
What cause the error?