The error you are encountering ("Error code: 1002") indicates that the connection to the Speech Service endpoint was closed unexpectedly, and the server returned a status code of '405' instead of the expected '101' status code.
The HTTP status code '405' typically represents a "Method Not Allowed" error, which suggests that the HTTP method being used is not supported by the endpoint. In this case, it seems that the GET method is not allowed for the /api/message
endpoint of your bot.
To resolve this issue, you can try the following steps:
- Ensure that you have correctly configured the Speech Service integration in your bot's code and that the endpoint and credentials are accurate.
- Verify that the Speech Service resource is properly configured in the Azure portal and that it is accessible.
- Double-check the code implementation and make sure that the appropriate HTTP methods, such as GET and POST, are used for the correct API endpoints. Ensure that the
HttpGet
andUseWebSockets
middleware are correctly added to your bot's code. - Review any firewall or network settings that might be blocking the connection between the client and the Speech Service endpoint.
- Check if there are any recent updates or changes to the Speech Service or Bot Framework that might require adjustments to your code or configurations.
- Monitor the Azure portal logs and application insights for any additional error details or exceptions that could provide further insight into the issue.
If the problem persists, you may consider reaching out to Azure Support for further assistance. They can help investigate the specific details of your scenario and provide tailored guidance to resolve the issue.