dapr / dapr/dotnet-sdk

SubscribeConfiguration is not working with Azure App Configuration

Open
#1,196 2 comments 0 reactions 0 assignees View on GitHub
area/client/configuration kind/bug
Dominant language
C#
Stars
1.2k
Forks
378
Avg merge
2d 1h
Merged PRs (30d)
6

Description

## Expected Behavior

Can subscribe configuration changed. After I change configuration value, .NET app will receive changed value.

## Actual Behavior

SubscribeConfiguration throw a exception "sentinel key is not provided in metadata"

## Steps to Reproduce the Problem

Follow quickstarts [.NET configuration sdk sample](https://github.com/dapr/quickstarts/blob/master/configuration/csharp/sdk/order-processor/Program.cs)

This sample just work with Redis as Configuration store

## Version

CLI version: 1.12.0
Runtime version: 1.12.2
SDK version: 1.12.0

## Workaround

But I found a workaround, use below code:

```csharp
if (metadata == null)
metadata = new Dictionary() { ["sentinelKey"] = key };
else
metadata = new Dictionary(metadata) { ["sentinelKey"] = key };
var subscribe = await daprClient.SubscribeConfiguration(ConfigExtensions.APPCONFIG_DEFAULT, new[] { key }, metadata, app.Lifetime.ApplicationStopped);
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.