Issue with Endpoint Configuration in Azure Chat App Tutorial

Jacopo Biancat 0 Reputation points
2024-04-18T16:41:49.5966667+00:00

Hi Everyone,

I'm trying out the following tutorial:

https://learn.microsoft.com/en-us/azure/developer/python/get-started-app-chat-evaluations?tabs=github-codespaces.

with a codespace environment and deploying everything to Azure.

At the point where I have to run the command in step 2 of Run first evaluation with a refined prompt:

python3 -m scripts evaluate --config=my_config.json --numquestions=14

I am seeing the following error:

ERROR    Failed to send a test question to the target due to error:                                                                   evaluate.py:98
                Response from target https://app-backend-5xp2xaqtv4u7c.azurewebsites.net/#/chat is not valid JSON:                                         

                <!doctype html>                                                                                                                            

                <html lang=en>                                                                                                                             

                <title>405 Method Not Allowed</title>                                                                                       

                <h1>Method Not Allowed</h1>

                <p>The method is not allowed for the requested URL.</p>

                Make sure that your configuration points at a chat endpoint that returns JSON.

       ERROR    Evaluation was terminated early due to an error ⬆                                  
```=====================================================================

It seems like I am passing the wrong URI in the configuration file since the guide specifies that the URI should end with "chat," but my URI does not terminate with "chat." Does anyone have any suggestions for how to fix this problem?

My doubt is that the tutorial works only for local deployments of the APP.

Thank you

Jacopo

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,387 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. YutongTie-MSFT 46,976 Reputation points
    2024-04-18T21:33:05.6333333+00:00

    @Jacopo Biancat

    Thanks for reaching out to us, it will be better if you post a thread in the issue page of this repo directly - https://github.com/Azure-Samples/azure-search-openai-demo/issues

    To answer this question generally, the error message you're seeing, "405 Method Not Allowed", is a common HTTP response status code indicating that the server understands the request method, but it is not supported or allowed by the chosen resource. In your case, the error message suggests that the endpoint URL you are trying to hit is not configured to accept the type of request you are making. More specifically, the endpoint you're trying to reach might not be set up to handle the chat functionality you're trying to use.

    The tutorial you're following specifies that the URI should end with "/chat". If your URI doesn't end with "/chat", it's possible that you're not hitting the right endpoint. Here's what you can do to fix this:

    Check your my_config.json file and ensure that the targetUrl is set correctly. The targetUrl should be the URL of your chat endpoint, and it should end with "/chat".

    It should look something like this:

    {  
      "targetUrl": "https://app-backend-5xp2xaqtv4u7c.azurewebsites.net/chat",  
      ...  
    }  
    

      2. Make sure that your chat app is correctly deployed on Azure and the "/chat" endpoint is enabled.

    If you're still facing the problem after checking these points, you may want to look into the deployment of your app on Azure. The tutorial should work for both local and Azure deployments, but there might be additional steps or considerations for Azure deployments. You can check the Azure documentation or contact Azure support for more help on this.

    Please have a try and let us know how it works.

    Regards,

    Yutong

    0 comments No comments