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

Using Cosmos Emulator EXITED on MAC #4720

Closed
OnamChilwan opened this issue Jun 28, 2024 · 0 comments
Closed

Using Cosmos Emulator EXITED on MAC #4720

OnamChilwan opened this issue Jun 28, 2024 · 0 comments
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Comments

@OnamChilwan
Copy link

MACHINE SPEC
Apple M1 Pro

REPRO STEPS:

Create a bog standard ASPIRE project and change Host program.cs to be

var builder = DistributedApplication.CreateBuilder(args);

var cosmos = builder
    .AddAzureCosmosDB("cosmos")
    .AddDatabase("mydatabase")
    .RunAsEmulator();

builder.AddAzureCosmosDB("cosmosConnectionName");

var apiService = builder
    .AddProject<Projects.HelloAspire_ApiService>("apiservice")
    .WithReference(cosmos);

builder.AddProject<Projects.HelloAspire_Web>("webfrontend")
    .WithExternalHttpEndpoints()
    .WithReference(apiService);

builder.Build().Run();

The API Service I attempt to use it like so

var builder = WebApplication.CreateBuilder(args);
builder.AddAzureCosmosClient("cosmos");

However two issues I am facing, one of which is Cosmos is in an exited state

image

The logs I get are:
2024-06-28T16:05:05.0839812 This is an evaluation version. There are [107] days left in the evaluation period.
2024-06-28T16:05:07.9676410 Starting

The other issue is, its expecting a connection string

 CosmosClient could not be configured. Ensure valid connection information was provided in 'ConnectionStrings:cosmosConnectionName' or either ConnectionString or AccountEndpoint must be provided in the 'Aspire:Microsoft:Azure:Cosmos' configuration section.

Do I need to specify this when using the emulator?

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Jun 28, 2024
@OnamChilwan OnamChilwan changed the title Using Cosmos Emulator Faulted on MAC Using Cosmos Emulator EXITED on MAC Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Projects
None yet
Development

No branches or pull requests

1 participant