Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In 1.0.3, TaskOrchestrationContext has NO input #189

Closed
KimihikoSaito opened this issue Sep 12, 2023 · 1 comment
Closed

In 1.0.3, TaskOrchestrationContext has NO input #189

KimihikoSaito opened this issue Sep 12, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@KimihikoSaito
Copy link

TaskOrchestrationContext has no input when using Microsoft.Azure.Functions.Worker.Extensions.DurableTask 1.0.3.
1.0.2 does not have this issue.

public static class Trigger
{
    [Function("Trigger")]
    public static async Task Run([HttpTrigger(AuthorizationLevel.Anonymous)] HttpRequestData req, [DurableClient] DurableTaskClient durableClient)
    {
        await durableClient.ScheduleNewOrchestrationInstanceAsync("RunOrchestration", input: DateTimeOffset.UtcNow.ToString());
    }

    [Function("RunOrchestration")]
    public static Task RunOrchestration([OrchestrationTrigger] TaskOrchestrationContext context)
    {
        var input = context.GetInput<String>();
        Console.WriteLine(Assembly.GetAssembly(typeof(TaskOrchestrationContext)).GetName().Version);
        if (input is null)
            Console.WriteLine("INPUT IS NULL");
        else
            Console.WriteLine($"INPUT OK: {input}");

        return Task.CompletedTask;
    }
}

Output 1.0.2:

[2023-09-12T00:02:31.323Z] Worker process started and initialized.
[2023-09-12T00:02:33.773Z] Host lock lease acquired by instance ID '0000000000000000000000005732CFD6'.
[2023-09-12T00:02:34.424Z] Executing 'Functions.Trigger' (Reason='This function was programmatically called via the host APIs.', Id=7a745881-ef15-47b8-be58-58185cfcc4f6)
[2023-09-12T00:02:34.578Z] Scheduling new RunOrchestration orchestration with instance ID '2174d4fc7b8f4241a8b6d2c9367408ab' and 32 bytes of input data.
[2023-09-12T00:02:34.859Z] Executed 'Functions.Trigger' (Succeeded, Id=7a745881-ef15-47b8-be58-58185cfcc4f6, Duration=448ms)
[2023-09-12T00:02:36.989Z] Executing 'Functions.RunOrchestration' (Reason='(null)', Id=b765d55e-62ba-4305-9474-321def0c3b58)
[2023-09-12T00:02:37.077Z] 1.0.2.0
[2023-09-12T00:02:37.077Z] INPUT OK: 2023/09/12 0:02:34 +00:00
[2023-09-12T00:02:37.090Z] Executed 'Functions.RunOrchestration' (Succeeded, Id=b765d55e-62ba-4305-9474-321def0c3b58, Duration=110ms)

Output 1.0.3:

[2023-09-12T00:02:03.360Z] Worker process started and initialized.
[2023-09-12T00:02:05.625Z] Host lock lease acquired by instance ID '0000000000000000000000005732CFD6'.
[2023-09-12T00:02:07.062Z] Executing 'Functions.Trigger' (Reason='This function was programmatically called via the host APIs.', Id=bc8ac064-9874-484b-b803-9cec8a79deb9)
[2023-09-12T00:02:07.218Z] Scheduling new RunOrchestration orchestration with instance ID '540446d602064c42a8bb821da736f5cf' and 32 bytes of input data.
[2023-09-12T00:02:07.500Z] Executed 'Functions.Trigger' (Succeeded, Id=bc8ac064-9874-484b-b803-9cec8a79deb9, Duration=452ms)
[2023-09-12T00:02:09.044Z] Executing 'Functions.RunOrchestration' (Reason='(null)', Id=b2fc1244-d5f5-493c-b9b1-c406c5dadc69)
[2023-09-12T00:02:09.125Z] 1.0.3.0
[2023-09-12T00:02:09.126Z] INPUT IS NULL
[2023-09-12T00:02:09.146Z] Executed 'Functions.RunOrchestration' (Succeeded, Id=b2fc1244-d5f5-493c-b9b1-c406c5dadc69, Duration=110ms)

This project referencing:

<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.19.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.14.1" />

and Microsoft.Azure.Functions.Worker.Extensions.DurableTask Version "1.0.2" or "1.0.3".

@cgillum cgillum added the bug Something isn't working label Sep 12, 2023
@jviau
Copy link
Member

jviau commented Sep 12, 2023

Thank you for the report.
Closing in favor of Azure/azure-functions-durable-extension#2577

I have identified the issue and have a fix out. Will release an updated package by EOD. You won't need to update your project when it is released, just re-build and the newer WebJobs extension should be pulled in (we use a glob of 2.11.*, so it should auto pick up the newer version)

@jviau jviau closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants