Giter Club home page Giter Club logo

dotnet.aspire's Introduction

This repository serves to demonstrate the current capabilities of .NET Aspire.

Usage

To run the project, ensure you have the required version of .NET and Docker installed. The project can be launched like any other C# project.

Current Requirements :

  • .NET8.0 or up
  • Docker 25.0.2 or up

That is .NET Aspire

.NET Aspire is an opinionated, cloud ready stack for building observable, production ready, distributed applications. .NET Aspire is delivered through a collection of NuGet packages that handle specific cloud-native concerns.

Features

  • Cloud-native Architecture: .NET Aspire boasts a cloud-native architecture, making it easy to deploy and manage in Azure environments.
  • Seamless Azure Deployment: With .NET Aspire, deploying applications to Azure is a straightforward process, thanks to its integration with Azure services.
  • Intuitive Dashboard: The platform offers an intuitive and visually appealing dashboard, simplifying monitoring and management tasks.
  • Built-in Telemetry: OpenTelemetry integration provides built-in telemetry support, offering insights into application performance and behavior.
  • Orchestration: Orchestration in the language used to write other components of the program.
  • Simple Add: If you need add .NET Aspire in your project its so easy.

Example Dashboard .NET Aspire

Example dashboard .NET Aspire

Current Status

While .NET Aspire shows promise, it is still in its early stages. Some key points to note:

  • Limited toolset available currently
  • Potential as a web service orchestrator, akin to Azure or AWS, but still in a raw state
  • Encounters issues with startup and telemetry, typical of preview software

Additional Notes

During the development process, several observations were made:

  • It may not always start correctly.
  • Telemetry issues are frequent.
  • Future versions are expected to address these issues as it progresses from the preview stage.

Example Configuration

using Projects;

var builder = DistributedApplication.CreateBuilder(args);

var cache = builder.AddRedis("cache");

var postgres = builder.AddPostgres("postgres")
    .WithPgAdmin();

var productsDB = postgres.AddDatabase("ProductsDB");

builder.AddProject<Catalog_Api>("catalog-api")
    .WithReference(cache)
    .WithReference(productsDB);

builder.Build().Run();

This configuration sets up a distributed application using .NET Aspire, where the "catalog-api" project interacts with Redis for caching and Postgres for managing product data. The builder pattern facilitates the creation and configuration of the application components, offering a unified and straightforward approach to application orchestration.

DistributedApplication

DistributedApplication - is main class in Aspire library. if you need impelment Aspire orchestration you need execute DistributedApplication.CreateBuilder() this static methos return IDistributedApplicationBuilder this interface is pattern builder.

var builder = DistributedApplication.CreateBuilder(args);

Next step you add image or project.

builder.AddRedis("cache");

And run this project.

builder.Build().Run();

IDistributedApplicationBuilder Add Methods

  • AddProject() - A .NET project, for example ASP.NET Core web apps.
  • AddContainer() - A container image, such as a Docker image.
  • AddExecutable() - ExecutableResource an executable file.

IDistributedApplicationBuilder Container Methods

  • WithReplicas() - Add one or more replicas current image.
  • WithReference() - Wait start another image . If you current image dependency another image.
  • WithEnvironment() - Add environment in current docker image.

Future Prospects

Despite its current limitations, .NET Aspire holds promise as a Docker-compose alternative for .NET projects. It offers easy integration for additional Docker containers in future releases.


๐ŸŒŸ Enjoyed my project?

  • Please consider starring the repository.
  • You can donate on Patreon.

๐Ÿ“ซ Contact

If you have any questions or suggestions, feel free to reach out to me.

This project is licensed under the Apache 2.0 License.

dotnet.aspire's People

Contributors

a-sharifov avatar

Stargazers

 avatar

Watchers

 avatar

dotnet.aspire's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.