I have this
It has http trigger and time trigger.
Now when I run the azure function it gives me this
What am I doing wrong ?
(EDIT)
Just updated my visual studio and build tools to latest version and it solve the problem.
I have this
It has http trigger and time trigger.
Now when I run the azure function it gives me this
What am I doing wrong ?
(EDIT)
Just updated my visual studio and build tools to latest version and it solve the problem.
I have taken .NET 6 Azure Functions v4 and made the Function 2 (Timer Trigger as static) and changed the Run method name to Run2, it is working successfully as you can see below screenshot:

And in 2nd practical, tried with your Timer Trigger Code Provided, made changes as did in above with Authorization Level as Function and got the successful result:

Function Code:
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
namespace KrishNet6FunApp1040
{
public static class Function1
{
[FunctionName("Function1")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
string name = req.Query["name"];
string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
dynamic data = JsonConvert.DeserializeObject(requestBody);
name = name ?? data?.name;
string responseMessage = string.IsNullOrEmpty(name)
? "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response."
: $"Hello, {name}. This HTTP triggered function executed successfully.";
return new OkObjectResult(responseMessage);
}
[FunctionName("TimerTriggerCSharp")]
public static void Run2([TimerTrigger("0 */1 * * * *")] TimerInfo myTimer, ILogger log)
{
if (myTimer.IsPastDue)
{
log.LogInformation("Timer is running late!");
}
log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
}
}
}