Plan and manage an Azure AI solution 1.1 Choose the appropriate Foundry services for generative AI and agents
A team has written an agent with LangGraph and wants to run it on Foundry Agent Service.
Study guide skill: Choose the appropriate Foundry services for generative tasks, grounding, vector search, agent workflows, or multimodal processing
Question B6-002
A team has written an agent with LangGraph and wants to run it on Foundry Agent Service. The agent must receive payment webhooks from Stripe, which posts its own payload format that the team can't change. Which option fits?
Select one answer.
Answer: C
Hosted agents run your own code from any framework, such as LangGraph, and accept webhooks or non-OpenAI payloads through the Invocations protocol. For a webhook receiver, the external system sends its own payload format, which you can't change to match /responses. Prompt agents are defined entirely through prompts and tool configuration, so they don't run your LangGraph code or accept a custom payload.
Deep dive
How it works
Foundry Agent Service runs two kinds of agents:
- Prompt-based agents are defined entirely through prompts and tool configuration in the Foundry portal.
- Hosted agents are your own code packaged as a container image.
The hosted agents page says to choose hosted agents when you need to bring your own code (any framework, including Agent Framework, LangGraph, Semantic Kernel or custom code), use custom protocols, control CPU and memory, or run stateful or long-lived work.
A hosted agent container can expose one or more protocols:
- Responses: the OpenAI-style conversational endpoint.
- Invocations: for callers that have their own protocol. It accepts webhooks or non-OpenAI payloads. The page lists the webhook receiver (GitHub, Stripe, Jira) case explicitly: the external system sends its own payload format, and you can't change it to match /responses.
- Invocations (WebSocket): the WebSocket variant of Invocations.
LangGraph code plus Stripe's fixed payload means a hosted agent that exposes Invocations.
The other options, and when you'd use them
- Prompt agent with Responses: Prompt agents don't run your LangGraph code, and Stripe can't post a Responses payload.
- Prompt agent with an OpenAPI tool to the Stripe API: That lets an agent call Stripe. It doesn't let Stripe's webhooks reach the agent, and it still doesn't run LangGraph.
- Hosted agent with only Responses: You can't reconfigure Stripe's payload to match /responses, which is the exact reason Invocations exists.
Exam tip
Own framework code = hosted agent. Caller with its own payload (webhooks) = Invocations protocol.
References
Last reviewed: