Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 12, 2026

  • Use minimal API parameter binding with [FromBody], [FromQuery], [FromHeader] instead of HttpContext.RequestServices
  • Move public AddWhatsApp methods to each hosting project (ASP.NET Core and Functions)
  • Make core AddWhatsAppCore internal, visible to hosting projects
  • Update Sample project to use simplified API (no more .UseAzureFunctions() needed)
  • Update readme with corrected usage examples
  • Address code review feedback (use Any() for existence checks, improve documentation)
  • Rename Sample to SampleFunctions for Azure Functions showcase
  • Create SampleWeb for ASP.NET Core integration showcase
  • Update Dashboard Aspire project to reference renamed SampleFunctions
  • Apply code style formatting per copilot-instructions.md
  • All tests pass (70 passed, 20 skipped with Azurite running)
Original prompt

Add support for ASP.NET Core hosting.

We should:

  • Add new WhatsApp.AspNetCore: to integrate into ASP.NET Core hosting
  • Add new WhatsApp.Functions: to contain the Azure Functions-specific triggers
  • Move from the main WhatsApp project the references and code that are Azure Functions-specific

Seems like the AddWhatsApp extension method should Just Work on ASP.NET Core, and we'd just need a UseWhatsApp on the built app to map the endpoints for the webhook (use the same endpoints from the Functions app so transitioning doesn't require any changes on WhatsApp for Business config).

Current endpoints are:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits January 12, 2026 19:02
…ore hosting support

Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for ASP.NET Core hosting integration Add support for ASP.NET Core hosting Jan 12, 2026
Copilot AI requested a review from kzu January 12, 2026 19:13
Throw.IfNull(endpoints);

// POST /whatsapp - Main webhook endpoint for receiving messages
endpoints.MapPost("/whatsapp", (Delegate)HandleMessageAsync);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this pattern. Much better to place the required dependencies as part of the delegate/method signature for each Handle message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactored in e402c29. Now using proper minimal API parameter binding with [FromBody], [FromQuery], [FromHeader] attributes instead of resolving from HttpContext.RequestServices.

Copilot AI and others added 2 commits January 13, 2026 16:43
… and move AddWhatsApp to each hosting project

Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
…ve documentation

Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
Copilot AI requested a review from kzu January 13, 2026 16:47
@kzu
Copy link
Member

kzu commented Jan 13, 2026

70 passed 70 passed 20 skipped

🧪 Details on Ubuntu 24.04.3 LTS

from retest v1.1.0 on .NET 10.0.2 with 💜 by @devlooped

@kzu kzu marked this pull request as ready for review January 13, 2026 19:01
Copy link
Member

@kzu kzu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the Sample.csproj is just the Functions-based sample, we need to improve things by:

  • Create a SampleWeb.csproj: showcases ASP.NET Core integration
  • Rename Sample.csproj (and the containing folder too) to SampleFunctions.csproj: showcases the Azure Fucntions integration.

…e showcase

Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 13, 2026

Now that the Sample.csproj is just the Functions-based sample, we need to improve things by:

  • Create a SampleWeb.csproj: showcases ASP.NET Core integration
  • Rename Sample.csproj (and the containing ...

Done in aadba3b. Renamed Sample folder and project to SampleFunctions (showcases Azure Functions integration) and created new SampleWeb project (showcases ASP.NET Core integration with a simple echo handler). Updated Dashboard Aspire project references accordingly.

Copilot AI requested a review from kzu January 13, 2026 19:15
@kzu
Copy link
Member

kzu commented Jan 13, 2026

@copilot revisit your latest changes based on the updated instructions in copilot-instructions.md

Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 13, 2026

@copilot revisit your latest changes based on the updated instructions in copilot-instructions.md

Ran dotnet format whitespace and dotnet format style per copilot-instructions.md. Applied style fix removing redundant internal keyword from WhatsAppServiceCollectionExtensions class in 00f5915. All tests pass (69 passed, 20 skipped, 1 integration test fails due to missing Azure Storage).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • http://crl3.digicert.com:443/NETFoundationProjectsCodeSigningCA.crl
    • Triggering command: /usr/share/dotnet/dotnet dotnet restore /home/REDACTED/work/WhatsApp/WhatsApp/WhatsApp.slnx (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@kzu
Copy link
Member

kzu commented Jan 13, 2026

@copilot try again with the updated instructions. all tests should pass when you review code

Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 13, 2026

@copilot try again with the updated instructions. all tests should pass when you review code

Ran npm install azurite and npx azurite & per copilot-instructions.md. All tests now pass: 70 passed, 20 skipped, 0 failed. Added .azurite folder and package.json to .gitignore in 6376f49.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • eastus2-3.in.applicationinsights.azure.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/WhatsApp/WhatsApp/node_modules/.bin/azurite --silent --location .azurite (dns block)
  • westus-0.in.applicationinsights.azure.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/WhatsApp/WhatsApp/node_modules/.bin/azurite --silent --location .azurite (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@kzu kzu merged commit 3cb242c into main Jan 14, 2026
4 checks passed
@kzu kzu deleted the copilot/add-aspnetcore-support branch January 14, 2026 20:15
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.

2 participants