Categories
Agent Tooling (71)
- .agents/skills/agent-browser/references/authentication.md
- .agents/skills/agent-browser/references/commands.md
- .agents/skills/agent-browser/references/profiling.md
- .agents/skills/agent-browser/references/proxy-support.md
- .agents/skills/agent-browser/references/session-management.md
- .agents/skills/agent-browser/references/snapshot-refs.md
- .agents/skills/agent-browser/references/video-recording.md
- .agents/skills/agent-browser/SKILL.md
- .agents/skills/aspire-deployment/references/aws.md
- .agents/skills/aspire-deployment/references/azure.md
- .agents/skills/aspire-deployment/references/cicd.md
- .agents/skills/aspire-deployment/references/docker-compose.md
- .agents/skills/aspire-deployment/references/javascript.md
- .agents/skills/aspire-deployment/references/kubernetes.md
- .agents/skills/aspire-deployment/references/preflight.md
- .agents/skills/aspire-deployment/SKILL.md
- .agents/skills/aspire-monitoring/references/diagnostics-bridge.md
- .agents/skills/aspire-monitoring/references/monitoring.md
- .agents/skills/aspire-monitoring/references/playwright-handoff.md
- .agents/skills/aspire-monitoring/SKILL.md
- .agents/skills/aspire-orchestration/references/agent-workflows.md
- .agents/skills/aspire-orchestration/references/app-commands.md
- .agents/skills/aspire-orchestration/references/detection.md
- .agents/skills/aspire-orchestration/references/resource-management.md
- .agents/skills/aspire-orchestration/references/safety-guardrails.md
- .agents/skills/aspire-orchestration/SKILL.md
- .agents/skills/aspire/references/aspire-13-3-breaking-changes.md
- .agents/skills/aspire/SKILL.md
- .agents/skills/aspireify/references/apphost-wiring.md
- .agents/skills/aspireify/references/csharp-authoring.md
- .agents/skills/aspireify/references/docker-compose.md
- .agents/skills/aspireify/references/full-solution-apphosts.md
- .agents/skills/aspireify/references/javascript-apps.md
- .agents/skills/aspireify/references/opentelemetry.md
- .agents/skills/aspireify/references/scan-and-propose.md
- .agents/skills/aspireify/references/service-defaults.md
- .agents/skills/aspireify/references/typescript-authoring.md
- .agents/skills/aspireify/references/validation.md
- .agents/skills/aspireify/SKILL.md
- .agents/skills/caveman-compress/README.md
- .agents/skills/caveman-compress/SECURITY.md
- .agents/skills/caveman-compress/SKILL.md
- .agents/skills/caveman-help/README.md
- .agents/skills/caveman-help/SKILL.md
- .agents/skills/caveman-stats/README.md
- .agents/skills/caveman-stats/SKILL.md
- .agents/skills/caveman/README.md
- .agents/skills/caveman/SKILL.md
- .agents/skills/csharp-developer/SKILL.md
- .agents/skills/dotnet-inspect/SKILL.md
- .agents/skills/efcore-data-layer/SKILL.md
- .agents/skills/git/SKILL.md
- .agents/skills/microsoft-code-reference/SKILL.md
- .agents/skills/microsoft-docs/SKILL.md
- .agents/skills/microsoft-skill-creator/references/skill-templates.md
- .agents/skills/microsoft-skill-creator/SKILL.md
- .agents/skills/skill-creator/references/output-patterns.md
- .agents/skills/skill-creator/references/workflows.md
- .agents/skills/skill-creator/SKILL.md
- .agents/skills/tunit-testing/references/aspire-integration.md
- .agents/skills/tunit-testing/references/aspnetcore-integration.md
- .agents/skills/tunit-testing/references/assertions.md
- .agents/skills/tunit-testing/references/data-driven.md
- .agents/skills/tunit-testing/references/infrastructure-and-troubleshooting.md
- .agents/skills/tunit-testing/references/lifecycle-hooks.md
- .agents/skills/tunit-testing/SKILL.md
- AGENTS.md
- backend/AGENTS.md
- backend/tests/AGENTS.md
- Front/AGENT.md
- opencode.jsonc
C# AppHost Authoring
Patterns for editing C# AppHosts — both SDK-style (.csproj + Program.cs) and file-based (apphost.cs with #:sdk / #:package directives).
Look up unfamiliar API:aspire docs api search <query> --language csharp
thenaspire docs api get <id>. Don't guess overloads.
SDK-style (.csproj)
Program.cs:
var builder = DistributedApplication.CreateBuilder(args);
var pg = builder.AddPostgres("pg").AddDatabase("appdb");
var cache = builder.AddRedis("cache");
var api = builder.AddProject<Projects.Api>("api")
.WithReference(pg)
.WithReference(cache)
.WaitFor(pg)
.WithExternalHttpEndpoints();
builder.AddProject<Projects.Worker>("worker")
.WithReference(pg)
.WaitFor(pg);
builder.AddNextJsApp("web", "../web")
.WithReference(api)
.WaitFor(api)
.WithBrowserLogs();
builder.Build().Run();The Projects.X strongly-typed reference comes from the SDK — <Sdk Name="Aspire.AppHost.Sdk" /> in .csproj and <ProjectReference> for each project.
For projects not in the SDK references, use the path overload:
builder.AddProject("api", "../Api/Api.csproj")
.WithReference(pg);File-based AppHost (apphost.cs)
Top of file uses #:sdk and #:package directives — no .csproj required:
#:sdk Aspire.AppHost.Sdk
#:package Aspire.Hosting.PostgreSQL@13.*
#:package Aspire.Hosting.Redis@13.*
#:package Aspire.Hosting.NodeJs@13.*
var builder = DistributedApplication.CreateBuilder(args);
var pg = builder.AddPostgres("pg").AddDatabase("appdb");
var cache = builder.AddRedis("cache");
var api = builder.AddProject("api", "../Api/Api.csproj")
.WithReference(pg)
.WithReference(cache)
.WithExternalHttpEndpoints();
builder.AddNextJsApp("web", "../web")
.WithReference(api)
.WithBrowserLogs();
builder.Build().Run();In file-based mode you cannot use Projects.X strongly-typed references — use the path overload of AddProject.
Common Builder Methods
| Method | Purpose |
|---|---|
AddProject<T>(name) / AddProject(name, path) | Add a .NET project |
AddContainer(name, image) | Add a container |
AddDockerfile(name, contextPath) | Build from a Dockerfile |
AddNodeApp(name, scriptPath) | Plain Node service |
AddNextJsApp(name, projectPath) | Next.js with auto standalone publish |
AddViteApp(name, projectPath) | Vite app — pair with PublishAsStaticWebsite |
AddPostgres / AddRedis / AddMongoDB / AddRabbitMQ / AddSqlServer / AddMySql / AddKafka | Datastores & messaging |
AddAzureCosmosDB / AddAzureServiceBus / AddAzureRedis / AddAzureStorage / AddAzureSqlServer | Azure resources |
WithReference(other) | Inject connection string / endpoints |
WaitFor(other) | Block start until target is ready |
WithEnvironment("KEY", value) | Add env var (any value type — endpoint, parameter, expression) |
WithExternalHttpEndpoints() | Mark HTTP endpoints as externally reachable |
WithEndpoint(name, e => …) | Add or update existing endpoints |
WithHttpHealthCheck(path) | Wire health check used by WaitFor |
Endpoints
WithEndpoint updates the existing endpoint when called twice with the same name (rather than throwing). Use this to layer endpoint config across helpers.
var api = builder.AddProject<Projects.Api>("api")
.WithEndpoint("admin", e => e.Port = 9000)
.WithEndpoint("admin", e => e.ExcludeReferenceEndpoint = true);
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// Admin endpoint is NOT injected into consumers via WithReference().Compute Environments
When multiple environments are declared, every resource must explicitly bind to one with .WithComputeEnvironment(env).
var aca = builder.AddAzureContainerAppEnvironment("aca");
var aks = builder.AddAzureKubernetesEnvironment("aks")
.WithSystemNodePool("Standard_D2s_v5", minCount: 1, maxCount: 3);
builder.AddProject<Projects.Api>("api").WithComputeEnvironment(aca);
builder.AddProject<Projects.Worker>("worker").WithComputeEnvironment(aks);Plain Kubernetes (Helm-based): AddKubernetesEnvironment("k8s").
JavaScript Publish Helpers
| Helper | Use For |
|---|---|
PublishAsStaticWebsite(apiPath, apiTarget) | Vite SPA → YARP-served static site, optional API reverse-proxy |
PublishAsNodeServer(entryPoint, outputPath) | Pre-bundled Node server (TanStack Start, SvelteKit) |
PublishAsPackageScript(scriptName) | package-manager start / serve runtime (full Nitro Next.js, Remix, Astro SSR) |
#pragma warning disable ASPIREJAVASCRIPT001
builder.AddViteApp("web", "../web")
.WithReference(api)
.PublishAsStaticWebsite(apiPath: "/api", apiTarget: api);
#pragma warning restore ASPIREJAVASCRIPT001AddNextJsApp auto-applies standalone publishing — no explicit PublishAs* needed. Set output: "standalone" in next.config.js.
Browser Logs
builder.AddViteApp("frontend", "../frontend")
.WithBrowserLogs(); // Aspire.Hosting.Browsers — adds console + screenshots to dashboardAzure-Specific
| API | Purpose |
|---|---|
AddAzureFrontDoor("frontdoor").WithOrigin(api).WithOrigin(web) | Global edge/CDN — provisions endpoint, origin group, origin, route per WithOrigin |
AddNetworkSecurityPerimeter("nsp").WithAccessRule(...) + resource.WithNetworkSecurityPerimeter(nsp) | NSP for Storage / Key Vault / Cosmos / SQL |
AddAzureKubernetesEnvironment("aks").WithSystemNodePool(sku, minCount, maxCount) | AKS hosting |
AddPromptAgent(...) | Azure AI Foundry Prompt Agent (replaces non-functional AddAndPublishPromptAgent) |
resource.WithPrivateEndpoint() | Now supported on ACR, Azure OpenAI, AI Foundry |
Lifecycle Hooks
builder.SubscribeBeforeStart(async e => { /* runs before resources start */ });
builder.SubscribeAfterResourcesCreated(async e => { /* runs after creation */ });HTTP Commands
builder.AddProject<Projects.Api>("api")
.WithHttpCommand("/admin/sync", "Sync now", commandOptions: new()
{
ResultMode = HttpCommandResultMode.Auto // None | Auto | Json | Text
});HttpCommandResultMode returns the response body to the dashboard's notification center.