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
+75-23Lines changed: 75 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,44 +95,94 @@ Both **Agent Identity** and **Project Managed Identity** use Microsoft Entra aut
95
95
To get the Application ID URI from the Azure portal:
96
96
97
97
1. Go to your function app resource in the [Azure portal](https://portal.azure.com).
98
+
98
99
1. Select **Settings** > **Authentication** from the left menu.
100
+
99
101
1. Select the name of the Entra app next to **Microsoft**. This selection takes you to the Entra app resource.
102
+
100
103
1. In the left menu, select **Manage** > **Expose an API**.
104
+
101
105
1. Copy the **Application ID URI** at the top of the page. This ID value looks like `api://00001111-aaaa-2222-bbbb-3333cccc4444`.
102
106
107
+
### [OAuth identity](#tab/oauth-id)
108
+
109
+
OAuth identity passthrough prompts users to sign in and authorize access to your MCP server. Foundry Agent Service supports two OAuth options:
110
+
111
+
-**Managed OAuth**: Microsoft or the MCP server publisher manages the OAuth app. No credential setup is required.
112
+
-**Custom OAuth**: You bring your own OAuth app registration, which can be a Microsoft Entra app or any OAuth-compliant provider.
113
+
114
+
For a Functions-hosted MCP server with built-in authentication, use custom OAuth with a Microsoft Entra app registration. To get the required credentials from the Azure portal:
115
+
116
+
1. Go to your function app resource in the [Azure portal](https://portal.azure.com).
117
+
118
+
1. Select **Settings** > **Authentication** from the left menu.
119
+
120
+
1. Select the name of the Entra app next to **Microsoft**. This selection takes you to the Entra app resource.
121
+
122
+
1. From **Essentials** in the **Overview** page, copy the values from these fields:
123
+
124
+
+**Application (client) ID**
125
+
+**Directory (tenant) ID**
126
+
+**Application ID URI**
127
+
128
+
1. Use the tenant ID to construct these required OAuth URLs:
Replace `<TENANT_ID>` with your actual tenant ID value.
137
+
138
+
1. (Optional) If your app requires a client secret, select **Manage** > **Certificates & secrets**, and then create or copy an existing client secret value.
139
+
140
+
1. (Optional) Select **Manage** > **Expose an API** and create or copy an existing scope.
141
+
142
+
>[!IMPORTANT]
143
+
>After you configure OAuth identity passthrough in the Foundry portal, you receive a redirect URL. You must add this redirect URL to your Microsoft Entra app registration under **Manage** > **Authentication** > **Platform configurations**.
144
+
103
145
### [Unauthenticated](#tab/unauthenticated)
104
146
105
147
Because unauthenticated access requires no shared secrets or authentication, you can skip to the next section.
106
148
107
149
>[!IMPORTANT]
108
-
>This option allows any client or agent to access your MCP server endpoint and should only be used for tools that return read-only public information or during private development.
150
+
>This option allows any client or agent to access your MCP server endpoint. Use it only for tools that return read-only public information or during private development.
109
151
110
152
---
111
153
112
154
## Disable key-based authentication
113
155
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:
156
+
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`. How you make this change depends on the type of MCP server you're hosting:
@@ -153,16 +203,16 @@ To connect to your MCP server endpoint:
153
203
154
204
1. Select the **Build** tab at the top of the page and select an agent to connect to your MCP server.
155
205
156
-
1. In the **Playground** tab, expand **Tools** dropdown and select **Add**.
206
+
1. In the **Playground** tab, expand the **Tools** dropdown and select **Add**.
157
207
158
208
1. In the **Custom** tab in **Select a tool**, select **Model Context Protocol (MCP)** > **Create**.
159
209
160
210
1. In **Add Model Content Protocol tool**, provide information from this table to configure an access key-based connection:
161
211
162
212
| Field | Description | Example |
163
213
| ----- | ----------- | ------- |
164
-
|**Name**| A unique identifier for your MCP server. You can use your function app name as the default. |`my-mcp-function-app`|
165
-
|**Remote MCP Server endpoint**| The URL endpoint for your MCP server. |`https://my-mcp-function-app.azurewebsites.net/runtime/webhooks/mcp`|
214
+
|**Name**| A unique identifier for your MCP server. You can use your function app name as the default. |`contoso-mcp-tools`|
215
+
|**Remote MCP Server endpoint**| The URL endpoint for your MCP server. |`https://contoso-mcp-tools.azurewebsites.net/runtime/webhooks/mcp`|
166
216
|**Authentication**| The authentication method to use. |`Key-based`|
167
217
|**Credential**| The key-value pair to authenticate with your function app. |`x-functions-key`: `aaaaaaaa-0b0b-1c1c-2d2d-333333333333`|
168
218
@@ -180,16 +230,16 @@ To connect to your MCP server endpoint:
180
230
181
231
1. Select the **Build** tab at the top of the page and select an agent to connect to your MCP server.
182
232
183
-
1. In the **Playground** tab, expand **Tools** dropdown and select **Add**.
233
+
1. In the **Playground** tab, expand the **Tools** dropdown and select **Add**.
184
234
185
235
1. In the **Custom** tab in **Select a tool**, select **Model Context Protocol (MCP)** > **Create**.
186
236
187
237
1. In **Add Model Content Protocol tool**, enter the information from this table to configure a Microsoft Entra-based connection:
188
238
189
239
| Field | Description | Example |
190
240
| ----- | ----------- | ------- |
191
-
|**Name**| A unique identifier for your MCP server. You can use your function app name. |`my-mcp-functions`|
192
-
|**Remote MCP Server endpoint**| The URL endpoint for your MCP server. |`https://my-mcp-functions.azurewebsites.net/runtime/webhooks/mcp`|
241
+
|**Name**| A unique identifier for your MCP server. You can use your function app name. |`contoso-mcp-tools`|
242
+
|**Remote MCP Server endpoint**| The URL endpoint for your MCP server. |`https://contoso-mcp-tools.azurewebsites.net/runtime/webhooks/mcp`|
193
243
|**Authentication**| The authentication method to use. |`Microsoft Entra`|
194
244
|**Type**| The identity type the agent uses to authenticate. |`Project Managed Identity`|
195
245
|**Audience**| The Application ID URI of your function app's Entra registration. This value tells the identity provider which app the token is intended for. |`api://00001111-aaaa-2222-bbbb-3333cccc4444`|
@@ -198,32 +248,34 @@ To connect to your MCP server endpoint:
198
248
199
249
1. Select **Save** to save the MCP tool configuration in your agent.
200
250
201
-
### [OAuth Identity Passthrough](#tab/oauth-id)
251
+
### [OAuth identity](#tab/oauth-id)
202
252
203
-
The agent prompts the user to login and uses the access token returned there to connect to the server.
253
+
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.
204
254
205
255
1. Go to the [Foundry portal (new Foundry)](https://ai.azure.com/nextgen).
206
256
207
257
1. Select the **Build** tab at the top of the page and select an agent to connect to your MCP server.
208
258
209
-
1. In the **Playground** tab, expand **Tools** dropdown and select **Add**.
259
+
1. In the **Playground** tab, expand the **Tools** dropdown and select **Add**.
210
260
211
261
1. In the **Custom** tab in **Select a tool**, select **Model Context Protocol (MCP)** > **Create**.
212
262
213
263
1. In **Add Model Content Protocol tool**, enter the information from this table to configure OAuth Identity Passthrough connection:
214
264
215
265
| Field | Description | Example |
216
266
| ----- | ----------- | ------- |
217
-
|**Name**| A unique identifier for your MCP server. You can use your function app name. |`my-mcp-functions`|
218
-
|**Remote MCP Server endpoint**| The URL endpoint for your MCP server. |`https://my-mcp-functions.azurewebsites.net/runtime/webhooks/mcp`|
267
+
|**Name**| A unique identifier for your MCP server. You can use your function app name. |`contoso-mcp-tools`|
268
+
|**Remote MCP Server endpoint**| The URL endpoint for your MCP server. |`https://contoso-mcp-tools.azurewebsites.net/runtime/webhooks/mcp`|
219
269
|**Authentication**| The authentication method to use. |`OAuth Identity Passthrough`|
220
-
|**Client ID**|The client ID of your Funciton app's Entra registration|`00001111-aaaa-2222-bbbb-3333cccc4444`|
221
-
|**Client secret**| The client secret of your Funciton app's Entra registration | Leave it blank|
222
-
|**Token URL**| The endpoint your server app calls to exchange an authorization code or crednetial for an access token. |`https://login.microsoftonline.com/<TENANT ID>/oauth2/v2.0/token`|
223
-
|**Auth URL**| The endpoint where users are redirected to authenticate and grant authorization to your server app. |`https://login.microsoftonline.com/<TENANT ID>/oauth2/v2.0/authorize`|
224
-
|**Refresh URL**| The endpoint used to obtain a new access token when the current one expires. |`https://login.microsoftonline.com/<TENANT ID>/oauth2/v2.0/token`|
270
+
|**Client ID**| The client ID of your function app Entra registration |`00001111-aaaa-2222-bbbb-3333cccc4444`|
271
+
|**Token URL**| The endpoint your server app calls to exchange an authorization code or credential for an access token. |`https://login.microsoftonline.com/aaaabbbb-0000-cccc-1111-dddd2222eeee/oauth2/v2.0/token`|
272
+
|**Auth URL**| The endpoint where users are redirected to authenticate and grant authorization to your server app. |`https://login.microsoftonline.com/aaaabbbb-0000-cccc-1111-dddd2222eeee/oauth2/v2.0/authorize`|
273
+
|**Refresh URL**| The endpoint used to obtain a new access token when the current one expires. |`https://login.microsoftonline.com/aaaabbbb-0000-cccc-1111-dddd2222eeee/oauth2/v2.0/token`|
225
274
|**Scopes**| The specific permissions or resource access levels your server app requests from the authorization server |`api://00001111-aaaa-2222-bbbb-3333cccc4444`|
226
275
276
+
>[!NOTE]
277
+
>A **Client secret** value isn't needed, so you should leave this field blank.
278
+
227
279
1. Select **Connect** to create a connection to your MCP server endpoint. You should now see your server name listed under **Tools**.
228
280
229
281
1. Select **Save** to save the MCP tool configuration in your agent.
@@ -238,16 +290,16 @@ To connect to your MCP server endpoint:
238
290
239
291
1. Select the **Build** tab at the top of the page and select an agent to connect to your MCP server.
240
292
241
-
1. In the **Playground** tab, expand **Tools** dropdown and select **Add**.
293
+
1. In the **Playground** tab, expand the **Tools** dropdown and select **Add**.
242
294
243
295
1. In the **Custom** tab in **Select a tool**, select **Model Context Protocol (MCP)** > **Create**.
244
296
245
297
1. In **Add Model Content Protocol tool**, provide information from this table to configure an unauthenticated connection:
246
298
247
299
| Field | Description | Example |
248
300
| ----- | ----------- | ------- |
249
-
|**Name**| A unique identifier for your MCP server. You can use your function app name. |`my-mcp-functions`|
250
-
|**Remote MCP Server endpoint**| The URL endpoint for your MCP server. |`https://my-mcp-functions.azurewebsites.net/runtime/webhooks/mcp`|
301
+
|**Name**| A unique identifier for your MCP server. You can use your function app name. |`contoso-mcp-tools`|
302
+
|**Remote MCP Server endpoint**| The URL endpoint for your MCP server. |`https://contoso-mcp-tools.azurewebsites.net/runtime/webhooks/mcp`|
251
303
|**Authentication**| The authentication method to use. |`Unauthenticated`|
252
304
253
305
1. Select **Connect** to create an unauthenticated connection to your MCP server endpoint. You should now see your server name listed under **Tools**.
0 commit comments