Azure AI services getting 403 error

Anonymous
2025-05-05T12:38:26.2333333+00:00

Hi I am when I am tryng to generate response by using Azure OpenAI request, for my server, I am getting, 400 bad request

Request failed with status code 403

Can you please help me ti fix this at the earliest

Foundry Tools
Foundry Tools

Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform


1 answer

Sort by: Most helpful
  1. Sina Salam 31,376 Reputation points Volunteer Moderator
    2025-05-05T19:12:44.9933333+00:00

    Hello Ishan Bhuta,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you are having 403 and 400 error.

    A 403 Forbidden error typically indicates a permissions issue. Check similar answer to your issue here. To resolve the 403 Forbidden and 400 Bad Request errors you're encountering with Azure OpenAI services, follow these steps: First, ensure that you have the correct API key and that it has the necessary permissions. Verify that the key is not expired and is correctly configured in your request. If you're using private endpoints, make sure that the network configuration allows access, and consider adding the public IP to the Azure OpenAI firewall. Additionally, verify that your user account has the required roles (e.g., Owner or Contributor) on the subscription and resource group where the resources are created.

    For the 400 Bad Request error, ensure you are using the correct API version for the model you are trying to access. Newer models might require specific API versions. Double-check the request parameters to ensure they are correctly formatted and valid, including the model name, deployment name, and any other required fields. If your network settings restrict access, ensure that the necessary IP addresses are whitelisted. Sometimes, setting the firewall to allow all networks temporarily can help identify if the issue is related to network restrictions.

    If you're using a specific model like GPT-o1, make sure your API version is set correctly in your configuration:

    model:
      provider: azure-openai
      model_name: gpt-o1
      deployment_name: your-deployment-name
      api_version: 2024-12-01-preview
    

    Save and rerun.

    I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.

    Was this answer helpful?


Your answer

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