Skip to content

Commit 93b1c92

Browse files
authored
Merge pull request #118 from itowlson/dotenv
Document .env file for Spin variables
2 parents e1c1503 + d9e982e commit 93b1c92

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

content/v3/dynamic-configuration.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,17 @@ $ export SPIN_VARIABLE_API_KEY="1234" # Sets the `api_key` value.
6161
$ spin up
6262
```
6363

64+
If the current directory contains a file named `.env`, then the provider will look there for environment variables not present in the actual environment. Entries in `.env` must follow the same `SPIN_VARIABLE_...` naming convention as 'real' environment variables, and have the same `key=value` format as setting a variable on the command line. For example:
65+
66+
```
67+
# The .env file can contain comments
68+
SPIN_VARIABLE_API_KEY="1234"
69+
```
70+
71+
> The `.env` file must be in the _current_ directory (not necessarily the directory containing the application manifest).
72+
73+
Entries in the `.env` file are _lower_ priority than actual environment variables.
74+
6475
### Vault Application Variable Provider
6576

6677
The Vault application variable provider gets secret values from [HashiCorp Vault](https://www.vaultproject.io/).

0 commit comments

Comments
 (0)