AmbiguousMatchException error when using Azure Search with SXA


Description

When using Azure search with SXA, search queries against Azure Search might fail with an error similar to the following:

AmbiguousMatchException: Ambiguous match found.]
   System.RuntimeType.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConv, Type[] types, ParameterModifier[] modifiers) +14234112
   System.Type.GetMethod(String name, BindingFlags bindingAttr) +45
   Sitecore.XA.Foundation.Search.Providers.Azure.LinqToCloudIndex`1.Execute(CloudQuery compositeQuery) +870
   Sitecore.ContentSearch.Linq.QueryableExtensions.GetResults(IQueryable`1 source) +387

Note: This issue affects SXA 1.9.0 - 9.3.0 versions.

Solution

To resolve the issue, consider one of the following options: