Cloud-native: Docker containers and Python services with .NET Aspire 8.1
Microsoft's .NET Aspire framework brings innovations for cloud-native development - with a focus on Docker containers and the orchestration of Python services.
(Image: iX mit KI)
- Robert Lippert
Microsoft has presented the new version 8.1 of its cloud-native framework .NET Aspire. In addition to additional components and the expansion of the dashboard and telemetry functionality, Microsoft's release focuses on new functions for building Docker containers and help for handling Python code.
With the two new methods AddDockerfile(...) and WithDockerfile(...), developers can now specify a Dockerfile that .NET Aspire uses when starting the app host in order to build a Docker container from it. The AddDockerfile(...) method is intended for new, user-defined containers, while WithDockerfile(...) is available for customizing existing container resources. Microsoft specifies how to use the new methods in more detail in its developer documentation.
Videos by heise
Polyglot micro-services architectures
.NET Aspire has long been compatible with Node.js apps. With the new version 8.1, developers can now also orchestrate Python services using the new AddPythonProject(...) method. In the background, .NET Aspire uses the Virtual Environment (venv) tool. Microsoft emphasizes at this point that developers should install dependencies manually (via pip install -r requirements.txt). .NET Aspire itself is not yet able to do this.
Under the hood, the new release of Microsoft's cloud-native framework offers a whole range of other additions in terms of resource types and components, features for testing and the OpenTelemetry functionality, as well as revised instance names, which are now no longer made up of the complete GUID, but of the application name plus part of the instance ID. Microsoft lists details of all the new features in the release notes.
(dahe)