KeyVault Environment Generator is a tool to create a working environment file based on a template .env.template
and a configuration file .kvenvgenrc
.
It will fetch all the necessary secrets from the given vault. No need to send these sensitive environment files in plaintext over email or chat-applications.
At the moment only Azure Key Vault is supported
Create a file named .env.template
in the root of your project. The content of this file looks like this:
ENV_VAR=key-in-key-vault
You can put as many environment variables in this template. When you run the tool it will fetch all the necessary secrets from the vault in order to generate the entire environment file.
Create a .kvenvgenrc
file in the root of your project. Next, configure the tool by adding the following properties to this file:
Example:
provider: azure
azure-subscription-id: <id>
azure-keyvault-name: <name>
Property | Explanation |
---|---|
provider | The platform where your vault is hosted, possible values: azure
|
azure-subscription-id | The id of the Azure subscription. |
azure-keyvault-name | The name of the vault. |
Once this package is installed you can run it via npx: npx kvenvgen
.