Skip to content

How can I add project without endpoints with Dapr sidecar? #3687

@dusan-tkac-bhp

Description

@dusan-tkac-bhp

Hello!

This used to work in preview 4 but stopped in preview 5.

I have a project which does not have any endpoints.
It uses SDK to monitor storage queue (no Dapr bindings), it doesn't use any Dapr components, it just uses Dapr ActorProxy to invoke methods on actor instances.
Actors are hosted by a different project.

I can run this project with Dapr sidecar from command line from within project's directory like this (no app port):
dapr run --app-id cloud-runs-controller -- dotnet run

In preview 5, when I add the project to Aspire host, its Dapr sidecar fails to start with error

Failed to create resource package-event-processor-dapr-cli
System.InvalidOperationException: The endpoint `http` is not allocated for the resource `package-event-processor`.
   at Aspire.Hosting.ApplicationModel.EndpointReference.get_AllocatedEndpoint() in /_/src/Aspire.Hosting/ApplicationModel/EndpointReference.cs:line 96
   at Aspire.Hosting.ApplicationModel.EndpointReference.get_Host() in /_/src/Aspire.Hosting/ApplicationModel/EndpointReference.cs:line 78
   at Aspire.Hosting.Dapr.DaprDistributedApplicationLifecycleHook.<>c__DisplayClass6_1.<BeforeStartAsync>b__9(IList`1 updatedArgs) in /_/src/Aspire.Hosting.Dapr/DaprDistributedApplicationLifecycleHook.cs:line 194
   at Aspire.Hosting.ApplicationModel.CommandLineArgsCallbackAnnotation.<>c__DisplayClass1_0.<.ctor>b__0(CommandLineArgsCallbackContext c) in /_/src/Aspire.Hosting/ApplicationModel/CommandLineArgsCallbackAnnotation.cs:line 32
   at Aspire.Hosting.Dcp.ApplicationExecutor.CreateExecutableAsync(AppResource er, ILogger resourceLogger, CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/ApplicationExecutor.cs:line 1194
   at Aspire.Hosting.Dcp.ApplicationExecutor.<CreateExecutablesAsync>g__CreateExecutableAsyncCore|53_0(AppResource cr, CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/ApplicationExecutor.cs:line 1134

Code that adds the project to Apire host:

builder.AddProject<Projects.PackageEventProcessor>("package-event-processor")
    .WithDaprSidecar(new DaprSidecarOptions
    {
        AppId = "cloud-runs-controller",
        ResourcesPaths = ImmutableHashSet.Create(@"..\resources"), // technically not needed

        // following is ok for local development with minimal logging
        EnableApiLogging = false,
        EnableAppHealthCheck = false,
        EnableProfiling = false,
        LogLevel = "warn",
        AppHealthProbeInterval = 60,
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-integrationsIssues pertaining to Aspire Integrations packagesdapr

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions