Udaiappa Ramachandran (Udai)
Web: https://udai.io
LinkedIn: https://linkedin.com/in/udair
.NET Aspire
About me
 Udaiappa Ramachandran (Udai)
 CTO/CSO @ Akumina Inc.,
 Microsoft MVP
 Cloud Expert – Microsoft Azure, AWS and Google
 Organizer – New Hampshire CLOUD .NET User Group
https://meetup.com/nashuaug
Agenda
 Introduction to .NET Aspire
 Building Blocks
 Demo
.NET Aspire Building Blocks
 Service Defaults
 Dashboard
 Orchestration
 Service Discovery
 Integrations
 Deployment
.NET Aspire Service Defaults
 Observability
 Resiliency
 Health Checks
.NET Aspire Orchestration
var builder = DistributedApplication.CreateBuilder(args);
var cache = builder.AddRedis("cache").WithRedisCommander();
var api = builder.AddProject<Projects.AspireDemo_Api>("aspiredemo-api")
.WithReference(cache);
builder.AddProject<Projects.AspireDemo_Web>("aspiredemo-web")
.WithReference(api);
builder.Build().Run();
.NET Aspire Service Discovery
var builder = DistributedApplication.CreateBuilder(args);
var cache = builder.AddRedis("cache").WithRedisCommander();
var api = builder.AddProject<Projects.AspireDemo_Api>("aspiredemo-api")
.WithReference(cache);
builder.AddProject<Projects.AspireDemo_Web>("aspiredemo-web")
.WithReference(api);
builder.Build().Run();
builder.Services.AddHttpClient<UserService>(c =>
{
var url = "https+http://aspiredemo-api";
c.BaseAddress = new(url);
});
.NET Aspire Dashboard
 Structured Logs
 Metrics
 Distributed Traces
 Dependencies
CNCF Cloud Native Landscape
https://
.NET Aspire Integrations
.NET Aspire Deployment Options
 HOW YOU DO IT TODAY
 AWS CDK
 AZURE DEV CLI
 dotnet run--publisher manifest--output-path aspire-manifest.json
 azd init
 azd infra synth //it outputs files that is created by azd up
 azd up
 VISUAL STUDIO
.NET Aspire Standalone Dashboard
Visit https://aspiredashboard.com
//Bash
docker run --rm -it  -p 18888:18888 -p 4317:18889  -d --name aspire-dashboard 
-e DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS="true" 
mcr.microsoft.com/dotnet/aspire-dashboard:9.0
//PowerShell
docker run --rm -it -p 18888:18888 -p 4317:18889 -d --name aspire-dashboard -e
DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS="true"
mcr.microsoft.com/dotnet/aspire-dashboard:9.0
OTLP Key Command: docker logs aspire-dashboard
Browse to: http://localhost:18888/
https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/dashboard/
References
 https://aka.ms/dotnet/aspire
 https://aka.ms/dotnet/aspire/start
 https://github.com/dotnet/aspire-samples
 https://github.com/CommunityToolkit/Aspire
 https://github.com/CommunityToolkit/Aspire/blog
 https://github.com/CommunityToolkit/Aspire/docs
 https://aka.ms/dotnet/aspire/hosting-integration
 https://aka.ms/dotnet/aspire/client-integration
 https://github.com/dotnet/aspire-samples/tree/main/samples/AspireWithAzureFunctions
 https://github.com/Azure/azure-functions-dotnet-worker
 https://github.com/dotnet/aspire
 https://learn.microsoft.com/dotnet/aspire/serverless/functions
 https://github.com/integrations-on-dotnet-aspire-for-aws
Thank you for your time and trust!
Nashua CLOUD .NET User Group

