1

I have a question concerning the dapr config store component.

I'm trying to use the config store component in an Azure container app. I have it configured in a bicep file like so:

resource daprConfigComponent 'Microsoft.App/managedEnvironments/daprComponents@2022-11-01-preview' = {
  name: 'configstore' 
  parent: environment
  properties: {
    componentType: 'configuration.azure.appconfig'
    version: 'v1'
    metadata: [
      {
        name: 'connectionString'
        value: '<connection-string-here>'
      }
    ]
    scopes: [
      'nativevoice'
    ]
  }
}

It seems to be working fine and daprd gives no errors, however when I run my container app it gives the following error:

Grpc.Core.RpcException: Status(StatusCode="InvalidArgument", Detail="failed to subscribe [orderId1 orderId2] from Configuration store configstore: azure appconfig error: sentinel key is not provided in metadata")

It seems that dapr doesn't work with Azure app configuration despite the fact I followed this documentation: https://docs.dapr.io/reference/components-reference/supported-configuration-stores/azure-appconfig-configuration-store/.

Anyone have any idea on how to fix this?

2 Answers 2

0

If you are using AddStreamingDaprConfigurationStore then you'll need to add metadata with a key of "sentinelKey" and a value of whatever configuration key you want to trigger a reload of configuration values.

Example:

var configMeta = new Dictionary<string, string>() { ["sentinelKey"] = reloadConfigKey };
manager.AddStreamingDaprConfigurationStore(configStore, configKeys, daprClient, timeout, configMeta);

Source: https://github.com/dapr/components-contrib/blob/master/configuration/azure/appconfig/appconfig.go#L248

Sign up to request clarification or add additional context in comments.

Comments

0

@Brett Boss answer resolved the issue, I had to add sentinelKey to the metadata. I use the .NET Dapr SDK so for me it looked like this:

Dapr.Client.SubscribeConfigurationResponse subscribe = await _daprClient.SubscribeConfiguration(
            DAPR_CONFIGURATION_STORE, 
            CONFIGURATION_KEYS, 
            new Dictionary<string, string>
            {
                { "sentinelKey", "reloadConfigKey"}
            }, stoppingToken);

1 Comment

Good answer. To improve the answer, a link to the .NET Dapr SDK would have been great.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.