Reputation: 11
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.
Upvotes: 0
Views: 261
Reputation: 11
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
Upvotes: 1