Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 31, 2025

Aligns the .NET sample with the Python reference implementation, replacing APIM-based authorization with Easy Auth and updating documentation/infrastructure accordingly.

Infrastructure Changes

  • Removed: APIM-based authorization (apim/, app/apim-mcp/)
  • Added: entra.bicep for Entra ID app registration with federated identity credentials
  • Added: mcp.bicep for Function App deployment with App Service Authentication v2
  • Updated: main.bicep to use Easy Auth flow, limited regions to eastasia/northeurope/westus2

Code Changes

  • Program.cs: Removed FUNCTIONS_CUSTOMHANDLER_PORT env var, hardcoded to 8080
  • host.json: Added configurationProfile: "mcp-custom-handler", explicit port config, anonymous auth level
{
  "version": "2.0",
  "configurationProfile": "mcp-custom-handler",
  "customHandler": {
    "description": {
      "defaultExecutablePath": "dotnet",
      "arguments": ["QuickstartWeatherServer.dll"] 
    },
    "http": {
      "DefaultAuthorizationLevel": "anonymous"
    },
    "port": "8080"
  }
}

Documentation Changes

  • Replaced APIM authorization flow with Easy Auth (401 challenge → PRM → OAuth2 login)
  • Added azd template scaffolding instructions for existing servers
  • Updated prerequisites with specific version requirements (azd 1.17.2+, func 4.5.0+)
  • Added troubleshooting for Entra app pre-authorization

Cleanup

  • Removed mcp-handler/ directory (not needed for custom handlers)
  • Removed ExistingServer.md (consolidated into README)
Original prompt

This section details on the original issue you should resolve

<issue_title>Update sample with latest changes using Python as reference</issue_title>
<issue_description>Use the Python sample as a reference and do the following: https://github.com/Azure-Samples/mcp-sdk-functions-hosting-python

  • Update the readme to match the Python sample's
  • Update the content of the infra folder with what the Python sample has
  • Remove the FUNCTIONS_CUSTOMHANDLER_PORT from the server code because that's not needed anymore. Update the host.json to include the original port used by the server instead.
  • Remove the mcp-handler directory
  • Anything I might've missed. Match the Python sample in terms of content, but keeping the language specific pieces of the current sample

Don't do anything else.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Update sample with latest changes using Python as reference Migrate from APIM to Easy Auth, align with Python sample structure Oct 31, 2025
Copilot finished work on behalf of lilyjma October 31, 2025 20:35
@lilyjma lilyjma marked this pull request as ready for review November 5, 2025 02:34
@lilyjma lilyjma merged commit 45963ba into main Nov 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update sample with latest changes using Python as reference

2 participants