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.