{"id":374,"date":"2026-04-14T10:00:00","date_gmt":"2026-04-14T17:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/aspire\/?p=374"},"modified":"2026-04-13T15:46:40","modified_gmt":"2026-04-13T22:46:40","slug":"aspire-new-database-integrations","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/aspire\/aspire-new-database-integrations\/","title":{"rendered":"New Aspire database integrations"},"content":{"rendered":"<p>Aspire 13.2 is here, and has some new features that will make it easier for you to interact with your databases.<\/p>\n<ul>\n<li>Do you like Azure Data Lake Storage? We have a new <a href=\"https:\/\/aspire.dev\/integrations\/cloud\/azure\/azure-storage-datalake\/\">Azure Data Lake Storage integration<\/a> for you to use.<\/li>\n<li>Do you like MongoDB but want to define data in C#? Well, you can use the new <a href=\"https:\/\/aspire.dev\/integrations\/databases\/efcore\/mongodb\/mongodb-efcore-client\/\">MongoDB Entity Framework Core (EF Core) client integration<\/a>.<\/li>\n<\/ul>\n<p>There are also some other improvements to make your database life easier and smoother. Let&#8217;s take a closer look.<\/p>\n<h2>Two major new integrations<\/h2>\n<p>The new integrations broaden your choice of data storage for Aspire apps.<\/p>\n<h3>MongoDB Entity Framework Core<\/h3>\n<p>There&#8217;s been a MongoDB integration in Aspire for a long time, but it didn&#8217;t let you define documents in object-oriented code. Now, if you want to write C# to store and query documents in MongoDB, the new <a href=\"https:\/\/aspire.dev\/integrations\/databases\/efcore\/mongodb\/mongodb-efcore-client\/\">MongoDB EF Core integration<\/a> has got your back. Plus you get production-ready health checks, automatic service discovery, and all the conveniences you&#8217;ve learned to expect from an Aspire database client.<\/p>\n<p><div class=\"alert alert-info\"><p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--Info\"><\/i><strong>Note<\/strong><\/p> To use EF Core with Aspire and MongoDB, you add the existing <strong>MongoDB hosting integration<\/strong> as you did in previous versions. Then choose the new <strong>MongoDB EF Core client integration<\/strong> for your consuming APIs and other projects. <\/div><\/p>\n<p>Use the Aspire CLI to add the MongoDB hosting integration to the AppHost project:<\/p>\n<pre><code class=\"language-bash\">aspire add mongo<\/code><\/pre>\n<p>This scaffolds the necessary NuGet package and wiring. In your AppHost, you can define a MongoDB service like this:<\/p>\n<pre><code class=\"language-csharp\">var mongodb = builder.AddMongoDB(\"mongodb\")\n    .WithDataVolume()\n    .WithLifetime(ContainerLifetime.Persistent);\n\nvar apiService = builder.AddProject&lt;Projects.ApiService&gt;(\"api\")\n    .WithReference(mongodb);<\/code><\/pre>\n<p>Then, in the projects that consume the MongoDB service, install the MongoDB EF Core client integration:<\/p>\n<pre><code class=\"language-bash\">dotnet add package Aspire.MongoDB.EntityFrameworkCore<\/code><\/pre>\n<p>Next, in that project&#8217;s <strong>Program.cs<\/strong> file, call the <code>AddMongoDBContext<\/code> extension method. That will register the EF Core <code>DbContext<\/code> in the dependency injection container:<\/p>\n<pre><code class=\"language-csharp\">builder.AddMongoDbContext&lt;MyDbContext&gt;(\"mongodb\", \"mydb\");<\/code><\/pre>\n<p>When you want to use the MongoDB client, get it from the DI container:<\/p>\n<pre><code class=\"language-csharp\">private readonly MyDbContext _context;\n\npublic ProductsController(MyDbContext context)\n{\n    _context = context;\n    \/\/ Use the context to access the database here.\n}<\/code><\/pre>\n<p><div class=\"alert alert-info\"><p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--Info\"><\/i><strong>Note<\/strong><\/p> Just like in any other EF Core project, you&#8217;ll have to define the database objects and context in your code. For more information, see <a href=\"https:\/\/learn.microsoft.com\/ef\/core\/dbcontext-configuration\/\">https:\/\/learn.microsoft.com\/ef\/core\/dbcontext-configuration\/<\/a> <\/div><\/p>\n<p>The integration automatically handles connection pooling, telemetry collection, and health checks. You get real-time visibility into your MongoDB queries without adding extra configuration code.<\/p>\n<h3>Azure Data Lake Storage<\/h3>\n<p><a href=\"https:\/\/aspire.dev\/integrations\/cloud\/azure\/azure-storage-datalake\/\">Azure Data Lake Storage (ADLS) integration<\/a> opens up new possibilities for analytics and big data workloads. Whether you&#8217;re building data pipelines, ETL processes, or analytics platforms, Aspire&#8217;s ADLS integration brings the same production-grade service discovery and health checking you expect from a cloud-native platform.<\/p>\n<p>To get started, install the Azure Storage hosting integration:<\/p>\n<pre><code class=\"language-bash\">aspre add azure-storage<\/code><\/pre>\n<p>In your AppHost, add the Data Lake resources and pass them to client APIs:<\/p>\n<pre><code class=\"language-csharp\">var storage = builder.AddAzureStorage(\"azure-storage\");\nvar dataLake = storage.AddDataLake(\"data-lake\");\nvar fileSystem = storage.AddDataLakeFileSystem(\"data-lake-file-system\");\n\nvar analyticsService = builder.AddProject&lt;Projects.AnalyticsService&gt;(\"analytics\")\n                              .WithReference(dataLake)\n                              .WithReference(fileSystem); <\/code><\/pre>\n<p>Then, in the API that consumes the Data Lake resources, register them in the dependency injection container:<\/p>\n<pre><code class=\"language-csharp\">builder.AddAzureDataLakeServiceClient(\"data-lake\");\nbuilder.AddAzureDataLakeFileSystemClient(\"data-lake-file-system\");<\/code><\/pre>\n<p>Retrieve those resources like this:<\/p>\n<pre><code class=\"language-csharp\">private readonly DataLakeServiceClient _serviceClient;\nprivate readonly DataLakeFileSystemClient _fileSystemClient;\n\npublic ProductsController(DataLakeServiceClient serviceClient, DataLakeFileSystemClient fileSystemClient)\n{\n    _serviceClient = serviceClient;\n    _fileSystemClient = fileSystemClient;\n}<\/code><\/pre>\n<p>The integration automatically provisions the necessary Azure resources and injects them into your services. No manual connection string management, no credential hunting \u2014 Aspire handles it.<\/p>\n<h2>Quality-of-life improvements<\/h2>\n<p>Beyond the headline features, this release includes refinements that make existing database integrations more robust and developer-friendly.<\/p>\n<h3>MongoDB connection string fix<\/h3>\n<p>MongoDB connections now correctly prepend the forward slash to the database name in the connection string. This fixes an edge case that could cause connection failures in specific setups. If you&#8217;ve worked around this issue before, you can remove that workaround in Aspire 13.2.<\/p>\n<h3>SQL Server exports<\/h3>\n<p>The latest <code>Aspire.Hosting.SqlServer<\/code> package exports additional server configuration options, to give you finer-grained control over how Aspire provisions and configures SQL Server containers in your AppHost.<\/p>\n<pre><code class=\"language-csharp\">var sql = builder.AddSqlServer(\"sql\")\n    .WithImage(\"mcr.microsoft.com\/mssql\/server\", \"2022-latest\")\n    .WithDataVolume()\n    .WithLifetime(ContainerLifetime.Persistent);\n\nvar myappdb = sql.AddDatabase(\"myapp\");<\/code><\/pre>\n<h3>Emulator updates and security enhancements<\/h3>\n<p>We&#8217;ve bumped the Azure ServiceBus emulator to 2.0.0 and App Configuration emulator to 1.0.2, which bring the latest stability and feature improvements. CosmosDB&#8217;s preview emulator now includes a readiness check \u2014 no more guessing whether your emulator is actually ready to handle requests.<\/p>\n<p>Azure Managed Redis switched to <code>rediss:\/\/<\/code> (Redis Secure) as the default scheme, so your Redis connection is encrypted out of the box.<\/p>\n<h2>Why this matters<\/h2>\n<p>These are incremental changes to Aspire&#8217;s already broad database feature set, but if you&#8217;re the developer who needs to use MongoDB with EF Core in your Aspire application or you have a data lake and want to include analysis from it to drive productivity, they&#8217;ll make a huge difference. They might also make you consider new data features, which may now be much easier to implement.<\/p>\n<p>Read the <a href=\"https:\/\/aspire.dev\/whats-new\/aspire-13-2\/#-integrations-updates\">Aspire 13.2 release notes<\/a> for more info on new and improved integrations.<\/p>\n<h2>Get started<\/h2>\n<p><a href=\"https:\/\/get.aspire.dev\">Upgrade to Aspire 13.2<\/a> and try the new integrations in your next project. The <code>aspire add<\/code> command will scaffold everything you need. Start with MongoDB EF Core if you&#8217;re modernizing your data layer, or explore Azure Data Lake Storage if you&#8217;re building data-intensive workloads.<\/p>\n<p>You deserve data access to be this easy and well-managed.<\/p>\n<h2>Get involved<\/h2>\n<ul>\n<li><strong>\ud83d\udcd6 Learn more:<\/strong> Read the full documentation on <a href=\"https:\/\/aspire.dev\/integrations\/gallery\/\">Aspire integrations<\/a> at aspire.dev.<\/li>\n<li><strong>\ud83d\udcac Give us feedback:<\/strong> We&#8217;d love to hear what you think \u2014 file issues or join discussions on the <a href=\"https:\/\/github.com\/dotnet\/aspire\">Aspire GitHub repo<\/a>.<\/li>\n<li><strong>\ud83c\udf10 Join the community:<\/strong> Follow us and connect with other Aspire developers at <a href=\"https:\/\/aspire.dev\/community\/\">aspire.dev\/community<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Aspire 13.2 brings MongoDB Entity Framework Core and Azure Data Lake Storage integrations, plus quality-of-life improvements to existing database clients.<\/p>\n","protected":false},"author":209609,"featured_media":375,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,19],"tags":[59,27,63,61,60,11,62,64],"class_list":["post-374","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspire-category","category-integrations","tag-aspire-13-2","tag-client-integrations","tag-data-lake","tag-databases","tag-hosting-integrations","tag-integrations","tag-mongodb","tag-sql-server"],"acf":[],"blog_post_summary":"<p>Aspire 13.2 brings MongoDB Entity Framework Core and Azure Data Lake Storage integrations, plus quality-of-life improvements to existing database clients.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/posts\/374","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/users\/209609"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/comments?post=374"}],"version-history":[{"count":1,"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/posts\/374\/revisions"}],"predecessor-version":[{"id":376,"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/posts\/374\/revisions\/376"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/media\/375"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/media?parent=374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/categories?post=374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/tags?post=374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}