azd app env

Print the effective environment a service receives when it runs.

Usage

Terminal window
azd app env [service] [flags]

Flags

FlagShortTypeDefaultDescription
--all-boolfalsePrint the resolved environment for every service
--format-stringdotenvOutput format: `dotenv`, `shell`, `powershell`, or `json`
--keys-boolfalsePrint variable names only
--prefix-stringArray-Only include variables whose names start with the given prefix (repeatable)
--no-mask-boolfalsePrint raw values instead of masking secret-shaped values
--explain-boolfalseShow the source of each effective value and any sources it overrode
--diff-boolfalseCompare the resolved environment of two services (pass two service names)
--env-file-string-Path to a `.env` file to merge, matching `azd app run`
--write-boolfalseWrite the resolved environment to a `.env` file instead of printing it
--out-string-Destination folder for `--write` files (writes `<service>.env`); defaults to each service directory

Examples

Terminal window
azd app env [service] [flags]
Terminal window
azd app env api
Terminal window
azd app env api --format shell
Terminal window
azd app env api --format powershell | iex
Terminal window
azd app env api --format json
Terminal window
azd app env api --no-mask
Terminal window
azd app env api --explain
Terminal window
azd app env --diff api web
Terminal window
azd app env api --keys
Terminal window
azd app env api --write

Detailed Documentation

For complete documentation including flows, diagrams, and advanced usage, see the full command specification.

View full env specification →