Local file (for Development)

This Dapr secret store component reads plain text JSON from a given file and does not use authentication.

Warning

This approach to secret management is not recommended for production environments.

To setup local file based secret store create a component of type . Create a file with the following content in your ./components directory:

  1. {
  2. "redisPassword": "your redis password",
  3. "sql": "your sql connection string",
  4. "mysql": "your mysql connection string"
  5. }
  6. }

If multiValued is "false", the store will load the file and create a map with the following key value pairs:

flattened keyvalue
“redis”“your redis password”
“connectionStrings:sql”“your sql connection string”
“connectionStrings:mysql”“your mysql connection string”

Use the flattened key (connectionStrings:sql) to access the secret. The following JSON map returned:

If multiValued is "true", you would instead use the top level key. In this example, would return the following map:

  1. {
  2. "sql": "your sql connection string",
  3. "mysql": "your mysql connection string"

JSON from secretsFile:

Response:

  1. {
  2. "mysql:username": "your mysql username",
  3. "mysql:password": "your mysql password"

This is useful in order to mimic secret stores like Vault or Kubernetes that return multiple key/value pairs per secret key.