aspire-samples
aspire-samples copied to clipboard
Add sample to use Aspire with CosmosDB
I would appreciate if there was a sample showing how to use CosmosDB in Aspire since this simple setup isn't working and I have no clue on what's missing.
var builder = DistributedApplication.CreateBuilder(args);
var db = builder.AddAzureCosmosDB("db");
var api = builder.AddProject<Projects.API>("api")
.WithReference(db);
builder.Build().Run();
See: https://github.com/dotnet/aspire/issues/1502
Thanks for the suggestion. @bradygaster mind taking this one? Or perhaps @Pilchie?
I want to do this, but need to be honest that it likely won't be this month. In the meantime, if you check out some of the earlier commits of https://github.com/dotnet/aspire/pull/359, it did have some apps in the main app. For example: https://github.com/dotnet/aspire/pull/359/commits/4f01310c85336c8595a7314e4f0e1ef255148796
I can do this. I'll have it by end of next week, apologies for the delay.
You're the best @bradygaster !
I can do this. I'll have it by end of next week, apologies for the delay.
@bradygaster I'm also looking forward to this, as currently struggling with starting with Cosmos db + Aspire. If the example could include the various ways to connect and also include the required config file settings that would be perfect.
@bradygaster you still planning on doing this one?
I can do it if we didn't get one done. I started adding it to an app but got side-tracked.
Update to @DamianEdwards and @Pilchie and @markjbrown that I've created the sample with some help from the nice folks in Cosmos DB.
Let me know (in the form of a pull request or issue) if there's anything else y'all think this needs, or any tweaks, and I'll facilitate.
Also to @chrisrlewis - not sure if this satisfies your desire for "all the ways to connect," but I wanted to share this with you to see if this helps at all.
https://github.com/bradygaster/CosmosWithAspire
App is running here for those who'd like to try it out. Please be nice. :)
https://webfrontend.wonderfulsky-9bb53c18.westus.azurecontainerapps.io/
LGTM. Thanks @bradygaster.
Love it. Thanks @bradygaster !!!
would it be possible to expand the example with the use of the local emulator and entity framework?