Getting "Error code: 1002. Error details: The server returned status code '401' when status code '101' was expected" for direct line speech

Aditya Azad 0 Reputation points
2023-01-15T07:33:26.2166667+00:00

I am trying to get Azure Direct Line Speech to work using this tutorial.

But I am getting "Error (ConnectionFailure) : Connection was closed by the remote host. Error code: 1002. Error details: The server returned status code '401' when status code '101' was expected." in the windows voice assistant client.

Things I have tried:

  • Creating the services in same region
  • Creating services in different regions
  • Creating the services in the same region for multiple regions
  • Contacting the Technical Customer Support
  • Going through troubleshooting FAQs
  • Checking and rechecking Keys and region in the voice assistant client
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,782 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Santhi Swaroop Naik Bukke 595 Reputation points
    2023-01-15T17:36:17.89+00:00

    This error message is typically caused by an issue with the authentication or authorization of the client trying to connect to the remote host. The status code 401 indicates that the client is not authorized to access the resource, which could be due to invalid or expired credentials or an issue with the user's permissions.

    To troubleshoot this issue, you can try the following steps:

    1. Verify that the client is using the correct credentials: Make sure that the client is using the correct username and password, and that they have not expired.
    2. Check the user's permissions: Make sure that the user has the correct permissions to access the resource.
    3. Check the remote host's access controls: Make sure that the remote host's access controls are configured correctly and that the client is not being blocked by a firewall or other security measures.
    4. Check for updates: Make sure the client is up to date, and that the client and the server are using compatible versions.
    5. Try using a different network: Attempt to connect to the remote host from a different network to see if the problem is specific to the current network.

    If the problem persists after trying these steps, you may want to seek help from the remote host's administrator or the Azure support team.

    0 comments No comments

  2. Ramr-msft 17,736 Reputation points
    2023-01-20T04:58:01.8866667+00:00

    @Aditya Azad Thanks for the question. Can you please share your Azure App service status and web socket set to On.

    Make sure you checked the "Enable Streaming Endpoint" box and/or toggled "Web sockets" to On
    Make sure your Azure App Service is running. If it is, try restarting your App Service. Also please share the Direct Speech Channel Health Status.

    We are able to connect voice assistant client without any issues.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.