azure-env-app-configuration is a utility library to the Azure Application Configuration service, and the @azure/app-configuration package, that allows you to easy import configurations into your node environment variables (process.env
).
Option | Description |
---|---|
appConfigConnectionString * |
Connection string to App Config |
appConfigOptions |
Options for App Config |
endpoint * |
Endpoint for App Config |
tokenCredential * |
Credentials to use with endpoint |
includeKeyVaultSecrets |
Also read connected Key Vault secrets |
ignore |
An array of configuration names to ignore |
ignoreIfDefined |
An array of configuration names to ignore, if already set |
*) Either use appConfigConnectionString
or endpoint
/tokenCredential
Simple configuration that imports all available configurations into process.env
:
import { envAppConfiguration } from "azure-env-app-configuration";
await envAppConfiguration({
appConfigConnectionString: "..." // Azure Application Configuration connection string
});
Just import configurations with the label env
:
import { envAppConfiguration } from "azure-env-app-configuration";
await envAppConfiguration({
appConfigConnectionString: "...",
labelFilter: "env"
});
Used together with packages such as dotenv
, where in this case the Azure Application Configuration settings will overwrite any definitions in the local .env
file:
import { envAppConfiguration } from "azure-env-app-configuration";
require("dotenv").config();
await envAppConfiguration({
appConfigConnectionString: "...",
labelFilter: "env"
});
Install it to your solution by using:
npm install azure-env-app-configuration --save
azure-env-app-configuration is created and maintained by Wictor Wilen
MIT