Skip to content

Commit debbc87

Browse files
committed
edits
1 parent 481f9c3 commit debbc87

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

articles/azure-developer-cli/manage-environment-variables.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@ ms.custom: devx-track-azdevcli
1111

1212
# Work with Azure Developer CLI environment variables
1313

14-
The Azure Developer CLI (`azd`) uses environment variables to store and manage configuration settings across multiple deployment environments. These variables control how your application is provisioned, deployed, and run in Azure. This article explains how environment variables work within `azd` environments and provides guidance on managing them effectively.
14+
The Azure Developer CLI (`azd`) uses environment variables to store and manage configuration settings for deployment environments. These variables control how your application is provisioned, deployed, and runs in Azure. This article explains how environment variables work within `azd` environments and provides guidance on managing them effectively.
1515

1616
## Understand environment variables
1717

1818
In the context of the Azure Developer CLI, environment variables are key-value pairs that are tied to specific named environments like *dev*, *test*, or *prod*. Each `azd` environment maintains its own set of environment variables, allowing you to configure different settings for different deployment targets.
1919

20-
Environment variables in `azd` are configuration settings stored in `.env` files within your environment folders in the `.azure` folder. They serve as inputs to:
20+
Environment variables in `azd` are stored in `.env` files within your environment folders in the `.azure` folder. They serve as inputs to:
2121

2222
- Application deployment workflows
2323
- Configurations for Azure services and connections
24-
- Infrastructure provisioning processes
24+
- Infrastructure provisioning via Bicep and Terraform
2525

2626
Unlike traditional environment variables that exist at the operating system level, `azd` environment variables are scoped to specific environments within your project, providing isolation between different deployment targets.
2727

2828
Environment variables provide several key benefits when working with `azd`:
2929

3030
- **Environment isolation**: Keep configurations for development, testing, and production separate and distinct.
31-
- **Configuration consistency**: Ensure all team members use the same settings when working with a specific environment.
32-
- **Infrastructure as Code**: Define your infrastructure parameterization through variables rather than hard-coded values.
31+
- **Configuration consistency**: Ensure all team members use the same settings for a specific environment.
32+
- **Infrastructure as Code**: Define infrastructure parameterization through variables instead of hard-coded values.
3333
- **Deployment automation**: Enable CI/CD pipelines to deploy to different environments using the same codebase but different configurations.
3434
- **Simplified management**: Easily update settings across all services in an environment from a central location.
3535

@@ -55,7 +55,7 @@ KEY2=value2
5555
> [!TIP]
5656
> Visit the [Working with environments](work-with-environments.md) article for more information about `azd` environments.
5757
58-
When you run `azd` commands such as `azd up`, the CLI automatically loads variables from the select environment's `.env` file.
58+
When you run commands such as `azd up`, `azd` automatically loads variables from the select environment's `.env` file.
5959

6060
These variables influence:
6161

@@ -141,7 +141,7 @@ azd env get-values --output json
141141

142142
## Use environment variables in infrastructure files
143143

144-
You can use environment variables to customize your infrastructure templates. This is useful for naming, tagging, or configuring resources based on the current environment.
144+
You can use environment variables to customize your infrastructure templates. This is useful for naming, tagging, or configuring resources based on the current environment. `azd` also uses tags to locate resources in Azure for deployment and other tasks.
145145

146146
Consider the following common flow:
147147

@@ -180,9 +180,9 @@ Consider the following common flow:
180180
param location string
181181
```
182182
183-
`azd` supplies these Bicep parameters with substituted values in `main.parameters.json`.
183+
`azd` supplies these Bicep parameters with the substituted values in `main.parameters.json`.
184184
185-
4. Use the parameters for resource naming and tags so you can easily identify which environment a resource belongs to:
185+
4. Use the parameters for resource naming and tags to later identify which environment a resource belongs to:
186186
187187
```bicep
188188
var resourceToken = toLower(uniqueString(resourceGroup().id, name, location))
@@ -203,6 +203,9 @@ Consider the following common flow:
203203
204204
This pattern keeps your templates flexible, enables per-environment customization without code changes, and improves resource governance (naming, tagging, and discovery).
205205
206+
> [!NOTE]
207+
> `azd` also relies on tagging to locate Azure resources during the deployment stage.
208+
206209
### Hooks
207210
208211
In custom scripts and [hooks](azd-extensibility.md) defined in your `azure.yaml` file, you can access environment variables using the `azd env get-values` command:

0 commit comments

Comments
 (0)