0

I have tried to use the Azure Search .net api but I cannot get past a UTF-8 encoding error when I try to either check if an index exists or create an index.

To keep things simple I tried downloading

https://github.com/Azure-Samples/search-dotnet-getting-started

Built the DotNetHowTo.sln with an updated appsettings.json but running the program results in the same error I get in my application:

The call to:

if (serviceClient.Indexes.Exists("hotels"))

Results in

System.InvalidOperationException: 'The character set provided in ContentType is invalid. Cannot read content as string using an invalid character set.'

Inner Exception ArgumentException: '"UTF-8"' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.

  • Please open an issue here and put Azure Search in the title: https://github.com/azure/azure-sdk-for-net/issues Please include details such as the version of .NET/.NET Core you're targeting, as well as the versions of all NuGet packages you're using including the Azure Search SDK packages. – Bruce Johnston Oct 19 '18 at 14:49

1 Answers1

1

This turned out to be a Sophos Web Appliance related issue. Sophos has facility to validate certificates and you have to add *.search.windows.net so it can trust the necessary certificates.

Redacted Sophos Configuration Image