You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-mcp-foundry-tools.md
+67-36Lines changed: 67 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,16 +21,17 @@ This article follows this basic process for configuring the MCP server connectio
21
21
> * Create and deploy an MCP server to your function app in Azure.
22
22
> * Get the MCP server endpoint URL.
23
23
> * Get the authentication credentials (as required).
24
+
> * Disable key-based authentication (when not needed).
24
25
> * Add an MCP server tool connection to an existing agent.
25
26
26
27
## Prerequisites
27
28
28
29
Before you begin, make sure you have these resources in place:
29
30
30
-
*Deploy an MCP server to a function app in Azure by using one of these supported hosting options:
31
+
*An MCP server hosted as a function app. You can create your MCP server by completing the quickstart for one of these supported hosting options:
31
32
*[Using the Azure Functions MCP extension](scenario-custom-remote-mcp-server.md).
32
33
*[Self-host a server that uses standard MCP SDKs](scenario-host-mcp-server-sdks.md).
33
-
*[Configure built-in authentication](./functions-mcp-tutorial.md#configure-authentication-on-server-app), when using Microsoft Entra ID-based authentication.
34
+
*[Configure built-in authentication in your function app](./functions-mcp-tutorial.md#configure-authentication-on-server-app), when using Microsoft Entra ID-based authentication.
34
35
*[An existing Foundry project and model](/azure/ai-foundry/tutorials/quickstart-create-foundry-resources?view=foundry&tabs=portal&preserve-view=true).
|**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
+
|**Key-based**<sup>*</sup> | Agent authenticates by passing a shared [function access key](./function-keys-how-to.md) in the request header. This is the default authentication for HTTP endpoints in Functions. | During development or when the MCP server doesn't require Microsoft Entra authentication. | None | Yes |
44
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 |
45
46
|**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. |[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). | Yes |
46
47
|**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 |
@@ -69,7 +70,7 @@ The credentials that your agent needs to connect to the MCP server depend on the
69
70
When you use an access key to connect to your MCP server endpoint, you use a shared secret key to make it more difficult for random agents to connect to your server.
70
71
71
72
>[!IMPORTANT]
72
-
>While access keys can help prevent unwanted endpoint access, consider using Microsoft Entra ID authentication to secure your MCP server endpoints in production.
73
+
>While access keys can help prevent unwanted endpoint access by default, consider using Microsoft Entra ID or OAuth identity authentication to provide enhanced security to your MCP server endpoints in production.
73
74
74
75
The name of the access key you need depends on your MCP server deployment:
75
76
@@ -89,19 +90,35 @@ For more information, see [Work with access keys in Azure Functions](function-ke
89
90
90
91
### [Microsoft Entra](#tab/entra)
91
92
92
-
Both **Agent Identity** and **Project Managed Identity** use Microsoft Entra authentication. Currently, Functions only supports **Project managed identity**, which requires your server to be configured by using built-in authentication and authorization. The required audience is the Application ID URI from your function app's Entra app registration. You get this value during the [built-in authentication configuration](functions-mcp-tutorial.md?tabs=mcp-extension#configure-protected-resource-metadata-preview).
93
+
Both **Agent Identity** and **Project Managed Identity** use Microsoft Entra authentication. Currently, Functions only supports **Project managed identity**, which requires your server to use built-in authentication and authorization.
93
94
94
-
To get the Application ID URI from the Azure portal:
95
+
1. Connect a user-assigned managed identity from your function app to your Foundry project. If you don't have a user-assigned managed identity, you must [first create one](../app-service/overview-managed-identity.md#add-a-user-assigned-identity).
95
96
96
-
1. Go to your function app resource in the [Azure portal](https://portal.azure.com).
97
-
98
-
1. Select **Settings** > **Authentication** from the left menu.
97
+
1. In the [Azure portal](https://portal.azure.com), search for `Foundry` and in Microsoft Foundry select your Foundry resource from **All resources**.
98
+
99
+
1. In **Resource management** > **Identity** > **User assigned** select **+ Add**, select the user-assigned managed identity used by your function app, and then select **Add**.
100
+
101
+
1. Select the newly added identity and copy the **Client ID** value.
102
+
103
+
1. Use the client ID of the identity to make it an allowed client application in your [function app's Entra app registration](functions-mcp-tutorial.md?tabs=mcp-extension#configure-protected-resource-metadata-preview):
99
104
100
-
1. Select the name of the Entra app next to **Microsoft**. This selection takes you to the Entra app resource.
105
+
1. Go to your function app resource in the [Azure portal](https://portal.azure.com).
106
+
107
+
1. Select **Settings** > **Authentication** from the left menu.
108
+
109
+
1. Select the **Edit** icon for your registered Entra identity provider.
110
+
111
+
1. In your provider, set **Client application requirement** to **Allow requests from specific client applications** and select the edit button next to **Allowed client applications**.
112
+
113
+
1. Add the client ID of your managed identity, and select **OK** and then **Save**.
101
114
102
-
1.In the left menu, select **Manage** > **Expose an API**.
115
+
1.Get the **Application ID URI** from your function app's Entra app registration, which you need to complete the Entra authentication registration in your agent:
103
116
104
-
1. Copy the **Application ID URI** at the top of the page. This ID value looks like `api://00001111-aaaa-2222-bbbb-3333cccc4444`.
117
+
1. Select the name of the registered Entra identity provider. This selection takes you to the Entra app resource page.
118
+
119
+
1. In the left menu, select **Manage** > **Expose an API**.
120
+
121
+
1. Copy the **Application ID URI** at the top of the page. This ID value looks like `api://00001111-aaaa-2222-bbbb-3333cccc4444`.
105
122
106
123
### [OAuth identity](#tab/oauth-id)
107
124
@@ -147,6 +164,44 @@ Because unauthenticated access requires no shared secrets or authentication, you
147
164
148
165
---
149
166
167
+
## Disable key-based authentication
168
+
169
+
When you choose to use a different authentication method than the default key-based authentication, you don't need Functions to enforce key-based access to your MCP endpoints. You can disable key-based access requirement by changing the access setting from `system` (key-based) to `anonymous` (unauthenticated). How you make this change depends on the type of MCP server you're hosting:
The process for creating the agent connection to the MCP server depends on your specific endpoint authentication options.
@@ -206,18 +261,6 @@ To connect to your MCP server endpoint:
206
261
207
262
1. Select **Save** to save the MCP tool configuration in your agent.
208
263
209
-
1. Beause you are using built-in authentication, you should also disable the default key-based authentication. The way you disable key access depends on your hosting method:
When you use OAuth identity passthrough, the agent prompts the user to sign in and then uses the returned access token when connecting to the server.
@@ -254,18 +297,6 @@ When you use OAuth identity passthrough, the agent prompts the user to sign in a
254
297
255
298
1. Go back to the agent window, select **Close** > **Save** to save the MCP tool configuration in your agent.
256
299
257
-
1. Beause you are using built-in authentication, you should also disable the default key-based authentication. The way you disable key access depends on your hosting method:
Copy file name to clipboardExpand all lines: includes/functions-mcp-custom-handler-disable-key-access.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,18 @@
2
2
author: ggailey777
3
3
ms.service: azure-functions
4
4
ms.topic: include
5
-
ms.date: 02/03/2026
5
+
ms.date: 02/12/2026
6
6
ms.author: glenga
7
7
---
8
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:
9
+
To disable host-based authentication in your MCP server, add a setting named `AzureFunctionsJobHost__customHandler__http__DefaultAuthorizationLevel` with a value of `anonymous` to your application settings. You can add this setting in the portal or use the following Azure CLI command:
10
10
11
-
```json
12
-
"customHandler": {
13
-
...
14
-
"http": {
15
-
"DefaultAuthorizationLevel": "anonymous"
16
-
}
17
-
}
18
-
```
11
+
```azurecli
12
+
az functionapp config appsettings set --name <APP_NAME> --resource-group <RESOURCE_GROUP> \
In this example, replace `<APP_NAME>` and `<RESOURCE_GROUP>` with the name of your function app and resource group.
17
+
18
+
>[!TIP]
19
+
>This setting is equivalent to setting `http.DefaultAuthorizationLevel` to `anonymous` in the custom handler section of the `host.json` file. That approach requires you to republish your server project.
Copy file name to clipboardExpand all lines: includes/functions-mcp-extension-disable-key-access.md
+11-15Lines changed: 11 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,22 +2,18 @@
2
2
author: ggailey777
3
3
ms.service: azure-functions
4
4
ms.topic: include
5
-
ms.date: 02/03/2026
5
+
ms.date: 02/12/2026
6
6
ms.author: glenga
7
7
---
8
8
9
-
To disable host-based authentication in your MCP server, set `system.webhookAuthorizationLevel` to `Anonymous` in the `host.json` file:
9
+
To disable host-based authentication in your MCP server, add a setting named `AzureFunctionsJobHost__extensions__mcp__system__webhookAuthorizationLevel` with a value of `Anonymous`to your application settings. You can add this setting in the portal or use the following Azure CLI command:
10
10
11
-
```json
12
-
{
13
-
"version": "2.0",
14
-
"extensions": {
15
-
"mcp": {
16
-
...
17
-
"system": {
18
-
"webhookAuthorizationLevel": "Anonymous"
19
-
}
20
-
}
21
-
}
22
-
}
23
-
```
11
+
```azurecli
12
+
az functionapp config appsettings set --name <APP_NAME> --resource-group <RESOURCE_GROUP> \
In this example, replace `<APP_NAME>` and `<RESOURCE_GROUP>` with the name of your function app and resource group.
17
+
18
+
>[!TIP]
19
+
>This setting is equivalent to setting `system.webhookAuthorizationLevel` to `Anonymous` in the MCP Extension section of the `host.json` file. However, that method requires you to republish your server project.
0 commit comments