How handle local vs production environment with .NET Aspire

I am trying to learn Aspire, but I have problems in understanding what are it’s advantages for production and how to use it outside local environment. To give a summary of my current understanding:

General: Basically Aspire is just 2 new projects (AppHost and ServiceDefaults) that binds other projects, providing different features (Service Discovery, Telemetry, Components).

For Local I see it like a docker compose on steroids. In AppHost you just configure the relations between services and external components (e.g. Redis), then you can do calls from one service to another one using a natural name, without carrying about ports. To start the application, you will start AppHost project, that will do all the work providing a nice dashboard with different functionalities. Played a little bit with it and I love it.

For Production/Testing/Staging environments: Asumming that I want to use Kubernetes with Dockerize apps. If I correctly understand, AppHost and ServiceDefaults projects will not be deployed. Then except the components part of the Aspire, I don’t really see the advantages, cause the orchestration will be made by Kubernetes.

QUESTION PART:

If what I described above is true, I have problems understanding how will the apps correctly run without being orchestrated by AppHost? There are 2 situations:

Calling another service:

builder.Services.AddHttpClient<WeatherApiClient>(client =>
    {
        client.BaseAddress = new("https+http://weatherservice");
    });

This will break when not on local, because https+http://weatherservice is not a valid URL if not orchestrated by Aspire.

Using components:

builder.AddRedisOutputCache("cache");

When I will inject the IDistributedCache outside Aspire context, I will get an error, cause I don’t provide any connection string.

Current solution:
The option that I found (but I don’t know if is the best or if even I should have those issues) is to have an appsettings.Aspire.json that will contains only the names of the services and will be used when running locally from AppHost. In order to use it I set the environment something like this:

var apiService = builder.AddProject<Projects.AspireTest_ApiService>("apiservice")
    .WithReference(airQualityService)
    .WithReference(cache)
    .WithEnvironment("ASPNETCORE_ENVIRONMENT", "Aspire");

Now if I want to run the projects independently or to run it in Kubernetes, I will just provide a separate appsetting file that will be used. Something like:

{
  "AirQualityUrl": http://somevalidUrl",
  "Aspire": {
    "StackExchange": {
      "Redis": {
        "ConnectionString": "127.0.0.1:6379"
      }
    }
  }
}

So the api part is covered by the fact that when initializing the HttpClient, I will pick the values from appsetings (so for Aspire will be https+http://airqualityapi and for other envs will be http://somevalidUrl

For the component part it looks like if I overwrite Aspire:StackExchange:Redis:ConnectionString key, it will take the settings from there.

I am sorry for the long question. Is my understanding of Aspire and the solution that I found for deployment ok?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật