Replies: 3 comments 3 replies
-
I asked a similar question Aspire Emulator. And was told that an example app was being worked on. I have been racking my brain here as well. I would like to use the emulator for testing, and have added the code in the right spots, but the missing link seems to be the actual connection to the emulator. |
Beta Was this translation helpful? Give feedback.
-
There’s confusion about method names here and what gets called from where. It’s consistent feedback that we’ve heard from customers. In the AppHost project, you are wiring up resource. Aspire.Hosting.Azure has the cosmos db resource. This can be used to model the cosmos dependency for spinning up an emulator or a remote cosmos in azure. In the other projects you’re using the aspire component. As for how it’s different from using the underlying package:
You can get an overview of components here https://github.com/dotnet/aspire/blob/main/src/Components/Aspire_Components_Progress.md the key thing to remember is AppHost - Resources (launch projects, processes containers, cloud resources) |
Beta Was this translation helpful? Give feedback.
-
Here’s an example |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm loving the Aspire framework! It's a lot to learn but I am getting it.
I have a working simple .NET 8 Aspire solution with 4 projects:
I am currently using the Microsoft.Azure.Cosmos 3.38.0 package.
I spent almost a whole day trying to understand the instructions on the following page for Cosmos and Aspire:
https://learn.microsoft.com/en-us/dotnet/aspire/database/azure-cosmos-db-component
I tried every combination I could think of to get the aspire package Aspire.Microsoft.Azure.Cosmos to actually do something different than the normal cosmos package. I was still able to connect to Cosmos with this aspire package, but nothing acted differently than before. I didn't see any difference in traces or logs or anything.
I find the instructions confusing and unclear:
Why do the instructions say to call this method three different times? Wouldn't that make three different CosmosClient objects?
builder.AddAzureCosmosDB("cosmosConnectionName");
var cosmosdb = builder.AddAzureCosmosDB("cdb");
builder.AddAzureCosmosDB("cosmosdb");
Why call
AddAzureCosmosDB
in the AppHost project? That project does not need aCosmosClient
object AFAIK.When successfully setup, how will I know? What is it I am looking for to see success?
Are you able to show a simple example that is known to work where I can see the whole appsettings.json and Program.cs files.
Are you able to show a "before vs after" blurb about how one would know that the aspire comos package is doing it's thing?
Thanks for all your work on Aspire.
Beta Was this translation helpful? Give feedback.
All reactions