QuestionQ6

Implement generative AI and agentic solutions

You have a Microsoft Foundry project named Project1 that contains the following:

  • An OpenAPI tool that calls an external API
  • A project connection named Connection1 that stores the API key for the external API

When an agent calls the OpenAPI tool, the API returns a 401 Unauthorized error, and traces show that the API key header is not being sent.

You need to ensure that the OpenAPI tool automatically includes the API key from Connection1 on every request.

What should you do?

  • A Enable identity passthrough so that the tool uses the Microsoft Entra token of the caller.
  • B Add the API key header manually to the OpenAPI specification.
  • C Configure the tool to use the default connection of Project1.
  • D Connect the tool to Connection1.
Explanation

The Foundry OpenAPI tool only injects a stored credential into its outbound calls when the tool is explicitly bound to the connection holding that credential; if the tool is not connected to Connection1, there is no credential for the platform to attach, which is why the API key header is missing and the call returns a 401. Connecting the tool to Connection1 causes the platform to automatically attach the connection's stored API key to every request the tool makes. Identity passthrough would forward the caller's Microsoft Entra token rather than the stored API key, manually hardcoding the header in the specification defeats the purpose of storing the secret in a connection, and relying on Project1's default connection does not guarantee that default is Connection1.

Learn more

Community Discussion

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