-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Community Article: .NET Aspire #18146
Comments
Aspire looks very nice and hopefully integrated with ABP. |
@helloxubo, I wouldn't integrate it in abp, because it's opinionated stack. Community article or even better - deployment documentation option inside docs.abp.io is a better approach. |
I agree with you. |
@berkansasmaz (or @EngincanV), what would this community article cover? I am also looking at ABP Studio and want to figure what Studio offers more compared to Aspire regarding running abp-based solution in kubernetes. Thank you for explanations. |
Yes, I want to explain how to run a layered MVC (and/or Blazor) solution, but at this stage, we should not expect 100% compatibility with some of Aspire's Components. I haven't fully investigated Aspire's Aspir8 (aspire for K8s) project, so I can't say anything comparatively. However, if you want to learn about the features ABP Studio provides for Kubernetes, you can look here. |
@kfrancis, as I understand, only running dbmigrator project is the only thing that is not resolved (and all other projects are running in Aspire)? |
It seems to be running the sites as expected, the only tricky bit seems to be the SQL. They all seem to be communicating with the same SQL instance now that I modified the factory: var builder = new DbContextOptionsBuilder<BookStoreDbContext>()
.UseSqlServer("sqldata"); and here's my host config: var builder = DistributedApplication.CreateBuilder(args);
var cache = builder.AddRedis("RedisConnection");
var sql = builder.AddSqlServer("sql");
var sqldb = sql.AddDatabase("sqldb");
builder.AddProject<Projects.Acme_BookStore_AuthServer>("acme-bookstore-authserver")
.WithHttpsEndpoint(port: 44387)
.WithReference(cache)
.WithReference(sqldb);
builder.AddProject<Projects.Acme_BookStore_HttpApi_Host>("acme-bookstore-httpapi-host")
.WithHttpsEndpoint(port: 44358)
.WithReference(cache)
.WithReference(sqldb);
builder.AddProject<Projects.Acme_BookStore_Web>("acme-bookstore-web")
.WithHttpsEndpoint(port: 44336)
.WithReference(cache)
.WithReference(sqldb);
//builder.AddProject<Projects.Acme_BookStore_DbMigrator>("acme-bookstore-dbmigrator")
// .WithReference(sqldb);
builder.Build().Run(); So, while I can have it run the migrator - when I do it seems to be trying to migrate more than once? |
Just adding builder.Host
.AddAppSettingsSecretsJson()
.UseAutofac()
.UseSerilog();
// To this
builder.Host
.AddAppSettingsSecretsJson()
.UseAutofac()
.UseSerilog((ctx, lc) => lc
.Enrich.FromLogContext()
.WriteTo.OpenTelemetry(options =>
{
options.Endpoint = builder.Configuration["OTEL_EXPORTER_OTLP_ENDPOINT"];
var headers = builder.Configuration["OTEL_EXPORTER_OTLP_HEADERS"]?.Split(',') ?? [];
foreach (var header in headers)
{
var (key, value) = header.Split('=') switch
{
[string k, string v] => (k, v),
var v => throw new Exception($"Invalid header format {v}")
};
options.Headers.Add(key, value);
}
options.ResourceAttributes.Add("service.name", ctx.HostingEnvironment.ApplicationName.ToLower().Replace(".","-"));
//To remove the duplicate issue, we can use the below code to get the key and value from the configuration
var (otelResourceAttribute, otelResourceAttributeValue) = builder.Configuration["OTEL_RESOURCE_ATTRIBUTES"]?.Split('=') switch
{
[string k, string v] => (k, v),
_ => throw new Exception($"Invalid header format {builder.Configuration["OTEL_RESOURCE_ATTRIBUTES"]}")
};
options.ResourceAttributes.Add(otelResourceAttribute, otelResourceAttributeValue);
})
.ReadFrom.Configuration(ctx.Configuration)); Just reading through serilog/serilog-aspnetcore#359 |
The first preview of .NET Aspire is available with the .NET 8 release and it seems very promising.
Here is its repository: https://github.com/dotnet/aspire
/ docs: https://learn.microsoft.com/en-us/dotnet/aspire/
/ and samples: https://github.com/dotnet/aspire-samples
Check the .NET Aspire, deep dive it, and create a community article for it.
The text was updated successfully, but these errors were encountered: