Skip to content

Commit 67b72ef

Browse files
committed
Enhance OAuth identity passthrough instructions and update examples for clarity in MCP server connection guide
1 parent a562829 commit 67b72ef

1 file changed

Lines changed: 75 additions & 23 deletions

File tree

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

Lines changed: 75 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -95,44 +95,94 @@ Both **Agent Identity** and **Project Managed Identity** use Microsoft Entra aut
9595
To get the Application ID URI from the Azure portal:
9696

9797
1. Go to your function app resource in the [Azure portal](https://portal.azure.com).
98+
9899
1. Select **Settings** > **Authentication** from the left menu.
100+
99101
1. Select the name of the Entra app next to **Microsoft**. This selection takes you to the Entra app resource.
102+
100103
1. In the left menu, select **Manage** > **Expose an API**.
104+
101105
1. Copy the **Application ID URI** at the top of the page. This ID value looks like `api://00001111-aaaa-2222-bbbb-3333cccc4444`.
102106

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:
129+
130+
| URL type | Format |
131+
| -------- | ------ |
132+
| **Auth URL** | `https://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/authorize` |
133+
| **Token URL** | `https://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/token` |
134+
| **Refresh URL** | `https://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/token` |
135+
136+
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+
103145
### [Unauthenticated](#tab/unauthenticated)
104146

105147
Because unauthenticated access requires no shared secrets or authentication, you can skip to the next section.
106148

107149
>[!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.
109151
110152
---
111153

112154
## Disable key-based authentication
113155

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:
115157

116158
### [MCP extension server](#tab/mcp-extension/key-based)
117159

118-
You can skip this section when using key-based authentication.
160+
Skip this section when using key-based authentication.
119161

120162
### [MCP extension server](#tab/mcp-extension/entra)
121163

122164
[!INCLUDE [functions-mcp-extension-disable-key-access](../../includes/functions-mcp-extension-disable-key-access.md)]
123165

166+
### [MCP extension server](#tab/mcp-extension/oauth-id)
167+
168+
[!INCLUDE [functions-mcp-extension-disable-key-access](../../includes/functions-mcp-extension-disable-key-access.md)]
169+
124170
### [MCP extension server](#tab/mcp-extension/unauthenticated)
125171

126172
[!INCLUDE [functions-mcp-extension-disable-key-access](../../includes/functions-mcp-extension-disable-key-access.md)]
127173

128174
### [Self-hosted server](#tab/self-hosted/key-based)
129175

130-
You can skip this section when using key-based authentication.
176+
Skip this section when using key-based authentication.
131177

132178
### [Self-hosted server](#tab/self-hosted/entra)
133179

134180
[!INCLUDE [functions-mcp-custom-handler-disable-key-access](../../includes/functions-mcp-custom-handler-disable-key-access.md)]
135181

182+
### [Self-hosted server](#tab/self-hosted/oauth-id)
183+
184+
[!INCLUDE [functions-mcp-custom-handler-disable-key-access](../../includes/functions-mcp-custom-handler-disable-key-access.md)]
185+
136186
### [Self-hosted server](#tab/self-hosted/unauthenticated)
137187

138188
[!INCLUDE [functions-mcp-custom-handler-disable-key-access](../../includes/functions-mcp-custom-handler-disable-key-access.md)]
@@ -153,16 +203,16 @@ To connect to your MCP server endpoint:
153203

154204
1. Select the **Build** tab at the top of the page and select an agent to connect to your MCP server.
155205

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**.
157207

158208
1. In the **Custom** tab in **Select a tool**, select **Model Context Protocol (MCP)** > **Create**.
159209

160210
1. In **Add Model Content Protocol tool**, provide information from this table to configure an access key-based connection:
161211

162212
| Field | Description | Example |
163213
| ----- | ----------- | ------- |
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` |
166216
| **Authentication** | The authentication method to use. | `Key-based` |
167217
| **Credential** | The key-value pair to authenticate with your function app. | `x-functions-key`: `aaaaaaaa-0b0b-1c1c-2d2d-333333333333` |
168218

@@ -180,16 +230,16 @@ To connect to your MCP server endpoint:
180230

181231
1. Select the **Build** tab at the top of the page and select an agent to connect to your MCP server.
182232

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**.
184234

185235
1. In the **Custom** tab in **Select a tool**, select **Model Context Protocol (MCP)** > **Create**.
186236

187237
1. In **Add Model Content Protocol tool**, enter the information from this table to configure a Microsoft Entra-based connection:
188238

189239
| Field | Description | Example |
190240
| ----- | ----------- | ------- |
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` |
193243
| **Authentication** | The authentication method to use. | `Microsoft Entra` |
194244
| **Type** | The identity type the agent uses to authenticate. | `Project Managed Identity` |
195245
| **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:
198248

199249
1. Select **Save** to save the MCP tool configuration in your agent.
200250

201-
### [OAuth Identity Passthrough](#tab/oauth-id)
251+
### [OAuth identity](#tab/oauth-id)
202252

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.
204254

205255
1. Go to the [Foundry portal (new Foundry)](https://ai.azure.com/nextgen).
206256

207257
1. Select the **Build** tab at the top of the page and select an agent to connect to your MCP server.
208258

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**.
210260

211261
1. In the **Custom** tab in **Select a tool**, select **Model Context Protocol (MCP)** > **Create**.
212262

213263
1. In **Add Model Content Protocol tool**, enter the information from this table to configure OAuth Identity Passthrough connection:
214264

215265
| Field | Description | Example |
216266
| ----- | ----------- | ------- |
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` |
219269
| **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` |
225274
| **Scopes** | The specific permissions or resource access levels your server app requests from the authorization server | `api://00001111-aaaa-2222-bbbb-3333cccc4444` |
226275

276+
>[!NOTE]
277+
>A **Client secret** value isn't needed, so you should leave this field blank.
278+
227279
1. Select **Connect** to create a connection to your MCP server endpoint. You should now see your server name listed under **Tools**.
228280

229281
1. Select **Save** to save the MCP tool configuration in your agent.
@@ -238,16 +290,16 @@ To connect to your MCP server endpoint:
238290

239291
1. Select the **Build** tab at the top of the page and select an agent to connect to your MCP server.
240292

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**.
242294

243295
1. In the **Custom** tab in **Select a tool**, select **Model Context Protocol (MCP)** > **Create**.
244296

245297
1. In **Add Model Content Protocol tool**, provide information from this table to configure an unauthenticated connection:
246298

247299
| Field | Description | Example |
248300
| ----- | ----------- | ------- |
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` |
251303
| **Authentication** | The authentication method to use. | `Unauthenticated` |
252304

253305
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

Comments
 (0)