You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-developer-cli/environments-overview.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Azure Developer CLI environments overview
3
-
description: Learn essential concenpts about environments using Azure Developer CLI (azd).
3
+
description: Learn essential concepts about environments using Azure Developer CLI (azd).
4
4
author: alexwolfmsft
5
5
ms.author: alexwolf
6
6
ms.date: 08/04/2025
@@ -45,7 +45,7 @@ The key components of this structure are:
45
45
1.**`.azure` directory**: The root directory for all environment configurations. Excluded from source control by the `.gitignore` file by default.
46
46
2.**Environment-specific directories**: Directories named after your environments, such as `dev`, `test`, `prod`.
47
47
3.**`.env` file**: Contains environment-specific variables used by your application and during deployment.
48
-
4.**`config.json`**: Used to drive settings that influence `azd` command behavior and features. This file is not intended to be used directly by end users.
48
+
4.**`config.json`**: Used to drive settings that influence `azd` command behavior and features. This file isn't intended to be used directly by end users.
49
49
50
50
### Environment names
51
51
@@ -54,7 +54,7 @@ Environment naming typically follows these patterns:
54
54
- Team projects: `<project-name-[dev/int/prod]>`
55
55
- Personal projects: `<personal-unique-alias-[dev/int/prod]>`
56
56
57
-
These naming conventions are not enforced by `azd` and are configurable by the user.
57
+
These naming conventions aren't enforced by `azd` and are configurable by the user.
58
58
59
59
## Environment variables
60
60
@@ -88,7 +88,7 @@ Common environment variables include:
88
88
89
89
When working with environment variables:
90
90
91
-
- Avoid committing `.env` files to source control. If environment configuration needs to be persisted or shared, users should leverage[Remote environments](remote-environments-support.md).
91
+
- Avoid committing `.env` files to source control. If environment configuration needs to be persisted or shared, users should use[Remote environments](remote-environments-support.md).
92
92
- Use consistent naming across environments.
93
93
- Use the `azd env set` command to update variables safely.
The Azure Developer CLI (`azd`) helps you create and manage [Environments](environments-overview.md) with their own configurations, such as dev, test, and prod. This article shows how to create and manage environments, and how to leverage them with your Bicep infrastructure files.
14
+
The Azure Developer CLI (`azd`) helps you create and manage [Environments](environments-overview.md) with their own configurations, such as dev, test, and prod. This article shows how to create and manage environments, and how to use them with your Bicep infrastructure files.
15
15
16
16
## Create environments
17
17
@@ -27,7 +27,7 @@ For example, to create a development environment:
27
27
azd env new dev
28
28
```
29
29
30
-
When you run a command such as `azd up` or `azd deploy`, you'll be prompted to select an Azure subscription and location for the new environment. Prompt settings are stored in the new environment `.env` or `config.json` files.
30
+
When you run a command such as `azd up` or `azd deploy`, `azd` prompts you to select an Azure subscription and location for the new environment. Prompt settings are stored in the new environment `.env` or `config.json` files.
31
31
32
32
You can also specify subscription and location directly in the command:
33
33
@@ -71,13 +71,13 @@ azd env select prod
71
71
72
72
## Understand the default environment
73
73
74
-
The global configuration file `.azure/config.json` keeps track of your currently selected environment. When you run `azd init` and no environments exist yet, `azd` automatically creates your first environment and sets it as the default. If you already have one or more environments and run `azd env new <name>`, you'll be prompted to choose whether to make the new environment the default. If you decline, the new environment is created but your current selection remains unchanged.
74
+
The global configuration file `.azure/config.json` keeps track of your currently selected environment. When you run `azd init` and no environments exist yet, `azd` automatically creates your first environment and sets it as the default. If you already have one or more environments and run `azd env new <name>`, `azd` prompts you to choose whether to make the new environment the default. If you decline, the new environment is created but your current selection remains unchanged.
75
75
76
-
You can temporarily override the default environment for a single command by using the `--environment` flag. This does not change the default for future commands.
76
+
You can temporarily override the default environment for a single command by using the `--environment` flag. Using this flag doesn't change the default for future commands.
77
77
78
78
## Refresh environment settings
79
79
80
-
You can refresh your local environment variables using the `azd env refresh` command. This command locates the most recent Azure deployment for your app, retrieves the environment variable values by name, and then updates your local `.env` file with those latest values for the select environment. For example, if you provisioned both a `dev` and `prod` version, and you currently have the `dev` environment selected, it will retrieve lates outputs from that deployment to populate the .env file.
80
+
You can refresh your local environment variables using the `azd env refresh` command. This command locates the most recent Azure deployment for your app, retrieves the environment variable values by name, and then updates your local `.env` file with those latest values for the select environment. For example, if you provisioned both a `dev` and `prod` version, and you currently have the `dev` environment selected, it retrieves the latest output from that deployment to populate the .env file.
81
81
82
82
```azdeveloper
83
83
azd env refresh
@@ -111,7 +111,7 @@ azd up
111
111
```
112
112
113
113
> [!NOTE]
114
-
> It's recommended that teams rely on CICD pipelines using the `azd pipeline config` command, rather than direct deployments using commands such as `azd up` or `azd provision`.
114
+
> Teams should consider using CICD pipelines via the `azd pipeline config` command, rather than direct deployments using commands such as `azd up` or `azd provision`.
115
115
116
116
## Delete environment resources
117
117
@@ -122,7 +122,7 @@ azd down <environment-name>
122
122
```
123
123
124
124
> [!NOTE]
125
-
> It is currently not possible to delete or rename `azd` environments directly using commands. If you need to rename an environment:
125
+
> It's currently not possible to delete or rename `azd` environments directly using commands. If you need to rename an environment:
126
126
>
127
127
> - Use `azd down` to delete the environment resources.
128
128
> - Run `azd env new <new-name>` to create the new environment.
@@ -135,13 +135,13 @@ You can use the `AZURE_ENV_NAME` variable from your environment's `.env` file to
135
135
> [!NOTE]
136
136
> Visit the [Work with environment variables](manage-environment-variables.md) to learn more about how to use environment variables to configure your Azure Developer CLI projects.
137
137
138
-
1.The `AZURE_ENV_NAME` environment variable is set by `azd` when you initialize a project.
138
+
1.`azd` sets the `AZURE_ENV_NAME` environment variable when you initialize a project.
139
139
140
140
```output
141
141
AZURE_ENV_NAME=dev
142
142
```
143
143
144
-
1. In your `main.parameters.json` file, reference the environment variable so `azd` will substitute its value:
144
+
1. In your `main.parameters.json` file, reference the environment variable so `azd` substitutes its value:
145
145
146
146
```json
147
147
{
@@ -155,7 +155,7 @@ You can use the `AZURE_ENV_NAME` variable from your environment's `.env` file to
155
155
}
156
156
```
157
157
158
-
When you deploy with `azd`, the value from `.env` will be passed to your Bicep file from `main.parameters.json`.
158
+
When you deploy with `azd`, the value from `.env` is passed to your Bicep file from `main.parameters.json`.
159
159
160
160
1. In your Bicep template, define a parameter for the environment name:
0 commit comments