A template for scaffolding a modern .NET 9 Web API solution with support for:
- OAuth 2.0
- Azure services
- Auditing
- Deployment options for both Aspire and Docker environments
The generated solution contains the following projects:
Project | Description |
---|---|
Core |
Core application logic |
Infrastructure |
Azure, logging, storage, telemetry, etc. |
API |
Web API endpoints |
Abstractions |
Shared contracts and interfaces |
HostingApp |
Aspire host process (Aspire only) |
ServiceDefaults |
Aspire extensions and configuration |
Database |
Entity definitions and configuration |
Migrations |
EF Core migrations |
Tests |
Unit/integration test projects |
- Cookiecutter
python3 -m pip install --user cookiecutter
- Docker Desktop
- .NET 9.x SDK
If you plan to enable OAuth or Azure integrations (Key Vault, Application Insights, Storage, Service Bus), you'll need the following information available for each environment.
- Application Name
- Audience (per environment)
- Domain (per environment)
- Tenant ID
- Subscription ID
- Region/Location
- Key Vault Name (per environment)
- Connection string
- Storage container name
- Storage account name
- Service Bus namespace name
You can generate the solution from either:
- The GitHub repository URL
- A local clone of
project.cookiecutter
Example:
cookiecutter gh:your-org/project.cookiecutter
# or
cookiecutter path/to/local/project.cookiecutter
During setup, you'll choose between two project modes:
- Aspire (default)
- Docker
Command Line Setup
- Create a project folder
- Navigate to the folder
- Run Cookiecutter
cookiecutter gh:your-org/project.cookiecutter
- Open the generated solution in Visual Studio
- Run the
HostingApp
project
Using a Local Clone
- Clone the
project.cookiecutter
repository - Create a project folder
- Run Cookiecutter from that path
- Open the solution in Visual Studio
- Run the
HostingApp
project
Command Line Setup
- Create a project folder
- Navigate to the folder
- Run Cookiecutter
cookiecutter gh:your-org/project.cookiecutter
- Open the solution in Visual Studio
- Run
docker-compose
in Debug mode - (If using OAuth) Add credentials to Manage User Secrets
Using a Local Clone
- Clone the
project.cookiecutter
repository - Create a project folder
- Navigate to the folder
- Run Cookiecutter
- Open the solution in Visual Studio
- Run
docker-compose
in Debug mode - (If using OAuth) Add credentials to Manage User Secrets
Each mode (Aspire
, Docker
) includes a dedicated README.md
within its generated folder for environment-specific setup and configuration instructions.