Search code examples
azureazure-promptflow

Azure AI/ML Prompt Flow deployment returning 403 when I send a request from Postman


I am following the tutorial - https://learn.microsoft.com/en-us/azure/ai-studio/, specifically the part about deploying a prompt flow - https://learn.microsoft.com/en-us/azure/ai-studio/how-to/flow-deploy?tabs=azure-studio

I have created an AzureAI endpoint to test prompt flow deployment. When I send a request from Postman, I get 403 error

enter image description here

Why?

I am sending a post request to the endpoint which has endpoint's url, JSON body { "topic": "what is 2+2?} and api-key authorisation - key = api-key, value = value of the key.

enter image description here


Solution

  • You follow below steps.

    Add below fields in Headers tab in postman.

    Authorization - Bearer <api_key>

    azureml-model-deployment - <model_deployment_name>

    And make content type as application/json

    enter image description here

    Give input json like below.

    {
        "chat_history":[],
        "question":["what is 20/4?"]
    }
    

    Output:

    enter image description here