azureazure-functionsazureportalazure-functions-isolated

Testing manually a Time Triggered Function App in the Azure Portal fails


I am having issues running a Time Triggered Function App in the Azure Portal, these are the replication steps:

  1. Function App Deployed to the Azure Portal,
  2. Click on the Time Triggered Function I want to test
  3. Click on Code + Test
  4. Click on Test/Run
  5. In Input, Select _master (Host Key)
  6. Click on Run

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.

enter image description here

Many thanks in advance!

enter image description here

enter image description here

enter image description here


Solution

  • The function does not trigger automatically or by the time scheduled, but it seems to be deployed correctly which is very confusing.

    enter image description here

    enter image description here

    enter image description here