aspire-service-defaults

Create a shared .NET Aspire ServiceDefaults project for OpenTelemetry, health checks, service discovery, and HTTP resilience.

57|7|Updated Aug 6, 2025
One-click install
npx skills add https://github.com/seiggy/lucia-dotnet --skill aspire-service-defaults-seiggy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aspire-service-defaults
Source: https://github.com/seiggy/lucia-dotnet/tree/main/.github/skills/aspire-service-defaults
Command: npx skills add https://github.com/seiggy/lucia-dotnet --skill aspire-service-defaults-seiggy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the setup of .NET Aspire applications by providing a centralized, reusable project for common service configurations, ensuring consistency and reducing boilerplate code across all microservices.

Core Features & Use Cases

  • Unified Observability: Centralizes OpenTelemetry for logging, tracing, and metrics.
  • Standardized Health Checks: Configures readiness and liveness endpoints consistently.
  • Service Discovery & Resilience: Integrates service discovery and HTTP resilience policies.
  • Use Case: When building a new microservice within an existing .NET Aspire application, you can quickly integrate this ServiceDefaults project to ensure it adheres to the established observability and resilience standards without manual configuration.

Quick Start

Add the MyApp.ServiceDefaults project to your Aspire application and call builder.AddServiceDefaults() in your service's Program.cs.

Frequently Asked Questions about aspire-service-defaults

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I centralize OpenTelemetry and health check configuration in .NET Aspire microservices?

You can centralize OpenTelemetry and health checks by adding a shared ServiceDefaults project to your .NET Aspire application. Call builder.AddServiceDefaults() in your service's Program.cs to apply uniform observability and resilience configurations across all microservices.

What is the best way to standardize service discovery and HTTP resilience in a distributed .NET application?

Standardizing service discovery and HTTP resilience is achieved by referencing a shared ServiceDefaults project. This project integrates service discovery and resilience policies centrally, ensuring robust communication patterns across your distributed .NET application without duplicating manual configuration.

Do I need the .NET Aspire SDK to use a shared ServiceDefaults project for configuration?

Yes, using a shared ServiceDefaults project requires the .NET Aspire SDK and standard .NET hosting patterns. This environment provides the necessary framework support to centralize telemetry, health checks, and resilience configurations across your distributed services.

How do I add service defaults to a new microservice in an existing Aspire application?

To add service defaults to a new microservice, include the MyApp.ServiceDefaults project in your Aspire application. Then, invoke builder.AddServiceDefaults() in the microservice's Program.cs to automatically inherit centralized observability and resilience standards.

Why should I use a centralized ServiceDefaults project instead of manually configuring observability for each microservice?

Using a centralized ServiceDefaults project eliminates boilerplate code and ensures configuration consistency across microservices. It streamlines setup by providing a unified project for OpenTelemetry, health checks, and HTTP resilience, reducing manual errors and maintenance overhead.