adriana_malea Thanks for posting your question in Microsoft Q&A. I was able to reproduce this error at my end and see the below findings.
Isolated model uses System.Text.Json
for serialization and as per discussion: https://github.com/dotnet/runtime/issues/70352 ValueTuples are not serialized by default unless you change options.IncludeFields = true.
So, I added this configuration in Program.cs
like below:
services.Configure<JsonSerializerOptions>(o => o.IncludeFields = true);
and tested the below code which worked as expected.
public record CourseInfo(string Major, int UniversityYear);
[Function("GetCourseRecommendations")]
public static async Task<object> RunOrchestrator(
[OrchestrationTrigger] TaskOrchestrationContext context)
{
CourseInfo courseRecommendations = await context.CallActivityAsync<CourseInfo>(
"CourseRecommendations", ("ComputerScience", 2009));
return courseRecommendations;
}
[Function("CourseRecommendations")]
public static async Task<CourseInfo> Mapper(
[ActivityTrigger] (string Major, int UniversityYear) studentInfo, FunctionContext executionContext)
{
CourseInfo courseInfo = new (studentInfo.Major, studentInfo.UniversityYear);
return courseInfo;
}
However, we don't recommend changing the default behavior as this is considered a risky behavior as described in the repo. So, consider using record
instead of ValueTuple
like below:
public record CourseInfo(string Major, int UniversityYear);
[Function("GetCourseRecommendations")]
public static async Task<object> RunOrchestrator(
[OrchestrationTrigger] TaskOrchestrationContext context)
{
CourseInfo courseInfo = new ("ComputerScience", 2009);
CourseInfo courseRecommendations = await context.CallActivityAsync<CourseInfo>(
"CourseRecommendations", courseInfo);
return courseRecommendations;
}
[Function("CourseRecommendations")]
public static async Task<CourseInfo> Mapper(
[ActivityTrigger] CourseInfo studentInfo, FunctionContext executionContext)
{
CourseInfo courseInfo = new (studentInfo.Major, studentInfo.UniversityYear);
return courseInfo;
}
We are working on updating the doc with these details and publish soon. Sorry for the inconvenience caused by this.
I hope this helps and let us know if any questions.
If you found the answer to your question helpful, please take a moment to mark it as Yes
for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.