This #dotnet #tutorial shows how to persist data for a SQL Server resource in .NET Aspire app host project. We start with a solution from a previous video • .NET Aspire SqlServer Entity Framewor... and configure a volume for a #sql Server resource using WithBindMount. Next, a database is created using SQL Server Configuration Manager and a script to add test tables is ran. Finally, we show that the database has not been lost between AppHost project runs.
First, using an existing Blazor project, we add .NET Aspire Service Defaults project. The website is ran to show logging and health-check endpoint. Next, .NET Aspire App Host project is added and set as a start up project. Finally, the website is run again and the dashboard available in the AppHost project is displayed.