.NET Aspire Presentation by Udaiappa Ramachandran

  • 1.
    Udaiappa Ramachandran (Udai) Web:https://udai.io LinkedIn: https://linkedin.com/in/udair .NET Aspire
  • 2.
    About me  UdaiappaRamachandran (Udai)  CTO/CSO @ Akumina Inc.,  Microsoft MVP  Cloud Expert – Microsoft Azure, AWS and Google  Organizer – New Hampshire CLOUD .NET User Group https://meetup.com/nashuaug
  • 3.
    Agenda  Introduction to.NET Aspire  Building Blocks  Demo
  • 4.
    .NET Aspire BuildingBlocks  Service Defaults  Dashboard  Orchestration  Service Discovery  Integrations  Deployment
  • 5.
    .NET Aspire ServiceDefaults  Observability  Resiliency  Health Checks
  • 6.
    .NET Aspire Orchestration varbuilder = DistributedApplication.CreateBuilder(args); var cache = builder.AddRedis("cache").WithRedisCommander(); var api = builder.AddProject<Projects.AspireDemo_Api>("aspiredemo-api") .WithReference(cache); builder.AddProject<Projects.AspireDemo_Web>("aspiredemo-web") .WithReference(api); builder.Build().Run();
  • 7.
    .NET Aspire ServiceDiscovery var builder = DistributedApplication.CreateBuilder(args); var cache = builder.AddRedis("cache").WithRedisCommander(); var api = builder.AddProject<Projects.AspireDemo_Api>("aspiredemo-api") .WithReference(cache); builder.AddProject<Projects.AspireDemo_Web>("aspiredemo-web") .WithReference(api); builder.Build().Run(); builder.Services.AddHttpClient<UserService>(c => { var url = "https+http://aspiredemo-api"; c.BaseAddress = new(url); });
  • 8.
    .NET Aspire Dashboard Structured Logs  Metrics  Distributed Traces  Dependencies
  • 9.
    CNCF Cloud NativeLandscape https://
  • 10.
  • 11.
    .NET Aspire DeploymentOptions  HOW YOU DO IT TODAY  AWS CDK  AZURE DEV CLI  dotnet run--publisher manifest--output-path aspire-manifest.json  azd init  azd infra synth //it outputs files that is created by azd up  azd up  VISUAL STUDIO
  • 12.
    .NET Aspire StandaloneDashboard Visit https://aspiredashboard.com //Bash docker run --rm -it -p 18888:18888 -p 4317:18889 -d --name aspire-dashboard -e DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS="true" mcr.microsoft.com/dotnet/aspire-dashboard:9.0 //PowerShell docker run --rm -it -p 18888:18888 -p 4317:18889 -d --name aspire-dashboard -e DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS="true" mcr.microsoft.com/dotnet/aspire-dashboard:9.0 OTLP Key Command: docker logs aspire-dashboard Browse to: http://localhost:18888/ https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/dashboard/
  • 13.
    References  https://aka.ms/dotnet/aspire  https://aka.ms/dotnet/aspire/start https://github.com/dotnet/aspire-samples  https://github.com/CommunityToolkit/Aspire  https://github.com/CommunityToolkit/Aspire/blog  https://github.com/CommunityToolkit/Aspire/docs  https://aka.ms/dotnet/aspire/hosting-integration  https://aka.ms/dotnet/aspire/client-integration  https://github.com/dotnet/aspire-samples/tree/main/samples/AspireWithAzureFunctions  https://github.com/Azure/azure-functions-dotnet-worker  https://github.com/dotnet/aspire  https://learn.microsoft.com/dotnet/aspire/serverless/functions  https://github.com/integrations-on-dotnet-aspire-for-aws
  • 14.
    Thank you foryour time and trust! Nashua CLOUD .NET User Group

Editor's Notes

  • #4 Powerful tools, templates, and packages for building observable production-ready aps Extensible, OpenTelemetry Built-in, & Ready for Any Cloud Aspire is a platform that will allow developers to build curated experiences that affect local development, testing and deployment of applications Build, test, and deploy apps seamlessy from code to cloud Extensible, OpenTelemetry built-in, & Ready fro any Cloud What Every App Needs – Observability, Resiliency, Scalability, and Manageability What .NET Gives: Observability –Built in metrics with dimensions, DI integration for metrics, Better Logging support (faster, can object serialization), Enrichment, Redaction, Testing fakes for logging & metrics Resiliency – New Polly based resiliency packages, SignalR Stateful Reconnect Scalability – AOT (increased density), Performance, Chiseled Ubuntu Manageability – Certificate auto-rotation support in Kestrel
  • #5 What are aspire defaults? ServiceDefaults stays in your projects; set of defaults that making sense as starting point Enable live telemetries, traces; healthy endpoints Resiliencey: real-time detection and response to issues; fault tolerance; scalability; redundancy;graceful degradation; Example logs the error
  • #7 Talk to multiple services needs to be discovered for communication. One application into other
  • #8 Standalone: docker run --rm –it –p 18888:18888 –p 4317:18889 –d –name aspire-dashboard mcr.Microsoft.com/dotnet/aspire-dashboard:9.0.0 aspiredashboard.com
  • #9 https://landscape.cncf.io/
  • #11 AspireHost> dotnet run --publisher manifest --output-path aspire-manifest.json azd init azd infra synth //it outputs files that is created by azd up azd up
  • #12 Make sure configure the OLTP into the app
  • #13 https://github.com/jamesmontemagno