skip to Main Content

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


  1. Chosen as BEST ANSWER

    @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);
    

  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search