When I try to use Azure.Search.Documents in Azure function, there is a Json exception thrown.
Environment summary : VS Code, HttpTrigger Azure Function:V3, netcoreapp3.1
The Complete Stack trace for the same is :
" at Azure.Search.Documents.Models.SearchResults1.DeserializeAsync(Stream json, ObjectSerializer serializer, Boolean async, CancellationToken cancellationToken)\r\n at Azure.Search.Documents.SearchClient.SearchInternal[T](SearchOptions options, String operationName, Boolean async, CancellationToken cancellationToken)\r\n at Azure.Search.Documents.SearchClient.SearchInternal[T](String searchText, SearchOptions options, Boolean async, CancellationToken cancellationToken)\r\n at Azure.Core.Pipeline.TaskExtensions.EnsureCompleted[T](Task
1 task)\r\n at Azure.Search.Documents.SearchClient.Search[T](String searchText, SearchOptions options, CancellationToken cancellationToken)\r\n at SearchService.Utility.RunQueries(SearchClient srchclient, String inputVal, String gender, String body_part, String age_group)"
This is caused by a library mismatch in the azure function. Installing the latest version of System.Text.Json makes sure the function will have the correct methods available.