Skip to content
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

Add sample to use Aspire with CosmosDB #74

Open
Kralizek opened this issue Dec 27, 2023 · 11 comments
Open

Add sample to use Aspire with CosmosDB #74

Kralizek opened this issue Dec 27, 2023 · 11 comments

Comments

@Kralizek
Copy link

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: dotnet/aspire#1502

@DamianEdwards
Copy link
Member

Thanks for the suggestion. @bradygaster mind taking this one? Or perhaps @Pilchie?

@Pilchie
Copy link
Member

Pilchie commented Jan 9, 2024

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 dotnet/aspire#359, it did have some apps in the main app. For example: dotnet/aspire@4f01310

@bradygaster
Copy link
Member

I can do this. I'll have it by end of next week, apologies for the delay.

@Pilchie
Copy link
Member

Pilchie commented Feb 9, 2024

You're the best @bradygaster !

@chrisrlewis
Copy link

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.

@DamianEdwards
Copy link
Member

@bradygaster you still planning on doing this one?

@bradygaster
Copy link
Member

I can do it if we didn't get one done. I started adding it to an app but got side-tracked.

@bradygaster
Copy link
Member

bradygaster commented Jun 11, 2024

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/

@Pilchie
Copy link
Member

Pilchie commented Jun 11, 2024

LGTM. Thanks @bradygaster.

@markjbrown
Copy link

Love it. Thanks @bradygaster !!!

@Kralizek
Copy link
Author

Kralizek commented Jul 12, 2024

would it be possible to expand the example with the use of the local emulator and entity framework?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants