0

I have a timer-triggered durable Azure function mentioned by Ikhtesam Afrin in this post. I had it in the consumption plan and it was working fine.

I have deployed it in the App plan (B3). On the home page of the durable function, I can see all my 3 functions listed, including the Activity function.

Upon execution, I do not see any call to the Activity function, though the Orchestrator function is getting triggered. There are no exceptions.

Where should I look?

1
  • Check the invocation logs in Activity function. Commented Oct 28, 2024 at 8:55

1 Answer 1

0

Configure Application Insights and check the logs under Monitoring=>Log Stream=>Application Logs.

I have deployed the same function code to Function app with App Service Plan(B3).

Code Snippet:

[Function(nameof(Function1))]
public static async Task<List<string>> RunOrchestrator(
   [OrchestrationTrigger] TaskOrchestrationContext context)
{
    ILogger logger = context.CreateReplaySafeLogger(nameof(Function1));
    logger.LogInformation("Saying hello.");
    var outputs = new List<string>();

    outputs.Add(await context.CallActivityAsync<string>(nameof(SayHello), "Tokyo"));
    outputs.Add(await context.CallActivityAsync<string>(nameof(SayHello), "Seattle"));
    outputs.Add(await context.CallActivityAsync<string>(nameof(SayHello), "London"));

    return outputs;
}

[Function(nameof(SayHello))]
public static string SayHello([ActivityTrigger] string name, FunctionContext executionContext)
{
    ILogger logger = executionContext.GetLogger("SayHello");
    logger.LogInformation("Saying hello to {name}.", name);
    return $"Hello {name}!";
}

[Function("Function1_TimerStart")]
public static async Task TimerStart(
    [TimerTrigger("0 */5 * * * *")] TimerInfo timer,
    [DurableClient] DurableTaskClient client,
    FunctionContext executionContext)
{
    ILogger logger = executionContext.GetLogger("Function1_TimerStart");

    string instanceId = await client.ScheduleNewOrchestrationInstanceAsync(
        nameof(Function1));

    logger.LogInformation("Started orchestration with ID = '{instanceId}' via TimerTrigger.", instanceId);
}

Portal:

enter image description here

Able to run all the functions as expected.

Application logs:

2024-10-28T09:25:00Z   [Information]   Executing 'Functions.Function1_TimerStart' (Reason='Timer fired at 2024-10-28T09:25:00.0121323+00:00', Id=f5a77596-584a-4c67-b4c4-10c51674ba95)
2024-10-28T09:25:00Z   [Information]   Scheduling new Function1 orchestration with instance ID 'eb99bcb3dcf143a39b5406cbbe102226' and 0 bytes of input data.
2024-10-28T09:25:00Z   [Information]   eb99bcb3dcf143a39b5406cbbe102226: Function 'Function1 (Orchestrator)' scheduled. Reason: NewInstance. IsReplay: False. State: Scheduled. RuntimeStatus: Pending. HubName: kpapp28. AppName: kpapp28. SlotName: Production. ExtensionVersion: 2.13.7. SequenceNumber: 99.
2024-10-28T09:25:00Z   [Information]   eb99bcb3dcf143a39b5406cbbe102226: Function 'Function1 (Orchestrator)' started. IsReplay: False. Input: (Redacted 0 characters). State: Started. RuntimeStatus: Running. HubName: kpapp28. AppName: kpapp28. SlotName: Production. ExtensionVersion: 2.13.7. SequenceNumber: 100. TaskEventId: -1
2024-10-28T09:25:00Z   [Information]   Executing 'Functions.Function1' (Reason='(null)', Id=3a741647-d393-40ca-b37f-bbf4d2b92794)
2024-10-28T09:25:00Z   [Information]   Saying hello.
2024-10-28T09:25:00Z   [Information]   Executed 'Functions.Function1' (Succeeded, Id=3a741647-d393-40ca-b37f-bbf4d2b92794, Duration=12ms)
2024-10-28T09:25:00Z   [Information]   Started orchestration with ID = 'eb99bcb3dcf143a39b5406cbbe102226' via TimerTrigger.
2024-10-28T09:25:00Z   [Information]   eb99bcb3dcf143a39b5406cbbe102226: Function 'Function1 (Orchestrator)' awaited. IsReplay: False. State: Awaited. HubName: kpapp28. AppName: kpapp28. SlotName: Production. ExtensionVersion: 2.13.7. SequenceNumber: 101.
2024-10-28T09:25:00Z   [Information]   Executed 'Functions.Function1_TimerStart' (Succeeded, Id=f5a77596-584a-4c67-b4c4-10c51674ba95, Duration=113ms)
2024-10-28T09:25:00Z   [Information]   eb99bcb3dcf143a39b5406cbbe102226: Function 'SayHello (Activity)' started. IsReplay: False. Input: (Redacted 9 characters). State: Started. RuntimeStatus: Running. HubName: kpapp28. AppName: kpapp28. SlotName: Production. ExtensionVersion: 2.13.7. SequenceNumber: 102. TaskEventId: 0
2024-10-28T09:25:00Z   [Information]   Executing 'Functions.SayHello' (Reason='(null)', Id=86202cba-f190-4ea1-ab15-6a6f727bfb51)
2024-10-28T09:25:00Z   [Information]   Saying hello to Tokyo.
2024-10-28T09:25:00Z   [Information]   Executed 'Functions.SayHello' (Succeeded, Id=86202cba-f190-4ea1-ab15-6a6f727bfb51, Duration=1ms)
2024-10-28T09:25:00Z   [Information]   eb99bcb3dcf143a39b5406cbbe102226: Function 'SayHello (Activity)' completed. ContinuedAsNew: False. IsReplay: False. Output: (Redacted 14 characters). State: Completed. RuntimeStatus: Completed. HubName: kpapp28. AppName: kpapp28. SlotName: Production. ExtensionVersion: 2.13.7. SequenceNumber: 103. TaskEventId: 0
2024-10-28T09:25:00Z   [Information]   Executing 'Functions.Function1' (Reason='(null)', Id=ecfd424d-80ce-4a03-b836-c16e13e3efcf)
2024-10-28T09:25:00Z   [Information]   Executed 'Functions.Function1' (Succeeded, Id=ecfd424d-80ce-4a03-b836-c16e13e3efcf, Duration=2ms)
2024-10-28T09:25:00Z   [Information]   eb99bcb3dcf143a39b5406cbbe102226: Function 'Function1 (Orchestrator)' awaited. IsReplay: False. State: Awaited. HubName: kpapp28. AppName: kpapp28. SlotName: Production. ExtensionVersion: 2.13.7. SequenceNumber: 104.
2024-10-28T09:25:00Z   [Information]   eb99bcb3dcf143a39b5406cbbe102226: Function 'SayHello (Activity)' started. IsReplay: False. Input: (Redacted 11 characters). State: Started. RuntimeStatus: Running. HubName: kpapp28. AppName: kpapp28. SlotName: Production. ExtensionVersion: 2.13.7. SequenceNumber: 105. TaskEventId: 1
2024-10-28T09:25:00Z   [Information]   Executing 'Functions.SayHello' (Reason='(null)', Id=43efd269-a3ea-45b6-8469-d16b8390253d)
2024-10-28T09:25:00Z   [Information]   Saying hello to Seattle.
2024-10-28T09:25:00Z   [Information]   Executed 'Functions.SayHello' (Succeeded, Id=43efd269-a3ea-45b6-8469-d16b8390253d, Duration=1ms)
2024-10-28T09:25:00Z   [Information]   eb99bcb3dcf143a39b5406cbbe102226: Function 'SayHello (Activity)' completed. ContinuedAsNew: False. IsReplay: False. Output: (Redacted 16 characters). State: Completed. RuntimeStatus: Completed. HubName: kpapp28. AppName: kpapp28. SlotName: Production. ExtensionVersion: 2.13.7. SequenceNumber: 106. TaskEventId: 1
2024-10-28T09:25:00Z   [Information]   Executing 'Functions.Function1' (Reason='(null)', Id=4f371c69-d41d-485e-8d7d-a824eb58c697)
2024-10-28T09:25:00Z   [Information]   Executed 'Functions.Function1' (Succeeded, Id=4f371c69-d41d-485e-8d7d-a824eb58c697, Duration=1ms)
2024-10-28T09:25:00Z   [Information]   eb99bcb3dcf143a39b5406cbbe102226: Function 'Function1 (Orchestrator)' awaited. IsReplay: False. State: Awaited. HubName: kpapp28. AppName: kpapp28. SlotName: Production. ExtensionVersion: 2.13.7. SequenceNumber: 107.
2024-10-28T09:25:00Z   [Information]   eb99bcb3dcf143a39b5406cbbe102226: Function 'SayHello (Activity)' started. IsReplay: False. Input: (Redacted 10 characters). State: Started. RuntimeStatus: Running. HubName: kpapp28. AppName: kpapp28. SlotName: Production. ExtensionVersion: 2.13.7. SequenceNumber: 108. TaskEventId: 2
2024-10-28T09:25:00Z   [Information]   Executing 'Functions.SayHello' (Reason='(null)', Id=d7fea55b-9cce-443c-8cad-e574c22f5d94)
2024-10-28T09:25:00Z   [Information]   Saying hello to London.
2024-10-28T09:25:00Z   [Information]   Executed 'Functions.SayHello' (Succeeded, Id=d7fea55b-9cce-443c-8cad-e574c22f5d94, Duration=1ms)
2024-10-28T09:25:00Z   [Information]   eb99bcb3dcf143a39b5406cbbe102226: Function 'SayHello (Activity)' completed. ContinuedAsNew: False. IsReplay: False. Output: (Redacted 15 characters). State: Completed. RuntimeStatus: Completed. HubName: kpapp28. AppName: kpapp28. SlotName: Production. ExtensionVersion: 2.13.7. SequenceNumber: 109. TaskEventId: 2
2024-10-28T09:25:00Z   [Information]   Executing 'Functions.Function1' (Reason='(null)', Id=deb17307-5323-49ab-9c0b-80ec2e7567a1)
2024-10-28T09:25:00Z   [Information]   Executed 'Functions.Function1' (Succeeded, Id=deb17307-5323-49ab-9c0b-80ec2e7567a1, Duration=2ms)
2024-10-28T09:25:00Z   [Information]   eb99bcb3dcf143a39b5406cbbe102226: Function 'Function1 (Orchestrator)' completed. ContinuedAsNew: False. IsReplay: False. Output: (Redacted 49 characters). State: Completed. RuntimeStatus: Completed. HubName: kpapp28. AppName: kpapp28. SlotName: Production. ExtensionVersion: 2.13.7. SequenceNumber: 110. TaskEventId: -1

Activity function:

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.