close
close

Cloud-Native .NET Aspire 8.1 Aims at Building Containers, Orchestrating Python — Visual Studio Magazine

News

Cloud-Native .NET Aspire 8.1 Aims at Python Containerization and Orchestration

The first major update to Microsoft’s .NET Aspire platform includes a range of new features and improvements, including container imaging and Python orchestration.

.NET Aspire is designed for cloud app development, providing a framework for building, testing, and deploying distributed applications that typically leverage cloud constructs like microservices, containers, serverless architecture, and more. The new 8.1 release, announced Tuesday, is the first significant update to the platform since it became generally available in May, though portions of the preview were already built into .NET 8.

Since then, Microsoft has been actively promoting the new offering, emphasizing its importance for the company.

The infrastructure itself can be called distributed because it is part of a set of NuGet packages that can be used to build applications in Visual Studio, Visual Studio Code, or the command line.

.NET Aspire
(Click on the image for a larger view.) .NET Aspire (source: Microsoft).

“This release introduces several new features and improvements based on feedback from developers using .NET Aspire in production applications,” said Microsoft’s Mitch Denny in the July 23 announcement of .NET Aspire 8.1.

He highlighted two special features of the update: support for creating container images using AddDockerfile(...) method and orchestration of Python code with AddPythonProject(...) method.

Container images
Working with AddDockerfile(...) a method that automatically creates a Dockerfile when App Host runs, WithDockerfile(...) The method also helps developers automate Dockerfile building and customization, allowing easy editing and integration with existing resources. So the former is ideal for creating new container resources, while the latter is used to modify existing container images.

Both methods support build arguments and secrets, allowing developers to safely pass parameters and sensitive information to the Docker build process while avoiding accidental exposure in the application manifest.

“This means you can quickly edit your Dockerfiles and rely on .NET Aspire to build them, without having to manually build them yourself,” Denny said.

Python Code Orchestration
The second major feature highlighted by Denny increases support for multilingual microservice architectures via code orchestration AddPythonProject(...) method. In .NET Aspire, orchestration is primarily focused on improving the local development environment by simplifying the management of configuration and connections for cloud applications.

The method, created by Willem Meints, allows developers to run Python-based services. To use it, developers need to install a Python hosting package and add a Python resource to their application model. The method uses the Python virtual environment tool (venv) and requires manual installation of dependencies specified in requirements.txt file. Also, if opentelemetry-distro(otlp) dependency is included, it enables telemetry in the .NET Aspire panel. However, due to limitations of the OpenTelemetry libraries, the application must be run with ASPIRE_ALLOW_UNSECURED_TRANSPORT environment variable set to true.

Python support joins the existing support for Node.js applications.

More Updates
Denny’s post also includes the following details:

  • New resource types and components available in containerized extensions, from Kafka UI to Azure Web PubSub
  • Testing improvements (easier to write test cases that require waiting for resources to be initialized)
  • Sample Metrics (sample data points for aggregated data)
  • Span Links (Creating Relationships Between Spans)
  • Improved instance ID names (friendly instance IDs instead of hard-to-read GUIDs)

For more information, see the Microsoft documentation titled What’s new in .NET Aspire.

about the author


David Ramel is an editor and writer at Converge360.