Select to view content in your preferred language

Ability to use environment variables when publishing services

319
0
08-15-2023 08:35 AM
Status: Open
RoyJackson_AlertMedia
Occasional Contributor

Modern architecture wants us to use environment variables for configuration. 

Idea - provide the ability to reference environment variables when publishing services with Pro, and the ability to use environment variables on the server with the deployed service. 

In this manner, we could publish the service once, and deploy it to different machines, with the environment of the machine allowing for service connection to that environment's resources (database, target server etc).   Local, test / integration, staging, multi prod could all use the exact same service definition, instead of building a service definition on each environment using scripting. 

From https://12factor.net/config

The twelve-factor app stores config in environment variables (often shortened to env vars or env). Env vars are easy to change between deploys without changing any code; unlike config files, there is little chance of them being checked into the code repo accidentally; and unlike custom config files, or other config mechanisms such as Java System Properties, they are a language- and OS-agnostic standard.