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?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Blit
  • 55
  • 6

2 Answers2

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

Bret Boss
  • 16
  • 1
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);
Blit
  • 55
  • 6