Hero image credit: Photo by Harold Vasquez:

Version 9.1 of .NET Aspire released a couple weeks ago and it has brought a whole host of new features to the framework. Aspire just keeps getting better and better. Here’s a few of my favorite highlights from the release.

Filtering of Resources By Type, State, Health

There are now a set of great and useful filters for the resource dashboard list. These include filtering by Type, State & Health. So if you only want to see your Docker containers, or just your SQL Server instances, of if you just want to see .NET projects in a failed state, you can do so now. This will be great for large projects with a pleathora of resources in them.

Ability to filter resources in the dashboard by type, state, or health

Relationships in the Resources Dashboard

Related resources are now shown in a parent/child view in the resource dashboard. For example, if you created a database in your SQL Server instance, it shows up nested beneath the server instead of who knows where else in the list of resources.

A SQL Server database shown nested beneath the SQL Server instance in the dashboard

Improved Console Logs

You can now export your console logs if you want to use them in a different app for diagnostics. And you can turn timestamps on and off if you want to hide them for easier viewing of log information. And the timestamp choice stays, so next time you launch, it remembers your choice.

Buttons to download logs or to turn timestamps off and on

Another great improvement for console logs: If they have URLs in the logs (or anywhere in the dashboard), those URLs are now clickable. So you no longer have to copy/paste URLs if you need to open them up.

Clear Logs and Telemetry At Any Point

We’ve all been there. We want to collect telemetry and logs for a certain action or event in our application debugging flow, but we don’t want to have to sift through all the startup telemetry to do so. Aspire has got your back. New buttons have been added to the various log, metrics, and telemetry pages which allow you to clear out the log data up to that point. You can clear the logs for a single resource, or clear everything with a single click.

This is huge. Now you can start up the apps, clear the data, then execute that one command and see only what’s going on in your app while that one command is running. So much debugging time will be saved by this.

Button to clear logs for current resource or all resources

The dashboard login link now appears in the AppHost console. So if the browser fails to launch for some reason, just click the link in the console and it will take you to the Aspire dashboard. And, it’s clickable.

Aspire dashboard link in AppHost console

Additional Resource Details

The details pane for resources in the dashboard now includes some additional data, such as references to related resources. So you can now see in the details if your API app has a reference to your database, and so forth.

References between resources in resource details tab

On-Demand Resource Start

If you have resources you don’t want to start with all the other pieces of your application, you can apply the WithExplicitStart() command on the resource in your AppHost Program code. This will prevent the resource from automatically starting with the rest of the application. This is especially useful for any POC or setup/reset application pieces that you only need to run occasionally, but still want them to be a part of the application.

builder.AddProject<Projects.School_App_Web>("webfrontend")
    .WithExternalHttpEndpoints()
    .WithReference(cache)
    .WithReference(apiService)
    .WithExplicitStart();

Expanded Azure Local Development Support

New emulators have been added for Service Bus, SignalR, and Cosmos DB, improving your ability to develop locally without the need for connecting to real Azure resources.

And overall Cosmos DB support has expanded as well, allowing support for Entra ID authentication and support for modeling databases in the app host instead of the app resource if desired.

Service Bus support allows you to define your topics, queues, and subscriptions from your AppHost now, making management and sharing of these resources across your app much easier.

CORS Support for Local Domains

If you’re running resources with custom local domains, you can now set an environment variable (DOTNET_DASHBOARD_CORS_ALLOWED_ORIGINS) to allow the dashboard to receive the log data from those resources.

Command Buttons On Console Log Screen

There are now buttons to start and stop a resource directly from the console log for that resource. You no longer need to go back to the main resource dashboard to do so. This also applies to any custom commands you have defined for that resource.

Buttons for start/stop and any custom commands

Vastly Improved Docker Integration

There are a host of Docker integration improvements and bug fixes, such as additional support for publishing resources as Docker files, fixing the issue where the Docker network wasn’t cleaned up after the app stopped, and so forth.

Testing Improvements

There is much improved support for cross-functional testing from the AppHost with things like the ability to pass parameters into the app host and the ability to disable port randomization, or even the ability to disable the dashboard entirely for complete control from your testing suite.

Azure Container Apps

Support for ACA has gotten much better with 9.1, including support for deploying npm apps. It’s still not fully on par with Docker, but it’s getting close now.

Localization on the Dashboard

You can now override the default browser language so that your Aspire dashboard will display in whatever supported language you select.

Learn More

This is only the tip of the iceberg, so to speak. There’s a whole lot more in 9.1, and some great new features on their way in future versions of Aspire.

There are two great resources for learning more about .NET Aspire 9.1 and all the new features.

The What’s New post on Microsoft Learn https://learn.microsoft.com/en-us/dotnet/aspire/whats-new/dotnet-aspire-9.1

and follow James Newton-King on Bluesky https://bsky.app/profile/james.newtonking.com