Location>code7788 >text

Cloud-Native .NET Aspire 8.1 Adds Support for Building Containers, Orchestrating Python

Popularity:355 ℃/2024-07-30 07:39:15

.NET Aspire for cloud-native application development, providing a framework for building, testing, and deploying distributed applications that typically utilize cloud constructs such as microservices, containers, and serverless architectures.The new 8.1 release, announced on July 23, 2024, is the first major update to the platform since its official release in May, and Microsoft's first major update to .NET Aspire Aspire 8.1 addresses container image building and Python code orchestration as well as a host of new features and enhancements.

The Aspire framework itself can be called a distributed framework because it resides in a collection of NuGet packages that can be used to build applications in Visual Studio, Visual Studio Code, or on the command line.

Microsoft's Mitch Denny on .NET Aspire 8.1 on July 23rdbulletinNET Aspire in production applications," he says. "This release includes a number of new features and quality-of-life improvements derived from feedback from developers using .NET Aspire in their production applications. He highlights two specific features of this update: support for using AddDockerfile(...)Building a container imageand using AddPythonProject(...).Programming Python Code.


container image
Using automatic builds of Docker files while the application host is runningAddDockerfile(...)The methodWithDockerfile(...)can also help developers automate Dockerfile building and customization by allowing easy editing and integration with existing resources. As such, the former is ideal for creating new container resources, while the latter is used to modify existing container images.

Both methods support build parameters and keys, enabling developers to pass parameters and sensitive information securely to the Docker build process while avoiding accidental disclosure in the application manifest.

This means you can quickly edit Dockerfiles and rely on .NET Aspire to build them without having to manually build them yourself," says Denny.


Programming Python Code


The second major feature Denny emphasized was the enhanced support for multi-language microservices architectures through a code orchestration approach. NET Aspire, the business process focuses primarily on enhancing the native development experience by simplifying the management of configuration and interconnection of cloud-native applications.

This method, contributed by Willem Meints, allows developers to launch Python-based services. To use it, developers need to install the Python hosting package and add Python resources to their application model. The methodAddPythonProject(...)Utilizing Python's virtual environment (venv) tool requires manual installation of the dependencies specified in the documentation. In addition, if the dependency is included, it will enable telemetry in the .NET Aspire dashboard. However, due to limitations in the OpenTelemetry library, the application must be run with the environment variable set to .opentelemetry-distro[otlp]ASPIRE_ALLOW_UNSECURED_TRANSPORTtrue

Python support adds existing support for applications.


Denny's article also provides details about the following:

  • New resource types and components available in containerized extensions ranging from Kafka UI to Azure Web PubSub
  • Testing improvements (easier to write test cases that need to wait for resources to initialize)
  • Example indicators (example 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 Microsoft'sWhat's New in .NET AspireDocumentation.