Getting a 10054 error when calling a Cognitive Services API from VSTO Word Add-in

AdamMorgan-1941 10 Reputation points
2024-05-15T21:16:54.8833333+00:00

I am developing a Word VSTO add-in so that I can call a Cognitive Services knowledgebase service. The code is pretty straight-forward and works fine when I run it from a windows console app (a similar call in python also works without issue):

Debug.WriteLine("beginning of the try");
 string azureEndpoint = "https://redacted.cognitiveservices.azure.com/"; // Replace with your actual endpoint URL
 string subscriptionKey = "redacted"; // Replace with your actual subscription key

 Uri endpoint = new Uri(azureEndpoint);
 AzureKeyCredential credential = new AzureKeyCredential(subscriptionKey);

 QuestionAnsweringClient client = new QuestionAnsweringClient(endpoint, credential);

 string projectName = "redacted";
 string deploymentName = "production";
 QuestionAnsweringProject project = new QuestionAnsweringProject(projectName, deploymentName);
 Response
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,438 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,350 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,557 questions
Azure AI Language
Azure AI Language
An Azure service that provides natural language capabilities including sentiment analysis, entity extraction, and automated question answering.
363 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,434 questions
{count} votes