Paul Krill
Editor at Large

Microsoft .NET Aspire automates Dockerfile builds

news
Jul 23, 20242 mins
Cloud NativeDevelopment Libraries and FrameworksKubernetes

Latest update to Microsoft’s cloud-ready stack for building distributed applications also adds the ability to launch Python-based services.

cloud man success japan
Credit: Shutterstock

Microsoft has released .NET Aspire 8.1, an update to the cloud-ready stack for building distributed applications that adds support for building container images from Dockerfiles, as well as support for launching Python-based services.

NET Aspire 8.1 was unveiled on July 23. Developers can find instructions on installing .NET Aspire at learn.microsoft.com.

For building containers, .NET Aspire 8.1 adds two extensions, AddDockerfile(...) and WithDockerfile(...), that allow .NET Aspire to automatically build a Dockerfile when the app host runs. This enables developers to quickly edit Dockerfiles and rely on .NET Aspire to build them without having to manually build these themselves, Microsoft said. In addition to Dockerfile build support, Microsoft has added the ability to provide build arguments and build secrets.

For launching Python-based services, .NET Aspire 8.1 adds the  AddPythonProject(...) extension method. Python support in .NET Aspire builds on the virtual environment (venv) tool. Launching Python projects from .NET Aspire also requires having the Aspire.Hosting.Python package installed.

With .NET Aspire 8.1 release, Microsoft said it would not be shipping an update of the Visual Studio IDE that includes the new workload. Therefore, developers should use installation instructions to update and install .NET Aspire. .NET Aspire is provided through a collection of NuGet packages that handle cloud-native concerns.

Other improvements featured in .NET Aspire 8.1:

  • A new WaitForResourceAsync(...) API is intended to make it easier to write test cases that need to wait for resources to initialize. Also, support has been added for MSTest and NUnit in test project templates.
  • Hosting packages for Keycloak and Elasticsearch components are featured in preview.
  • A hosting package has been added for Garnet, an open-source cache-store system by Microsoft Research that is compatible with the RESP protocol.
  • A hosting package has been added for the Milvus vector database.
  • Support has been added for Azure WebPubSub.