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:
{
"redisPassword": "your redis password",
"sql": "your sql connection string",
"mysql": "your mysql connection string"
}
}
If multiValued
is "false"
, the store will load the file and create a map with the following key value pairs:
flattened key | value |
---|---|
“redisPassword” | “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:
{
"sql": "your sql connection string",
"mysql": "your mysql connection string"
JSON from secretsFile
:
Response:
{
"mysql:username": "your mysql username",
"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.