Azure AI Foundry agent: I can't Configure OpenAPI 3.0 Specified Tools

Andres Garcia 5 Reputation points
2025-04-24T18:15:37.9766667+00:00

I deployed a new agent in the Azure AI portal, but when I try to configure OpenAPI 3.0 Specified Tool from a JSON file, the process shows an error message with code 400.
User's image

Context: I want to give my agent the ability to connect to my service so it can perform some Jira tasks (like an MCP server). So, I prepared my service with some endpoints and made the corresponding JSON schema for it. After I set it and pressed the "create tool" button, I received that error message.
I am attaching my schema in a txt file.

schema.txt

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,621 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Prashanth Veeragoni 5,245 Reputation points Microsoft External Staff Moderator
    2025-06-04T07:37:58.53+00:00

    Hi Adarsh Devineni,

    Glad to hear adding operationId resolved your earlier issue!

    Yes, OAuth 2.0 is supported in Azure AI Foundry Agents when using OpenAPI 3.0 specifications. However, there are a few things to keep in mind:

    How to Securely Provide Client ID and Secret

    Azure AI Studio does not allow you to directly embed sensitive credentials like client_id and client_secret in the OpenAPI spec for security reasons. Instead, you should:

    1.Define OAuth2 Security Scheme in the Spec

    Add this to your components.securitySchemes section:

    "components": {
      "securitySchemes": {
        "OAuth2": {
          "type": "oauth2",
          "flows": {
            "clientCredentials": {
              "tokenUrl": "https://your-auth-server.com/oauth/token",
              "scopes": {
                "read:jira": "Read access to Jira tickets"
              }
            }
          }
        }
      }
    }
    

    2.Reference the Security Scheme in Your Endpoints

    For each secured endpoint, add:

    "security": [
      {
        "OAuth2": ["read:jira"]
      }
    ]
    

    3.Use Azure Portal to Provide Secrets

    After uploading the OpenAPI file, Azure AI Studio will detect that OAuth2 is required and prompt you to enter the Client ID and Secret via a secure UI form. These values are stored securely and not embedded into the spec.

    Hope this helps.


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.