Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

DaprMetadataResourceBuilderExtensions IValueProvider overload doesn't add DaprComponentSecretAnnotation

Open Beginner friendly
#2,231 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
66/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

Start with the DaprMetadataResourceBuilderExtensions overload WithMetadata(this IResourceBuilder<IDaprComponentResource> builder, string name, IValueProvider valueProvider) named in the issue, and compare how it handles the secret reference with the lifecycle hook that adds the component’s secret-store reference. No test file or other entry point is mentioned; look for coverage of this overload and the lifecycle behavior. Done when the generated component can read the secret without manually adding auth.secretStore.

Written by the indexing model from the issue text.

Description

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.

Dominant language
C#
Stars
628
Forks
199
Avg merge
17h 22m
Merged PRs (30d)
175

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CommunityToolkit/Aspire

All issues in CommunityToolkit/Aspire

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.