QuestionQ4

VerifiedImplement generative AI and agentic solutions

You have a Microsoft Foundry project named Project1 that contains an agent, and the agent uses an OpenAPI 3.0 specification to call an external weather service.

The weather service requires a key that must be passed in an HTTP header, and the key value is stored as a connection in Project1.

You need to ensure that the key value from the connection is automatically included whenever the OpenAPI tool is invoked.

What should you configure in the OpenAPI specification?

Explanation

When an OpenAPI 3.0 specification declares a securitySchemes entry of type apiKey (a key passed in a header, query, or cookie), the Foundry OpenAPI tool binds that scheme to the connection associated with the tool and automatically injects the connection's stored key value into every matching request, without the caller supplying it manually. Defining a plain per-operation header parameter would require the value to be supplied at invocation time rather than sourced automatically from the connection, an Azure Key Vault connection is not how the OpenAPI tool authenticates outbound calls, and a Bearer token security scheme is intended for OAuth/JWT bearer tokens rather than a static API key header.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!