azurefunctions-agents-runtime 0.0.0.dev6__tar.gz → 0.1.0b3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/PKG-INFO +61 -55
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/README.md +60 -54
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/pyproject.toml +4 -1
- azurefunctions_agents_runtime-0.1.0b3/src/azure_functions_agents/__init__.py +145 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/app.py +64 -9
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/client_manager.py +18 -12
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/config/__init__.py +6 -4
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/config/env.py +7 -6
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/config/loader.py +1 -1
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/config/merge.py +18 -21
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/config/paths.py +3 -2
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/config/schema.py +20 -13
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/config/validation.py +9 -5
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/discovery/mcp.py +4 -5
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/public/index.html +5 -5
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/registration/__init__.py +3 -3
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/registration/_naming.py +2 -2
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/registration/endpoints.py +39 -77
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/registration/triggers.py +1 -22
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/runner.py +30 -39
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/system_tools/sandbox.py +70 -39
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azurefunctions_agents_runtime.egg-info/PKG-INFO +61 -55
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azurefunctions_agents_runtime.egg-info/SOURCES.txt +1 -0
- azurefunctions_agents_runtime-0.1.0b3/tests/test_app.py +411 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_client_manager.py +9 -9
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_config_fixtures.py +31 -39
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_config_loader.py +7 -10
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_config_merge.py +41 -34
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_config_paths.py +2 -2
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_config_schema.py +18 -7
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_config_validation.py +45 -9
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_discovery_mcp.py +2 -2
- azurefunctions_agents_runtime-0.1.0b3/tests/test_maf_warning_suppression.py +183 -0
- azurefunctions_agents_runtime-0.1.0b3/tests/test_package_imports.py +47 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_registration_endpoints.py +82 -49
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_registration_handlers.py +17 -17
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_registration_triggers.py +15 -5
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_runner_streaming.py +30 -20
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_sandbox_session_id.py +3 -5
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_system_tools_sandbox.py +2 -2
- azurefunctions_agents_runtime-0.0.0.dev6/src/azure_functions_agents/__init__.py +0 -55
- azurefunctions_agents_runtime-0.0.0.dev6/tests/test_app.py +0 -193
- azurefunctions_agents_runtime-0.0.0.dev6/tests/test_package_imports.py +0 -22
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/LICENSE.md +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/setup.cfg +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/_blob_history.py +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/_credential.py +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/_function_tool.py +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/_logger.py +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/discovery/__init__.py +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/discovery/skills.py +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/discovery/tools.py +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/registration/_handlers.py +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/registration/capabilities.py +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azure_functions_agents/system_tools/__init__.py +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azurefunctions_agents_runtime.egg-info/dependency_links.txt +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azurefunctions_agents_runtime.egg-info/requires.txt +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/src/azurefunctions_agents_runtime.egg-info/top_level.txt +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_blob_history.py +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_config_env.py +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_discovery_skills.py +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_discovery_tools.py +0 -0
- {azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/tests/test_registration_capabilities.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: azurefunctions-agents-runtime
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.1.0b3
|
|
4
4
|
Summary: A markdown-first programming model for building AI agents on Azure Functions, powered by the Microsoft Agent Framework.
|
|
5
5
|
License: MIT
|
|
6
6
|
Requires-Python: >=3.13
|
|
@@ -58,21 +58,17 @@ azurefunctions-agents-runtime
|
|
|
58
58
|
|
|
59
59
|
## Model Provider Configuration
|
|
60
60
|
|
|
61
|
-
The runtime uses Microsoft Agent Framework, which supports
|
|
61
|
+
The runtime uses Microsoft Agent Framework, which supports Microsoft Foundry, Azure OpenAI, and OpenAI as inference back-ends. The public preview quickstart and samples use **Microsoft Foundry** as the primary path, pinned with `AZURE_FUNCTIONS_AGENTS_PROVIDER=foundry`.
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
| Provider | `AZURE_FUNCTIONS_AGENTS_PROVIDER` | Required env vars | Notes |
|
|
64
|
+
| --- | --- | --- | --- |
|
|
65
|
+
| Microsoft Foundry | `foundry` | `FOUNDRY_PROJECT_ENDPOINT`, `FOUNDRY_MODEL` | Recommended quickstart/sample path. Uses `DefaultAzureCredential`; run `az login` locally and set `AZURE_CLIENT_ID` in multi-identity Function Apps. |
|
|
66
|
+
| Azure OpenAI | `azure_openai` | `AZURE_OPENAI_ENDPOINT`, `AZURE_OPENAI_DEPLOYMENT`, optional `AZURE_OPENAI_API_VERSION` | Alternative Azure-hosted provider. `AZURE_OPENAI_DEPLOYMENT` takes precedence over `AZURE_FUNCTIONS_AGENTS_MODEL`. If `AZURE_OPENAI_API_KEY` is omitted the SDK uses `DefaultAzureCredential` (AAD). |
|
|
67
|
+
| OpenAI | `openai` | `OPENAI_API_KEY`, optional `AZURE_FUNCTIONS_AGENTS_MODEL` (default `gpt-4o-mini`) | Alternative non-Azure provider. `AZURE_FUNCTIONS_AGENTS_MODEL` applies directly for OpenAI. |
|
|
66
68
|
|
|
67
|
-
|
|
69
|
+
If `AZURE_FUNCTIONS_AGENTS_PROVIDER` is unset, auto-detection picks the first provider whose env vars are set, in this order: `AZURE_OPENAI_ENDPOINT` → `FOUNDRY_PROJECT_ENDPOINT` → `OPENAI_API_KEY`. Set `AZURE_FUNCTIONS_AGENTS_PROVIDER` to make the provider choice intentional.
|
|
68
70
|
|
|
69
|
-
|
|
70
|
-
| ----------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
71
|
-
| OpenAI | `OPENAI_API_KEY`, optional `MAF_MODEL` (default `gpt-4o-mini`) | `MAF_MODEL` applies directly for OpenAI. |
|
|
72
|
-
| Azure OpenAI | `AZURE_OPENAI_ENDPOINT`, `AZURE_OPENAI_DEPLOYMENT`, optional `AZURE_OPENAI_API_VERSION` | `AZURE_OPENAI_DEPLOYMENT` takes precedence over `MAF_MODEL`. If `AZURE_OPENAI_API_KEY` is omitted the SDK uses `DefaultAzureCredential` (AAD); set `AZURE_CLIENT_ID` in multi-identity Function Apps. |
|
|
73
|
-
| Microsoft Foundry | `FOUNDRY_PROJECT_ENDPOINT`, optional `FOUNDRY_MODEL` | `FOUNDRY_MODEL` takes precedence over `MAF_MODEL`. Uses `DefaultAzureCredential`; set `AZURE_CLIENT_ID` in multi-identity Function Apps. |
|
|
74
|
-
|
|
75
|
-
Model resolution precedence is: explicit requested model > provider-specific env (`AZURE_OPENAI_DEPLOYMENT` for Azure OpenAI, `FOUNDRY_MODEL` for Foundry) > `MAF_MODEL` > provider default.
|
|
71
|
+
Model resolution precedence is: explicit requested model > provider-specific env (`FOUNDRY_MODEL` for Foundry, `AZURE_OPENAI_DEPLOYMENT` for Azure OpenAI) > `AZURE_FUNCTIONS_AGENTS_MODEL` > provider default.
|
|
76
72
|
|
|
77
73
|
## Quick Start
|
|
78
74
|
|
|
@@ -84,6 +80,8 @@ Create `main.agent.md`:
|
|
|
84
80
|
---
|
|
85
81
|
name: My Agent
|
|
86
82
|
description: A helpful assistant
|
|
83
|
+
|
|
84
|
+
builtin_endpoints: true
|
|
87
85
|
---
|
|
88
86
|
|
|
89
87
|
You are a helpful assistant. Answer questions concisely.
|
|
@@ -101,7 +99,15 @@ app = create_function_app()
|
|
|
101
99
|
|
|
102
100
|
> The app root is auto-detected from `AzureWebJobsScriptRoot` (set by `func start` and the Azure Functions host). You can override it with `create_function_app(app_root=Path(__file__).parent)` or the `AZURE_FUNCTIONS_AGENTS_APP_ROOT` env var.
|
|
103
101
|
|
|
104
|
-
### 3. Create `
|
|
102
|
+
### 3. Create `agents.config.yaml`
|
|
103
|
+
|
|
104
|
+
```yaml
|
|
105
|
+
# Default runtime configuration
|
|
106
|
+
model: $FOUNDRY_MODEL
|
|
107
|
+
timeout: 900
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 4. Create `host.json`
|
|
105
111
|
|
|
106
112
|
```json
|
|
107
113
|
{
|
|
@@ -118,7 +124,7 @@ app = create_function_app()
|
|
|
118
124
|
}
|
|
119
125
|
```
|
|
120
126
|
|
|
121
|
-
###
|
|
127
|
+
### 5. Create `requirements.txt`
|
|
122
128
|
|
|
123
129
|
```
|
|
124
130
|
azurefunctions-agents-runtime
|
|
@@ -126,9 +132,9 @@ azurefunctions-agents-runtime
|
|
|
126
132
|
|
|
127
133
|
Connector-backed tools are exposed through MCP servers in `mcp.json`, and connector-triggered apps use the Azure Functions Connector Extension through the Functions extension bundle. No package extra is required.
|
|
128
134
|
|
|
129
|
-
###
|
|
135
|
+
### 6. Set the model provider
|
|
130
136
|
|
|
131
|
-
For local development with
|
|
137
|
+
For local development with Microsoft Foundry, sign in with `az login`, then create `local.settings.json`:
|
|
132
138
|
|
|
133
139
|
```json
|
|
134
140
|
{
|
|
@@ -136,13 +142,14 @@ For local development with OpenAI:
|
|
|
136
142
|
"Values": {
|
|
137
143
|
"FUNCTIONS_WORKER_RUNTIME": "python",
|
|
138
144
|
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
|
|
139
|
-
"
|
|
140
|
-
"
|
|
145
|
+
"AZURE_FUNCTIONS_AGENTS_PROVIDER": "foundry",
|
|
146
|
+
"FOUNDRY_PROJECT_ENDPOINT": "https://<project-name>.<region>.services.ai.azure.com/api/projects/<project-name>",
|
|
147
|
+
"FOUNDRY_MODEL": "gpt-5.4"
|
|
141
148
|
}
|
|
142
149
|
}
|
|
143
150
|
```
|
|
144
151
|
|
|
145
|
-
###
|
|
152
|
+
### 7. Start Azurite (local storage emulator)
|
|
146
153
|
|
|
147
154
|
The MCP server endpoint and non-HTTP triggers (timer, queue, blob, etc.) require a storage account. Locally, use [Azurite](https://learn.microsoft.com/azure/storage/common/storage-use-azurite) via Docker:
|
|
148
155
|
|
|
@@ -152,28 +159,28 @@ docker run -d --name azurite -p 10000:10000 -p 10001:10001 -p 10002:10002 \
|
|
|
152
159
|
azurite --skipApiVersionCheck --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0
|
|
153
160
|
```
|
|
154
161
|
|
|
155
|
-
###
|
|
162
|
+
### 8. Run locally
|
|
156
163
|
|
|
157
164
|
```bash
|
|
158
165
|
func start
|
|
159
166
|
```
|
|
160
167
|
|
|
161
|
-
Your agent is now running at `http://localhost:7071/` with a built-in chat UI, HTTP API (`/
|
|
168
|
+
Your agent is now running at `http://localhost:7071/agents/main/` with a built-in chat UI, HTTP API (`/agents/main/chat`, `/agents/main/chatstream`), and MCP tool exposed through the Functions MCP endpoint (`/runtime/webhooks/mcp`).
|
|
162
169
|
|
|
163
170
|
## Features
|
|
164
171
|
|
|
165
172
|
**Architecture overview:** see [`docs/architecture.md`](docs/architecture.md) for the module map and data flow pipeline.
|
|
166
173
|
|
|
167
|
-
###
|
|
174
|
+
### Built-in endpoints
|
|
168
175
|
|
|
169
|
-
|
|
176
|
+
Any `.agent.md` file can opt into built-in endpoints with `builtin_endpoints`. The route slug comes from the `.agent.md` filename after sanitization, not from the display `name:` field.
|
|
170
177
|
|
|
171
|
-
- **
|
|
172
|
-
- **HTTP APIs** — `POST /
|
|
173
|
-
- **MCP
|
|
178
|
+
- **Debug chat UI** — built-in single-page web interface at `/agents/{slug}/`
|
|
179
|
+
- **HTTP APIs** — `POST /agents/{slug}/chat` (JSON) and `POST /agents/{slug}/chatstream` (SSE)
|
|
180
|
+
- **MCP tool** — optional tool exposed through `/runtime/webhooks/mcp` for VS Code, Claude Desktop, etc.
|
|
174
181
|
- **Session persistence** — multi-turn conversations stored in Azure Blob Storage via the runtime's `BlobHistoryProvider`, reusing the function app's `AzureWebJobsStorage` account
|
|
175
182
|
|
|
176
|
-
|
|
183
|
+
If any built-in endpoint is enabled, `trigger` is optional. This allows endpoint-only agents as well as triggered agents that also expose a chat UI or API. `builtin_endpoints.debug_chat_ui: true` automatically enables the backing chat APIs. `builtin_endpoints: true` is shorthand for enabling all built-in endpoints, including the MCP tool. See [`docs/front-matter-spec.md#builtin_endpoints`](docs/front-matter-spec.md#builtin_endpoints).
|
|
177
184
|
|
|
178
185
|
### Event-driven agents (`<name>.agent.md`)
|
|
179
186
|
|
|
@@ -201,10 +208,10 @@ description: What this agent does
|
|
|
201
208
|
|
|
202
209
|
# Optional: system tools (code execution)
|
|
203
210
|
system_tools:
|
|
204
|
-
|
|
205
|
-
|
|
211
|
+
dynamic_sessions_code_interpreter:
|
|
212
|
+
endpoint: $ACA_SESSION_POOL_ENDPOINT
|
|
206
213
|
|
|
207
|
-
#
|
|
214
|
+
# Optional when builtin_endpoints is enabled; required otherwise:
|
|
208
215
|
trigger:
|
|
209
216
|
type: timer_trigger # or queue_trigger, connector_trigger, etc.
|
|
210
217
|
args:
|
|
@@ -228,8 +235,8 @@ Agent instructions in markdown...
|
|
|
228
235
|
|
|
229
236
|
### Multiple functions from markdown
|
|
230
237
|
|
|
231
|
-
-
|
|
232
|
-
-
|
|
238
|
+
- **`*.agent.md` with `trigger`** — creates an event-triggered Azure Function. Exactly one trigger per file.
|
|
239
|
+
- **`*.agent.md` with `builtin_endpoints`** — also serves `/agents/{slug}/`, `/agents/{slug}/chat`, and `/agents/{slug}/chatstream` when chat endpoints are enabled, and can expose an MCP tool when `builtin_endpoints: true` or `builtin_endpoints.mcp: true`. The sanitized filename stem becomes the base Azure Function name and endpoint slug. If two agent files sanitize to the same name (for example, `daily-report.agent.md` and `daily_report.agent.md`), the runtime auto-suffixes both the Azure Function name and the built-in endpoint slug (`_2`, `_3`, ...), keeping them paired in practice (`daily_report_2` ↔ `/agents/daily_report_2/`). The frontmatter `name:` field is display-only. See [`docs/front-matter-spec.md#function-name-resolution`](docs/front-matter-spec.md#function-name-resolution) and [`docs/front-matter-spec.md#builtin_endpoints`](docs/front-matter-spec.md#builtin_endpoints).
|
|
233
240
|
|
|
234
241
|
When a triggered function runs, the agent's markdown body is used as the system instructions. The prompt sent to the agent includes the trigger type and the serialized binding data:
|
|
235
242
|
|
|
@@ -295,8 +302,8 @@ Variable references are resolved inline at load time anywhere string values are
|
|
|
295
302
|
name: Notifier
|
|
296
303
|
description: Sends updates to $TEAM_NAME
|
|
297
304
|
system_tools:
|
|
298
|
-
|
|
299
|
-
|
|
305
|
+
dynamic_sessions_code_interpreter:
|
|
306
|
+
endpoint: "https://$HOST/api"
|
|
300
307
|
---
|
|
301
308
|
|
|
302
309
|
Send a daily summary email to $TO_EMAIL.
|
|
@@ -305,7 +312,7 @@ Post a message to the %TEAM_NAME% team's General channel.
|
|
|
305
312
|
|
|
306
313
|
If `HOST=contoso.internal`, `TO_EMAIL=alice@example.com`, and `TEAM_NAME=Engineering` are set in the environment, those values resolve inline:
|
|
307
314
|
|
|
308
|
-
> `
|
|
315
|
+
> `endpoint: "https://contoso.internal/api"`
|
|
309
316
|
>
|
|
310
317
|
> Send a daily summary email to alice@example.com.
|
|
311
318
|
>
|
|
@@ -346,13 +353,13 @@ def reverse_string(text: str) -> str:
|
|
|
346
353
|
|
|
347
354
|
`@tool` is re-exported from `agent_framework`. Functions can be sync or async; types in the signature feed MAF's automatic JSON-Schema generation. Tools that need richer schemas can be declared with `agent_framework.FunctionTool` directly.
|
|
348
355
|
|
|
349
|
-
##
|
|
356
|
+
## Built-in Endpoint Routes
|
|
350
357
|
|
|
351
|
-
|
|
358
|
+
Built-in endpoints are explicit per agent. The filename stem determines `{slug}`; for example, `main.agent.md` uses `main` and `daily_azure_report.agent.md` uses `daily_azure_report`.
|
|
352
359
|
|
|
353
360
|
### Chat UI
|
|
354
361
|
|
|
355
|
-
A built-in single-page chat interface served at
|
|
362
|
+
A built-in single-page chat interface served at `/agents/{slug}/` when `builtin_endpoints.debug_chat_ui: true` (or `builtin_endpoints: true`). No frontend code needed — just open `http://localhost:7071/agents/main/` locally for `main.agent.md`, or `https://<your-app>.azurewebsites.net/agents/{slug}/` when deployed. See [`docs/front-matter-spec.md#function-name-resolution`](docs/front-matter-spec.md#function-name-resolution).
|
|
356
363
|
|
|
357
364
|
On first load, you'll be prompted for the base URL and a function key (for deployed apps). These are stored in browser local storage and can be changed via the gear icon.
|
|
358
365
|
|
|
@@ -360,8 +367,7 @@ On first load, you'll be prompted for the base URL and a function key (for deplo
|
|
|
360
367
|
|
|
361
368
|
POST endpoints for programmatic access:
|
|
362
369
|
|
|
363
|
-
- **
|
|
364
|
-
- **Non-main agent with `debug.chat: true`:** `POST /agents/{slug}/chat` and `POST /agents/{slug}/chatstream` (`{slug}` comes from the `.agent.md` filename after sanitization)
|
|
370
|
+
- **Any agent with `builtin_endpoints.chat_api: true`:** `POST /agents/{slug}/chat` and `POST /agents/{slug}/chatstream`
|
|
365
371
|
|
|
366
372
|
The JSON endpoint returns `session_id`, `response`, and `tool_calls`. The streaming endpoint uses Server-Sent Events (SSE) with `session`, `delta`, `intermediate`, `tool_start`, `tool_end`, `done`, and `error` events.
|
|
367
373
|
|
|
@@ -369,11 +375,11 @@ Pass `x-ms-session-id` header to continue a conversation across requests. If omi
|
|
|
369
375
|
|
|
370
376
|
### MCP Server
|
|
371
377
|
|
|
372
|
-
|
|
378
|
+
When `builtin_endpoints: true` or `builtin_endpoints.mcp: true`, the agent is exposed as an MCP tool named after its slug through the shared MCP-compatible endpoint at `/runtime/webhooks/mcp`. Requires the MCP extension system key in the `x-functions-key` header when deployed.
|
|
373
379
|
|
|
374
|
-
### Without
|
|
380
|
+
### Without built-in endpoints
|
|
375
381
|
|
|
376
|
-
If
|
|
382
|
+
If no agent enables built-in endpoints, no chat UI, chat API, chatstream, or agent MCP tool is registered. The app still runs triggered functions. See [`docs/front-matter-spec.md#builtin_endpoints`](docs/front-matter-spec.md#builtin_endpoints).
|
|
377
383
|
|
|
378
384
|
## MCP Server Configuration
|
|
379
385
|
|
|
@@ -402,7 +408,6 @@ String values in `mcp.json` support inline environment-variable substitution wit
|
|
|
402
408
|
"type": "http",
|
|
403
409
|
"url": "$O365_MCP_SERVER_URL",
|
|
404
410
|
"tools": ["office365_SendEmailV2"],
|
|
405
|
-
"load_prompts": false,
|
|
406
411
|
"auth": {
|
|
407
412
|
"scope": "https://apihub.azure.com/.default",
|
|
408
413
|
"client_id": "$O365_MCP_CLIENT_ID"
|
|
@@ -418,10 +423,10 @@ Tools from configured MCP servers are automatically available to the agent at ru
|
|
|
418
423
|
- **`url`** — the MCP server endpoint URL (required)
|
|
419
424
|
- **`headers`** — optional HTTP headers (e.g. for authentication)
|
|
420
425
|
- **`tools`** — optional array of tool name patterns to allow (default: `["*"]`)
|
|
421
|
-
- **`load_tools`** — optional boolean controlling whether tools are loaded from the MCP server (default: `true`)
|
|
422
|
-
- **`load_prompts`** — optional boolean controlling whether prompts are loaded from the MCP server (default: `true`). Set this to `false` for MCP servers that do not implement `prompts/list`.
|
|
423
426
|
- **`auth`** — optional Azure Identity authentication configuration. Set `auth.scope` to the token scope required by the MCP server. The runtime uses `DefaultAzureCredential` to acquire the token.
|
|
424
427
|
|
|
428
|
+
The runtime loads MCP tools and skips MCP prompts. This avoids startup/runtime failures from connector-backed MCP servers that support tools but reject `prompts/list`.
|
|
429
|
+
|
|
425
430
|
By default, MCP auth follows the app-wide identity selection: `AZURE_CLIENT_ID` when set, otherwise the system-assigned identity/default Azure credential chain. To choose a user-assigned managed identity for a single MCP server without changing the app-wide identity, set `auth.client_id` in that server's `mcp.json` entry. If the configured client ID is empty or an unresolved placeholder, the runtime falls back to the app-wide identity selection.
|
|
426
431
|
|
|
427
432
|
> **Note**: Entries without a `url`, with unresolved placeholders in `url`, or with a `type` other than `"http"` / `"streamable-http"`, are ignored with a warning. Use the remote HTTP transport instead.
|
|
@@ -445,7 +450,7 @@ Multi-turn conversations are persisted as JSON Lines, one record per message:
|
|
|
445
450
|
- **Local dev fallback.** When neither `AzureWebJobsStorage` nor
|
|
446
451
|
`AzureWebJobsStorage__blobServiceUri` is set, history falls back to MAF's
|
|
447
452
|
`FileHistoryProvider` writing to
|
|
448
|
-
`{
|
|
453
|
+
`{AZURE_FUNCTIONS_AGENTS_SESSION_DIR}/agent-sessions/{session_id}.jsonl`,
|
|
449
454
|
defaulting to `~/.azure-functions-agents/agent-sessions/`.
|
|
450
455
|
|
|
451
456
|
Session ids must match `^[A-Za-z0-9._-]{1,128}$` — anything else is rejected at the API boundary.
|
|
@@ -465,20 +470,21 @@ See the [`samples/`](samples/) directory for complete, deployable example apps:
|
|
|
465
470
|
|
|
466
471
|
### Required Azure App Settings
|
|
467
472
|
|
|
468
|
-
Set the model provider env vars described above (
|
|
473
|
+
Set the model provider env vars described above. The preview samples use Microsoft Foundry (`AZURE_FUNCTIONS_AGENTS_PROVIDER=foundry`, `FOUNDRY_PROJECT_ENDPOINT`, and `FOUNDRY_MODEL`). Azure OpenAI (`AZURE_OPENAI_ENDPOINT` + `AZURE_OPENAI_DEPLOYMENT`) and OpenAI (`OPENAI_API_KEY` and optionally `AZURE_FUNCTIONS_AGENTS_MODEL`) are supported alternatives. For Microsoft Foundry and Azure OpenAI, the provider-specific model/deployment setting takes precedence over `AZURE_FUNCTIONS_AGENTS_MODEL`.
|
|
469
474
|
|
|
470
|
-
When the agent uses connector-backed MCP servers, connector triggers, or `
|
|
475
|
+
When the agent uses connector-backed MCP servers, connector triggers, or `dynamic_sessions_code_interpreter`, the function app's **system-assigned or user-assigned Managed Identity** must be enabled and granted access to the target resource — otherwise `DefaultAzureCredential` will fail to obtain a token. In multi-identity Function Apps, set `AZURE_CLIENT_ID` so the runtime uses the intended managed identity for Azure OpenAI, Foundry, blob-backed session storage, ACA Dynamic Sessions, and ARM/data-plane connector calls. For an individual MCP server, set `auth.client_id` in `mcp.json` to choose a different managed identity just for that server. For an individual code interpreter pool, set `system_tools.dynamic_sessions_code_interpreter.client_id`.
|
|
471
476
|
|
|
472
477
|
### Optional config overrides
|
|
473
478
|
|
|
474
479
|
| Setting | Purpose |
|
|
475
480
|
|---|---|
|
|
476
481
|
| `AZURE_FUNCTIONS_AGENTS_APP_ROOT` | Override the app root used to discover `*.agent.md`, `tools/`, `skills/`, and `mcp.json` |
|
|
477
|
-
| `
|
|
478
|
-
| `
|
|
479
|
-
| `
|
|
480
|
-
| `
|
|
481
|
-
| `
|
|
482
|
+
| `AZURE_FUNCTIONS_AGENTS_SESSION_DIR` | Override the directory used for local session storage |
|
|
483
|
+
| `AZURE_FUNCTIONS_AGENTS_TIMEOUT_SECONDS` | Per-call timeout in seconds (default `900`) |
|
|
484
|
+
| `AZURE_FUNCTIONS_AGENTS_PROVIDER` | Pin the model provider (`openai`/`azure_openai`/`foundry`) and skip auto-detection |
|
|
485
|
+
| `AZURE_FUNCTIONS_AGENTS_MODEL` | Runtime-owned model fallback when no provider-specific model/deployment is set |
|
|
486
|
+
| `AZURE_FUNCTIONS_AGENTS_REASONING_EFFORT` | Optional reasoning effort for supported reasoning models (valid values include `none`, `low`, `medium`, `high`, `xhigh`) |
|
|
487
|
+
| `AZURE_FUNCTIONS_AGENTS_REASONING_SUMMARY` | Optional reasoning summary mode for supported reasoning models (valid values are `auto`, `concise`, `detailed`) |
|
|
482
488
|
|
|
483
489
|
## Development
|
|
484
490
|
|
{azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/README.md
RENAMED
|
@@ -29,21 +29,17 @@ azurefunctions-agents-runtime
|
|
|
29
29
|
|
|
30
30
|
## Model Provider Configuration
|
|
31
31
|
|
|
32
|
-
The runtime uses Microsoft Agent Framework, which supports
|
|
32
|
+
The runtime uses Microsoft Agent Framework, which supports Microsoft Foundry, Azure OpenAI, and OpenAI as inference back-ends. The public preview quickstart and samples use **Microsoft Foundry** as the primary path, pinned with `AZURE_FUNCTIONS_AGENTS_PROVIDER=foundry`.
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
| Provider | `AZURE_FUNCTIONS_AGENTS_PROVIDER` | Required env vars | Notes |
|
|
35
|
+
| --- | --- | --- | --- |
|
|
36
|
+
| Microsoft Foundry | `foundry` | `FOUNDRY_PROJECT_ENDPOINT`, `FOUNDRY_MODEL` | Recommended quickstart/sample path. Uses `DefaultAzureCredential`; run `az login` locally and set `AZURE_CLIENT_ID` in multi-identity Function Apps. |
|
|
37
|
+
| Azure OpenAI | `azure_openai` | `AZURE_OPENAI_ENDPOINT`, `AZURE_OPENAI_DEPLOYMENT`, optional `AZURE_OPENAI_API_VERSION` | Alternative Azure-hosted provider. `AZURE_OPENAI_DEPLOYMENT` takes precedence over `AZURE_FUNCTIONS_AGENTS_MODEL`. If `AZURE_OPENAI_API_KEY` is omitted the SDK uses `DefaultAzureCredential` (AAD). |
|
|
38
|
+
| OpenAI | `openai` | `OPENAI_API_KEY`, optional `AZURE_FUNCTIONS_AGENTS_MODEL` (default `gpt-4o-mini`) | Alternative non-Azure provider. `AZURE_FUNCTIONS_AGENTS_MODEL` applies directly for OpenAI. |
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
If `AZURE_FUNCTIONS_AGENTS_PROVIDER` is unset, auto-detection picks the first provider whose env vars are set, in this order: `AZURE_OPENAI_ENDPOINT` → `FOUNDRY_PROJECT_ENDPOINT` → `OPENAI_API_KEY`. Set `AZURE_FUNCTIONS_AGENTS_PROVIDER` to make the provider choice intentional.
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
| ----------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
42
|
-
| OpenAI | `OPENAI_API_KEY`, optional `MAF_MODEL` (default `gpt-4o-mini`) | `MAF_MODEL` applies directly for OpenAI. |
|
|
43
|
-
| Azure OpenAI | `AZURE_OPENAI_ENDPOINT`, `AZURE_OPENAI_DEPLOYMENT`, optional `AZURE_OPENAI_API_VERSION` | `AZURE_OPENAI_DEPLOYMENT` takes precedence over `MAF_MODEL`. If `AZURE_OPENAI_API_KEY` is omitted the SDK uses `DefaultAzureCredential` (AAD); set `AZURE_CLIENT_ID` in multi-identity Function Apps. |
|
|
44
|
-
| Microsoft Foundry | `FOUNDRY_PROJECT_ENDPOINT`, optional `FOUNDRY_MODEL` | `FOUNDRY_MODEL` takes precedence over `MAF_MODEL`. Uses `DefaultAzureCredential`; set `AZURE_CLIENT_ID` in multi-identity Function Apps. |
|
|
45
|
-
|
|
46
|
-
Model resolution precedence is: explicit requested model > provider-specific env (`AZURE_OPENAI_DEPLOYMENT` for Azure OpenAI, `FOUNDRY_MODEL` for Foundry) > `MAF_MODEL` > provider default.
|
|
42
|
+
Model resolution precedence is: explicit requested model > provider-specific env (`FOUNDRY_MODEL` for Foundry, `AZURE_OPENAI_DEPLOYMENT` for Azure OpenAI) > `AZURE_FUNCTIONS_AGENTS_MODEL` > provider default.
|
|
47
43
|
|
|
48
44
|
## Quick Start
|
|
49
45
|
|
|
@@ -55,6 +51,8 @@ Create `main.agent.md`:
|
|
|
55
51
|
---
|
|
56
52
|
name: My Agent
|
|
57
53
|
description: A helpful assistant
|
|
54
|
+
|
|
55
|
+
builtin_endpoints: true
|
|
58
56
|
---
|
|
59
57
|
|
|
60
58
|
You are a helpful assistant. Answer questions concisely.
|
|
@@ -72,7 +70,15 @@ app = create_function_app()
|
|
|
72
70
|
|
|
73
71
|
> The app root is auto-detected from `AzureWebJobsScriptRoot` (set by `func start` and the Azure Functions host). You can override it with `create_function_app(app_root=Path(__file__).parent)` or the `AZURE_FUNCTIONS_AGENTS_APP_ROOT` env var.
|
|
74
72
|
|
|
75
|
-
### 3. Create `
|
|
73
|
+
### 3. Create `agents.config.yaml`
|
|
74
|
+
|
|
75
|
+
```yaml
|
|
76
|
+
# Default runtime configuration
|
|
77
|
+
model: $FOUNDRY_MODEL
|
|
78
|
+
timeout: 900
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 4. Create `host.json`
|
|
76
82
|
|
|
77
83
|
```json
|
|
78
84
|
{
|
|
@@ -89,7 +95,7 @@ app = create_function_app()
|
|
|
89
95
|
}
|
|
90
96
|
```
|
|
91
97
|
|
|
92
|
-
###
|
|
98
|
+
### 5. Create `requirements.txt`
|
|
93
99
|
|
|
94
100
|
```
|
|
95
101
|
azurefunctions-agents-runtime
|
|
@@ -97,9 +103,9 @@ azurefunctions-agents-runtime
|
|
|
97
103
|
|
|
98
104
|
Connector-backed tools are exposed through MCP servers in `mcp.json`, and connector-triggered apps use the Azure Functions Connector Extension through the Functions extension bundle. No package extra is required.
|
|
99
105
|
|
|
100
|
-
###
|
|
106
|
+
### 6. Set the model provider
|
|
101
107
|
|
|
102
|
-
For local development with
|
|
108
|
+
For local development with Microsoft Foundry, sign in with `az login`, then create `local.settings.json`:
|
|
103
109
|
|
|
104
110
|
```json
|
|
105
111
|
{
|
|
@@ -107,13 +113,14 @@ For local development with OpenAI:
|
|
|
107
113
|
"Values": {
|
|
108
114
|
"FUNCTIONS_WORKER_RUNTIME": "python",
|
|
109
115
|
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
|
|
110
|
-
"
|
|
111
|
-
"
|
|
116
|
+
"AZURE_FUNCTIONS_AGENTS_PROVIDER": "foundry",
|
|
117
|
+
"FOUNDRY_PROJECT_ENDPOINT": "https://<project-name>.<region>.services.ai.azure.com/api/projects/<project-name>",
|
|
118
|
+
"FOUNDRY_MODEL": "gpt-5.4"
|
|
112
119
|
}
|
|
113
120
|
}
|
|
114
121
|
```
|
|
115
122
|
|
|
116
|
-
###
|
|
123
|
+
### 7. Start Azurite (local storage emulator)
|
|
117
124
|
|
|
118
125
|
The MCP server endpoint and non-HTTP triggers (timer, queue, blob, etc.) require a storage account. Locally, use [Azurite](https://learn.microsoft.com/azure/storage/common/storage-use-azurite) via Docker:
|
|
119
126
|
|
|
@@ -123,28 +130,28 @@ docker run -d --name azurite -p 10000:10000 -p 10001:10001 -p 10002:10002 \
|
|
|
123
130
|
azurite --skipApiVersionCheck --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0
|
|
124
131
|
```
|
|
125
132
|
|
|
126
|
-
###
|
|
133
|
+
### 8. Run locally
|
|
127
134
|
|
|
128
135
|
```bash
|
|
129
136
|
func start
|
|
130
137
|
```
|
|
131
138
|
|
|
132
|
-
Your agent is now running at `http://localhost:7071/` with a built-in chat UI, HTTP API (`/
|
|
139
|
+
Your agent is now running at `http://localhost:7071/agents/main/` with a built-in chat UI, HTTP API (`/agents/main/chat`, `/agents/main/chatstream`), and MCP tool exposed through the Functions MCP endpoint (`/runtime/webhooks/mcp`).
|
|
133
140
|
|
|
134
141
|
## Features
|
|
135
142
|
|
|
136
143
|
**Architecture overview:** see [`docs/architecture.md`](docs/architecture.md) for the module map and data flow pipeline.
|
|
137
144
|
|
|
138
|
-
###
|
|
145
|
+
### Built-in endpoints
|
|
139
146
|
|
|
140
|
-
|
|
147
|
+
Any `.agent.md` file can opt into built-in endpoints with `builtin_endpoints`. The route slug comes from the `.agent.md` filename after sanitization, not from the display `name:` field.
|
|
141
148
|
|
|
142
|
-
- **
|
|
143
|
-
- **HTTP APIs** — `POST /
|
|
144
|
-
- **MCP
|
|
149
|
+
- **Debug chat UI** — built-in single-page web interface at `/agents/{slug}/`
|
|
150
|
+
- **HTTP APIs** — `POST /agents/{slug}/chat` (JSON) and `POST /agents/{slug}/chatstream` (SSE)
|
|
151
|
+
- **MCP tool** — optional tool exposed through `/runtime/webhooks/mcp` for VS Code, Claude Desktop, etc.
|
|
145
152
|
- **Session persistence** — multi-turn conversations stored in Azure Blob Storage via the runtime's `BlobHistoryProvider`, reusing the function app's `AzureWebJobsStorage` account
|
|
146
153
|
|
|
147
|
-
|
|
154
|
+
If any built-in endpoint is enabled, `trigger` is optional. This allows endpoint-only agents as well as triggered agents that also expose a chat UI or API. `builtin_endpoints.debug_chat_ui: true` automatically enables the backing chat APIs. `builtin_endpoints: true` is shorthand for enabling all built-in endpoints, including the MCP tool. See [`docs/front-matter-spec.md#builtin_endpoints`](docs/front-matter-spec.md#builtin_endpoints).
|
|
148
155
|
|
|
149
156
|
### Event-driven agents (`<name>.agent.md`)
|
|
150
157
|
|
|
@@ -172,10 +179,10 @@ description: What this agent does
|
|
|
172
179
|
|
|
173
180
|
# Optional: system tools (code execution)
|
|
174
181
|
system_tools:
|
|
175
|
-
|
|
176
|
-
|
|
182
|
+
dynamic_sessions_code_interpreter:
|
|
183
|
+
endpoint: $ACA_SESSION_POOL_ENDPOINT
|
|
177
184
|
|
|
178
|
-
#
|
|
185
|
+
# Optional when builtin_endpoints is enabled; required otherwise:
|
|
179
186
|
trigger:
|
|
180
187
|
type: timer_trigger # or queue_trigger, connector_trigger, etc.
|
|
181
188
|
args:
|
|
@@ -199,8 +206,8 @@ Agent instructions in markdown...
|
|
|
199
206
|
|
|
200
207
|
### Multiple functions from markdown
|
|
201
208
|
|
|
202
|
-
-
|
|
203
|
-
-
|
|
209
|
+
- **`*.agent.md` with `trigger`** — creates an event-triggered Azure Function. Exactly one trigger per file.
|
|
210
|
+
- **`*.agent.md` with `builtin_endpoints`** — also serves `/agents/{slug}/`, `/agents/{slug}/chat`, and `/agents/{slug}/chatstream` when chat endpoints are enabled, and can expose an MCP tool when `builtin_endpoints: true` or `builtin_endpoints.mcp: true`. The sanitized filename stem becomes the base Azure Function name and endpoint slug. If two agent files sanitize to the same name (for example, `daily-report.agent.md` and `daily_report.agent.md`), the runtime auto-suffixes both the Azure Function name and the built-in endpoint slug (`_2`, `_3`, ...), keeping them paired in practice (`daily_report_2` ↔ `/agents/daily_report_2/`). The frontmatter `name:` field is display-only. See [`docs/front-matter-spec.md#function-name-resolution`](docs/front-matter-spec.md#function-name-resolution) and [`docs/front-matter-spec.md#builtin_endpoints`](docs/front-matter-spec.md#builtin_endpoints).
|
|
204
211
|
|
|
205
212
|
When a triggered function runs, the agent's markdown body is used as the system instructions. The prompt sent to the agent includes the trigger type and the serialized binding data:
|
|
206
213
|
|
|
@@ -266,8 +273,8 @@ Variable references are resolved inline at load time anywhere string values are
|
|
|
266
273
|
name: Notifier
|
|
267
274
|
description: Sends updates to $TEAM_NAME
|
|
268
275
|
system_tools:
|
|
269
|
-
|
|
270
|
-
|
|
276
|
+
dynamic_sessions_code_interpreter:
|
|
277
|
+
endpoint: "https://$HOST/api"
|
|
271
278
|
---
|
|
272
279
|
|
|
273
280
|
Send a daily summary email to $TO_EMAIL.
|
|
@@ -276,7 +283,7 @@ Post a message to the %TEAM_NAME% team's General channel.
|
|
|
276
283
|
|
|
277
284
|
If `HOST=contoso.internal`, `TO_EMAIL=alice@example.com`, and `TEAM_NAME=Engineering` are set in the environment, those values resolve inline:
|
|
278
285
|
|
|
279
|
-
> `
|
|
286
|
+
> `endpoint: "https://contoso.internal/api"`
|
|
280
287
|
>
|
|
281
288
|
> Send a daily summary email to alice@example.com.
|
|
282
289
|
>
|
|
@@ -317,13 +324,13 @@ def reverse_string(text: str) -> str:
|
|
|
317
324
|
|
|
318
325
|
`@tool` is re-exported from `agent_framework`. Functions can be sync or async; types in the signature feed MAF's automatic JSON-Schema generation. Tools that need richer schemas can be declared with `agent_framework.FunctionTool` directly.
|
|
319
326
|
|
|
320
|
-
##
|
|
327
|
+
## Built-in Endpoint Routes
|
|
321
328
|
|
|
322
|
-
|
|
329
|
+
Built-in endpoints are explicit per agent. The filename stem determines `{slug}`; for example, `main.agent.md` uses `main` and `daily_azure_report.agent.md` uses `daily_azure_report`.
|
|
323
330
|
|
|
324
331
|
### Chat UI
|
|
325
332
|
|
|
326
|
-
A built-in single-page chat interface served at
|
|
333
|
+
A built-in single-page chat interface served at `/agents/{slug}/` when `builtin_endpoints.debug_chat_ui: true` (or `builtin_endpoints: true`). No frontend code needed — just open `http://localhost:7071/agents/main/` locally for `main.agent.md`, or `https://<your-app>.azurewebsites.net/agents/{slug}/` when deployed. See [`docs/front-matter-spec.md#function-name-resolution`](docs/front-matter-spec.md#function-name-resolution).
|
|
327
334
|
|
|
328
335
|
On first load, you'll be prompted for the base URL and a function key (for deployed apps). These are stored in browser local storage and can be changed via the gear icon.
|
|
329
336
|
|
|
@@ -331,8 +338,7 @@ On first load, you'll be prompted for the base URL and a function key (for deplo
|
|
|
331
338
|
|
|
332
339
|
POST endpoints for programmatic access:
|
|
333
340
|
|
|
334
|
-
- **
|
|
335
|
-
- **Non-main agent with `debug.chat: true`:** `POST /agents/{slug}/chat` and `POST /agents/{slug}/chatstream` (`{slug}` comes from the `.agent.md` filename after sanitization)
|
|
341
|
+
- **Any agent with `builtin_endpoints.chat_api: true`:** `POST /agents/{slug}/chat` and `POST /agents/{slug}/chatstream`
|
|
336
342
|
|
|
337
343
|
The JSON endpoint returns `session_id`, `response`, and `tool_calls`. The streaming endpoint uses Server-Sent Events (SSE) with `session`, `delta`, `intermediate`, `tool_start`, `tool_end`, `done`, and `error` events.
|
|
338
344
|
|
|
@@ -340,11 +346,11 @@ Pass `x-ms-session-id` header to continue a conversation across requests. If omi
|
|
|
340
346
|
|
|
341
347
|
### MCP Server
|
|
342
348
|
|
|
343
|
-
|
|
349
|
+
When `builtin_endpoints: true` or `builtin_endpoints.mcp: true`, the agent is exposed as an MCP tool named after its slug through the shared MCP-compatible endpoint at `/runtime/webhooks/mcp`. Requires the MCP extension system key in the `x-functions-key` header when deployed.
|
|
344
350
|
|
|
345
|
-
### Without
|
|
351
|
+
### Without built-in endpoints
|
|
346
352
|
|
|
347
|
-
If
|
|
353
|
+
If no agent enables built-in endpoints, no chat UI, chat API, chatstream, or agent MCP tool is registered. The app still runs triggered functions. See [`docs/front-matter-spec.md#builtin_endpoints`](docs/front-matter-spec.md#builtin_endpoints).
|
|
348
354
|
|
|
349
355
|
## MCP Server Configuration
|
|
350
356
|
|
|
@@ -373,7 +379,6 @@ String values in `mcp.json` support inline environment-variable substitution wit
|
|
|
373
379
|
"type": "http",
|
|
374
380
|
"url": "$O365_MCP_SERVER_URL",
|
|
375
381
|
"tools": ["office365_SendEmailV2"],
|
|
376
|
-
"load_prompts": false,
|
|
377
382
|
"auth": {
|
|
378
383
|
"scope": "https://apihub.azure.com/.default",
|
|
379
384
|
"client_id": "$O365_MCP_CLIENT_ID"
|
|
@@ -389,10 +394,10 @@ Tools from configured MCP servers are automatically available to the agent at ru
|
|
|
389
394
|
- **`url`** — the MCP server endpoint URL (required)
|
|
390
395
|
- **`headers`** — optional HTTP headers (e.g. for authentication)
|
|
391
396
|
- **`tools`** — optional array of tool name patterns to allow (default: `["*"]`)
|
|
392
|
-
- **`load_tools`** — optional boolean controlling whether tools are loaded from the MCP server (default: `true`)
|
|
393
|
-
- **`load_prompts`** — optional boolean controlling whether prompts are loaded from the MCP server (default: `true`). Set this to `false` for MCP servers that do not implement `prompts/list`.
|
|
394
397
|
- **`auth`** — optional Azure Identity authentication configuration. Set `auth.scope` to the token scope required by the MCP server. The runtime uses `DefaultAzureCredential` to acquire the token.
|
|
395
398
|
|
|
399
|
+
The runtime loads MCP tools and skips MCP prompts. This avoids startup/runtime failures from connector-backed MCP servers that support tools but reject `prompts/list`.
|
|
400
|
+
|
|
396
401
|
By default, MCP auth follows the app-wide identity selection: `AZURE_CLIENT_ID` when set, otherwise the system-assigned identity/default Azure credential chain. To choose a user-assigned managed identity for a single MCP server without changing the app-wide identity, set `auth.client_id` in that server's `mcp.json` entry. If the configured client ID is empty or an unresolved placeholder, the runtime falls back to the app-wide identity selection.
|
|
397
402
|
|
|
398
403
|
> **Note**: Entries without a `url`, with unresolved placeholders in `url`, or with a `type` other than `"http"` / `"streamable-http"`, are ignored with a warning. Use the remote HTTP transport instead.
|
|
@@ -416,7 +421,7 @@ Multi-turn conversations are persisted as JSON Lines, one record per message:
|
|
|
416
421
|
- **Local dev fallback.** When neither `AzureWebJobsStorage` nor
|
|
417
422
|
`AzureWebJobsStorage__blobServiceUri` is set, history falls back to MAF's
|
|
418
423
|
`FileHistoryProvider` writing to
|
|
419
|
-
`{
|
|
424
|
+
`{AZURE_FUNCTIONS_AGENTS_SESSION_DIR}/agent-sessions/{session_id}.jsonl`,
|
|
420
425
|
defaulting to `~/.azure-functions-agents/agent-sessions/`.
|
|
421
426
|
|
|
422
427
|
Session ids must match `^[A-Za-z0-9._-]{1,128}$` — anything else is rejected at the API boundary.
|
|
@@ -436,20 +441,21 @@ See the [`samples/`](samples/) directory for complete, deployable example apps:
|
|
|
436
441
|
|
|
437
442
|
### Required Azure App Settings
|
|
438
443
|
|
|
439
|
-
Set the model provider env vars described above (
|
|
444
|
+
Set the model provider env vars described above. The preview samples use Microsoft Foundry (`AZURE_FUNCTIONS_AGENTS_PROVIDER=foundry`, `FOUNDRY_PROJECT_ENDPOINT`, and `FOUNDRY_MODEL`). Azure OpenAI (`AZURE_OPENAI_ENDPOINT` + `AZURE_OPENAI_DEPLOYMENT`) and OpenAI (`OPENAI_API_KEY` and optionally `AZURE_FUNCTIONS_AGENTS_MODEL`) are supported alternatives. For Microsoft Foundry and Azure OpenAI, the provider-specific model/deployment setting takes precedence over `AZURE_FUNCTIONS_AGENTS_MODEL`.
|
|
440
445
|
|
|
441
|
-
When the agent uses connector-backed MCP servers, connector triggers, or `
|
|
446
|
+
When the agent uses connector-backed MCP servers, connector triggers, or `dynamic_sessions_code_interpreter`, the function app's **system-assigned or user-assigned Managed Identity** must be enabled and granted access to the target resource — otherwise `DefaultAzureCredential` will fail to obtain a token. In multi-identity Function Apps, set `AZURE_CLIENT_ID` so the runtime uses the intended managed identity for Azure OpenAI, Foundry, blob-backed session storage, ACA Dynamic Sessions, and ARM/data-plane connector calls. For an individual MCP server, set `auth.client_id` in `mcp.json` to choose a different managed identity just for that server. For an individual code interpreter pool, set `system_tools.dynamic_sessions_code_interpreter.client_id`.
|
|
442
447
|
|
|
443
448
|
### Optional config overrides
|
|
444
449
|
|
|
445
450
|
| Setting | Purpose |
|
|
446
451
|
|---|---|
|
|
447
452
|
| `AZURE_FUNCTIONS_AGENTS_APP_ROOT` | Override the app root used to discover `*.agent.md`, `tools/`, `skills/`, and `mcp.json` |
|
|
448
|
-
| `
|
|
449
|
-
| `
|
|
450
|
-
| `
|
|
451
|
-
| `
|
|
452
|
-
| `
|
|
453
|
+
| `AZURE_FUNCTIONS_AGENTS_SESSION_DIR` | Override the directory used for local session storage |
|
|
454
|
+
| `AZURE_FUNCTIONS_AGENTS_TIMEOUT_SECONDS` | Per-call timeout in seconds (default `900`) |
|
|
455
|
+
| `AZURE_FUNCTIONS_AGENTS_PROVIDER` | Pin the model provider (`openai`/`azure_openai`/`foundry`) and skip auto-detection |
|
|
456
|
+
| `AZURE_FUNCTIONS_AGENTS_MODEL` | Runtime-owned model fallback when no provider-specific model/deployment is set |
|
|
457
|
+
| `AZURE_FUNCTIONS_AGENTS_REASONING_EFFORT` | Optional reasoning effort for supported reasoning models (valid values include `none`, `low`, `medium`, `high`, `xhigh`) |
|
|
458
|
+
| `AZURE_FUNCTIONS_AGENTS_REASONING_SUMMARY` | Optional reasoning summary mode for supported reasoning models (valid values are `auto`, `concise`, `detailed`) |
|
|
453
459
|
|
|
454
460
|
## Development
|
|
455
461
|
|
{azurefunctions_agents_runtime-0.0.0.dev6 → azurefunctions_agents_runtime-0.1.0b3}/pyproject.toml
RENAMED
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "azurefunctions-agents-runtime"
|
|
7
|
-
|
|
7
|
+
dynamic = ["version"]
|
|
8
8
|
description = "A markdown-first programming model for building AI agents on Azure Functions, powered by the Microsoft Agent Framework."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
@@ -37,6 +37,9 @@ dev = [
|
|
|
37
37
|
[tool.setuptools.packages.find]
|
|
38
38
|
where = ["src"]
|
|
39
39
|
|
|
40
|
+
[tool.setuptools.dynamic]
|
|
41
|
+
version = {attr = "azure_functions_agents.__version__"}
|
|
42
|
+
|
|
40
43
|
[tool.setuptools.package-data]
|
|
41
44
|
azure_functions_agents = ["public/**"]
|
|
42
45
|
|