Skip to content

Commit 26aeb94

Browse files
authored
Add overview of AI Gateway scenarios in Foundry
1 parent fc1ef7e commit 26aeb94

1 file changed

Lines changed: 65 additions & 0 deletions

File tree

0_Azure/3_AzureAI/AIFoundry/demos/12_Foundry_Overview.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,71 @@ Last updated: 2026-01-05
7070

7171
From [Bring your own AI gateway to Azure AI Agent Service (preview)](https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/ai-gateway?view=foundry)
7272

73+
> **Core Idea**: In all three cases, your **Agent service** (inside AI Foundry) sends API calls to an **AI Gateway**, which then forwards those calls to the actual AI model resource. The difference is **where the gateway lives** and **which models it connects to**.
74+
75+
**Common Pattern**:
76+
- **Agent service → Gateway → AI Resource**
77+
- Gateway abstracts the complexity of multiple AI backends.
78+
- Endpoints are consistent (`GET /models`, `POST /chat/completions`), so your agent doesn’t change when you switch backends.
79+
80+
<details>
81+
<summary> Scenario 1: APIM → Azure OpenAI </summary>
82+
83+
**Flow:**
84+
85+
1. **Agent service** calls:
86+
* `GET /models` → to list available models.
87+
* `POST /chat/completions` → to send prompts.
88+
2. These requests go through **Azure API Management (APIM)**, which acts as the gateway.
89+
3. APIM routes the requests to **Azure OpenAI Resource**.
90+
4. Azure OpenAI responds with:
91+
* Available models: `gpt-4o`, `gpt-4.1-mini`.
92+
* Chat completion results.
93+
94+
**How it works:**
95+
96+
* APIM is configured with an API that proxies to Azure OpenAI endpoints.
97+
* You set up policies for authentication and rate limiting.
98+
* Your Agent service only talks to APIM, not directly to OpenAI.
99+
100+
</details>
101+
102+
<details>
103+
<summary> Scenario 2: APIM → AI Foundry </summary>
104+
105+
**Flow:**
106+
107+
1. **Agent service** sends the same API calls (`GET /models`, `POST /chat/completions`) to APIM.
108+
2. APIM routes these requests to **AI Foundry Resource** (instead of Azure OpenAI).
109+
3. AI Foundry responds with:
110+
* Models like `gpt-4o`, `mistral-small-2503`.
111+
112+
**How it works:**
113+
114+
* Same APIM setup, but backend points to AI Foundry’s API.
115+
* Useful if you want a single gateway for multiple AI sources.
116+
117+
</details>
118+
119+
<details>
120+
<summary> Scenario 3: Self-hosted Gateway → AI Foundry</summary>
121+
122+
**Flow:**
123+
124+
1. **Agent service** sends requests to your **self-hosted gateway**.
125+
2. Gateway routes to AI Foundry Resource.
126+
3. AI Foundry responds with:
127+
* Models like `Deepseek`, `grok-3`, `gpt-5`.
128+
129+
> **How it works:**
130+
131+
- You build and host your own gateway (e.g., using NGINX, FastAPI, or Kong).
132+
- You control routing, security, and scaling.
133+
- Ideal if you need full customization or want to avoid APIM costs.
134+
135+
</details>
136+
137+
73138
> Foundry Control Plane Core Functionalities:
74139
75140
<img width="600" alt="image" src="https://github.com/user-attachments/assets/31dcc997-0eb0-424c-b843-dc58e3b89f7d" />

0 commit comments

Comments
 (0)