Skip to content

Allow specifying a custom sidecar resource name via DaprSidecarOptions.SidecarName #1264

@adrien426

Description

@adrien426

Related to an existing integration?

Yes

Existing integration

Dapr

Overview

Currently, the sidecar resource name is always {resourceName}-dapr and the CLI resource name is {resourceName}-cli. These names are derived from the parent resource, not from the Dapr app-id, so in the Aspire dashboard you see names that don't match your actual Dapr configuration (e.g., frontend-dapr-cli instead of something meaningful).

Adding a SidecarName property to DaprSidecarOptions would let developers align the Aspire resource name with their Dapr app-id, or set any custom name. When null or whitespace, the current default {resourceName}-dapr is preserved.

Usage example

// Via DaprSidecarOptions
builder.AddProject<MyService>("my-service")
    .WithDaprSidecar(new DaprSidecarOptions
    {
        SidecarName = "my-custom-sidecar",
        AppId = "my-service"
    });

// Via new callback overload with explicit name
builder.AddProject<MyService>("my-service")
    .WithDaprSidecar("my-custom-sidecar", sidecar =>
    {
        sidecar.WithOptions(new() { AppId = "my-service"; SidecarName = "my-custom-sidecar", });
    });

Breaking change?

Yes

Alternatives

There is currently no clean workaround. The only option is to access the sidecar resource after creation and manipulate it, but the resource name is set at construction time in AddResource() and cannot be changed afterward.

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions