I am having issues running a Time Triggered Function App in the Azure Portal, these are the replication steps:
Result: in the output window it says "404 not found"
Does anyone have any ideas of why this is happening?
The function does not trigger automatically or by the time scheduled, but it seems to be deployed correctly which is very confusing.
I should also say that none of the other options offered in the dropdown work, and they all give me different errors:
Function code:
[Function("DepartmentFeed")] public async Task Run([TimerTrigger("%ScheduleTriggerTime%")] TimerInfo timer, FunctionContext context) { var logger = context.GetLogger(nameof(DepartmentFeed)); var graphService = new GraphService(logger); Instant instant = SystemClock.Instance.GetCurrentInstant(); Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); logger.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}"); try { var users = await graphService.ExtractDepartmentFeedFromEntraIdAsync(); long azureElapsed = stopWatch.ElapsedMilliseconds; logger.LogInformation( $"Retrieved {users.Count} from AzureAD. That took {azureElapsed / 1000} seconds @ {DateTime.Now}"); } catch (Exception ex) { logger.LogError(ex, ex.Message); } }
host.json:
{ "version": "2.0", "functions": ["DepartmentFeed"], "Xfunctions": [ "DepartmentFeed"], "functionTimeout": "00:10:00", "healthMonitor": { "enabled": false, "healthCheckInterval": "00:00:10", "healthCheckWindow": "00:02:00", "healthCheckThreshold": 6, "counterThreshold": 0.8 }, "logging": { "fileLoggingMode": "debugOnly", "logLevel": { "default": "Debug" }, "console": { "isEnabled": true }, "applicationInsights": { "samplingSettings": { "isEnabled": true, "maxTelemetryItemsPerSecond": 20, "excludedTypes": "Request" } } } }
Via Postman, I get a 404 error as well.
Many thanks in advance!
The function does not trigger automatically or by the time scheduled, but it seems to be deployed correctly which is very confusing.
ScheduleTriggerTime
to 0 * * * * *
because it depends on the function app's operating system. You can also refer to this MS Doc for the same.