Skip to content

Commit 80b21fc

Browse files
committed
Add instructions to disable key-based authentication for MCP servers
1 parent 4caf356 commit 80b21fc

3 files changed

Lines changed: 74 additions & 2 deletions

File tree

articles/azure-functions/functions-mcp-foundry-tools.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ This article follows this basic process for configuring the MCP server connectio
2121
> * Create and deploy an MCP server to your function app in Azure.
2222
> * Get the MCP server endpoint URL.
2323
> * Get the authentication credentials (as required).
24+
> * Disable key-based authentication (as required).
2425
> * Add an MCP server tool connection to an existing agent.
2526
2627
## Prerequisites
@@ -38,10 +39,10 @@ Before you begin, make sure you have these resources in place:
3839

3940
This table summarizes the currently supported options for authenticating your agent connection to an MCP server in Foundry Agent Service:
4041

41-
| Method | Description | Use case | Additional setup | Functions supportS |
42+
| Method | Description | Use case | Additional setup | Functions supports |
4243
| ------ | ----------- | -------- | ---------------- | ------------------- |
4344
| **Key-based**<sup>*</sup> | Agent authenticates by passing a shared [function access key](./function-keys-how-to.md) in the request header. | During development or when the MCP server doesn't require Microsoft Entra authentication. | None | Yes |
44-
| **Microsoft Entra** | Agent authenticates using either its own identity (*agent identity*) or the shared identity of the Foundry project (*project managed identity*). | Production-level security where users or agents share the same identity and permissions. | [Disable key-based authentication](functions-mcp-tutorial.md?tabs=mcp-extension#disable-key-based-authentication) and [configure built-in server authorization and authentication](functions-mcp-tutorial.md?tabs=mcp-extension#enable-built-in-server-authorization-and-authentication). | Project managed (shared) identity |
45+
| **Microsoft Entra** | Agent authenticates using either its own identity (*agent identity*) or the shared identity of the Foundry project (*project managed identity*). | Agent identity supports production scenarios, but shared identity should be limited to development. | [Disable key-based authentication](functions-mcp-tutorial.md?tabs=mcp-extension#disable-key-based-authentication) and [configure built-in server authorization and authentication](functions-mcp-tutorial.md?tabs=mcp-extension#enable-built-in-server-authorization-and-authentication). | Project managed (shared) identity |
4546
| **OAuth identity passthrough** | Agent prompts users to sign in and authorize access, using the provided token to authenticate. | Production when each user must authenticate with their own identity and user context must be persisted. | Not yet determined | No |
4647
| **Unauthenticated access** | Agent makes unauthenticated calls. | During development or when your MCP server accesses only public information. | [Disable key-based authentication](functions-mcp-tutorial.md?tabs=mcp-extension#disable-key-based-authentication). | Yes |
4748

@@ -108,6 +109,36 @@ Because unauthenticated access requires no shared secrets or authentication, you
108109
109110
---
110111

112+
## Disable key-based authentication
113+
114+
Key-based authentication is the default for an MCP endpoint hosted in Azure Functions. To use a different authentication method, change the MCP endpoint authentication to `anonymous`. The way that you make this change depends on the type of MCP server you are hosting:
115+
116+
### [MCP extension server](#tab/mcp-extension/key-based)
117+
118+
You can skip this section when using key-based authentication.
119+
120+
### [MCP extension server](#tab/mcp-extension/entra)
121+
122+
[!INCLUDE [functions-mcp-extension-disable-key-access](../../includes/functions-mcp-extension-disable-key-access.md)]
123+
124+
### [MCP extension server](#tab/mcp-extension/unauthenticated)
125+
126+
[!INCLUDE [functions-mcp-extension-disable-key-access](../../includes/functions-mcp-extension-disable-key-access.md)]
127+
128+
### [Self-hosted server](#tab/self-hosted/key-based)
129+
130+
You can skip this section when using key-based authentication.
131+
132+
### [Self-hosted server](#tab/self-hosted/entra)
133+
134+
[!INCLUDE [functions-mcp-custom-handler-disable-key-access](../../includes/functions-mcp-custom-handler-disable-key-access.md)]
135+
136+
### [Self-hosted server](#tab/self-hosted/unauthenticated)
137+
138+
[!INCLUDE [functions-mcp-custom-handler-disable-key-access](../../includes/functions-mcp-custom-handler-disable-key-access.md)]
139+
140+
---
141+
111142
## Add your MCP server
112143

113144
The way that you create the agent connection to the MCP server depends on your specific endpoint authentication options.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
author: ggailey777
3+
ms.service: azure-functions
4+
ms.topic: include
5+
ms.date: 02/03/2026
6+
ms.author: glenga
7+
---
8+
9+
To disable host-based authentication for self-hosted MCP servers, add the following code in the `customHandler` section of the `host.json` file:
10+
11+
```json
12+
"customHandler": {
13+
...
14+
"http": {
15+
"DefaultAuthorizationLevel": "anonymous"
16+
}
17+
}
18+
```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
author: ggailey777
3+
ms.service: azure-functions
4+
ms.topic: include
5+
ms.date: 02/03/2026
6+
ms.author: glenga
7+
---
8+
9+
To disable host-based authentication in your MCP server, set `system.webhookAuthorizationLevel` to `Anonymous` in the `host.json` file:
10+
11+
```json
12+
{
13+
"version": "2.0",
14+
"extensions": {
15+
"mcp": {
16+
...
17+
"system": {
18+
"webhookAuthorizationLevel": "Anonymous"
19+
}
20+
}
21+
}
22+
}
23+
```

0 commit comments

Comments
 (0)