Skip to content

DaprMetadataResourceBuilderExtensions IValueProvider overload doesn't add DaprComponentSecretAnnotation #2231

Open

Description

@Steve887

The DaprMetadataResourceBuilderExtensions overload WithMetadata(this IResourceBuilder<IDaprComponentResource> builder, string name, IValueProvider valueProvider) adds the value as a DaprSecretKeyRef and thus later in the lifecycle creates a secret store. However, it does not add a DaprComponentSecretAnnotation annotation, which allows the lifecycle hook to add an auth.secretstore reference to the component yaml later in the process.

This means the component cannot read the secret and thus the reference doesn't load.

My specific use case is:

var serviceBusResource = builder.AddAzureServiceBus("ServiceBus").RunAsEmulator();
builder.AddDaprComponent("servicebus-pubsub-queue", "pubsub.azure.servicebus.queues")
    .WithMetadata("connectionString", serviceBusResource );

This does sucessfully create the component and YAML, however during startup the following error occurs:

initialization error occurred for servicebus-pubsub-queue (pubsub.azure.servicebus.queues/v1): either one of connection string or namespace name are required

Indicating the connection string reference cannot be read. Manually adding
auth:
secretStore: secretstore

and restarting does allow the reference to be read.

There does not seem to be a good way to work around this, as all of the annotations and schema references are internal so I am unable to manually add them.

Activity

  1. github-actions commented on Oct 29, 2026

    @github-actions
    Contributor

    We have noticed this issue has not been updated within 21 days. If there is no action on this issue in the next 14 days, we will automatically close it. You can use /stale-extend to extend the window.

  2. Steve887 commented on Oct 29, 2026

    @Steve887
    Author

    /stale-extend

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

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