Docs Home → Atlas App Services
Configure an App Environment
On this page
Overview
App Environments are a way to organize your development workflow and effectively reuse code. You can use App Environments to define different multiple versions of global configuration values and then switch between them by changing the App's current environment.
App Services supports a set of built-in environment names that each represent a stage of your development workflow:
""
"development"
"testing"
"qa"
"production"
Environment Values
For each environment, you can define a set of environment values that are available to your application when that environment is active.
For example, you might use different values for an API's baseUrl
configuration depending on whether you're developing a new feature or
deploying to production.
The values for an environment are stored as a single JSON object. You can set the field names and corresponding values to whatever you want.
You can access values from the current environment by field name:
Use context.environment in Functions.
Use
%%environment
in rule expressions.Use Templated Configurations in your App's configuration files.
How to Use Environments
Environment tags each represent a specific stage of your development process. You can define a separate App for each environment, where each App uses the same set of configuration files but has a distinct environment tag. To learn how, see Copy an App.
For example, a typical development process may have three development
stages: development
, testing
, and production
. You could use
a separate App for each stage and use different environment values for
each App.
You can also use unique applications to test individual feature
branches. For example, you might have a core development
App that
developers fork for their feature branches. When a feature branch moves
into testing, you can use the core testing
App instead.
To learn how to incorporate environments into your CI/CD workflow, see Set Up a CI/CD Pipeline. For a full example that manages testing, deployment, and other tasks for a real application, see: How to Build CI/CD Pipelines for App Services Apps using GitHub Actions.
