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/deployment-environments/how-to-create-environment-with-azure-developer.md
+60-53Lines changed: 60 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.author: rosemalcolm
7
7
ms.service: deployment-environments
8
8
ms.custom: ignite-2023
9
9
ms.topic: how-to
10
-
ms.date: 11/07/2023
10
+
ms.date: 12/18/2023
11
11
---
12
12
13
13
# Create an environment by using the Azure Developer CLI
@@ -38,56 +38,65 @@ You can see a list of supported Azure services here: [Supported Azure compute se
38
38
39
39
To get help with AZD compatibility, see [Make your project compatible with Azure Developer CLI](/azure/developer/azure-developer-cli/make-azd-compatible?pivots=azd-create).
40
40
41
-
42
41
## Prepare to work with AZD
43
42
44
43
When you work with AZD for the first time, there are some one-time setup tasks you need to complete. These tasks include installing the Azure Developer CLI, signing in to your Azure account, and enabling AZD support for Azure Deployment Environments.
45
44
46
-
#[Azure Developer CLI](#tab/azure-developer-cli)
45
+
### Install the Azure Developer CLI extension for Visual Studio Code
47
46
48
-
### Install the Azure Developer CLI
47
+
When you install azd, the azd tools are installed within azd scope rather than globally, and are removed if azd is uninstalled. You can install azd in Visual Studio Code or from the command line.
To enable Azure Developer CLI features in Visual Studio Code, install the Azure Developer CLI extension, version v0.8.0-alpha.1-beta.3173884. Select the **Extensions** icon in the Activity bar, search for **Azure Developer CLI**, and then select **Install**.
55
52
56
-
```powershell
57
-
azd auth login
58
-
```
53
+
:::image type="content" source="media/how-to-create-environment-with-azure-developer/install-azure-developer-cli-small.png" alt-text="Screenshot of Visual Studio Code, showing the Sign in command in the command palette." lightbox="media/how-to-create-environment-with-azure-developer/install-azure-developer-cli-large.png":::
### Install the Azure Developer CLI extension for Visual Studio Code
70
-
71
-
To enable Azure Developer CLI features in Visual Studio Code, install the Azure Developer CLI extension, version v0.8.0-alpha.1-beta.3173884. Select the **Extensions** icon in the Activity bar, search for **Azure Developer CLI**, and then select **Install**.
72
-
73
-
:::image type="content" source="media/how-to-create-environment-with-azure-developer/install-azure-developer-cli-small.png" alt-text="Screenshot of Visual Studio Code, showing the Sign in command in the command palette." lightbox="media/how-to-create-environment-with-azure-developer/install-azure-developer-cli-large.png":::
62
+
---
74
63
75
64
### Sign in with Azure Developer CLI
76
65
77
66
Sign in to AZD using the command palette:
78
67
68
+
# [Visual Studio Code](#tab/visual-studio-code)
69
+
79
70
:::image type="content" source="media/how-to-create-environment-with-azure-developer/azure-developer-sign-in.png" alt-text="Screenshot of Visual Studio Code, showing the Extensions pane with the Azure Developer CLI and Install highlighted." lightbox="media/how-to-create-environment-with-azure-developer/azure-developer-sign-in.png":::
80
71
81
72
The output of commands issued from the command palette is displayed in an **azd dev** terminal like the following example:
82
73
83
74
:::image type="content" source="media/how-to-create-environment-with-azure-developer/press-any-key.png" alt-text="Screenshot of the azd dev terminal, showing the press any key to close message." lightbox="media/how-to-create-environment-with-azure-developer/press-any-key.png":::
84
75
76
+
# [Azure Developer CLI](#tab/azure-developer-cli)
77
+
78
+
79
+
```bash
80
+
azd auth login
81
+
```
82
+
83
+
---
84
+
85
85
### Enable AZD support for ADE
86
86
87
87
You can configure AZD to provision and deploy resources to your deployment environments using standard commands such as `azd up` or `azd provision`. When `platform.type` is set to `devcenter`, all AZD remote environment state and provisioning uses dev center components. AZD uses one of the infrastructure templates defined in your dev center catalog for resource provisioning. In this configuration, the *infra* folder in your local templates isn’t used.
88
88
89
+
# [Visual Studio Code](#tab/visual-studio-code)
90
+
89
91
:::image type="content" source="media/how-to-create-environment-with-azure-developer/azure-developer-enable-support.png" alt-text="Screenshot of Visual Studio Code, showing the Enable support command in the command palette." lightbox="media/how-to-create-environment-with-azure-developer/azure-developer-enable-support.png":::
90
92
93
+
94
+
# [Azure Developer CLI](#tab/azure-developer-cli)
95
+
96
+
```bash
97
+
azd config set platform.type devcenter
98
+
```
99
+
91
100
---
92
101
93
102
## Create an environment from existing code
@@ -100,12 +109,6 @@ Initializing a new application creates the files and folders that are required f
100
109
101
110
AZD uses an *azure.yaml* file to define the environment. The azure.yaml file defines and describes the apps and types of Azure resources that the application uses. To learn more about azure.yaml, see [Azure Developer CLI's azure.yaml schema](/azure/developer/azure-developer-cli/azd-schema).
102
111
103
-
# [Azure Developer CLI](#tab/azure-developer-cli)
104
-
105
-
```powershell
106
-
azd init
107
-
```
108
-
109
112
# [Visual Studio Code](#tab/visual-studio-code)
110
113
111
114
1. In Visual Studio Code, and then open the folder that contains your application code.
@@ -126,25 +129,24 @@ azd init
126
129
127
130
AZD creates an *azure.yaml* file in the root of your project.
128
131
132
+
# [Azure Developer CLI](#tab/azure-developer-cli)
133
+
134
+
```bash
135
+
azd init
136
+
```
129
137
---
130
138
131
139
### Provision infrastructure to Azure Deployment Environment
132
140
133
141
When you're ready, you can provision your local environment to a remote Azure Deployment Environments environment in Azure. This process provisions the infrastructure and resources defined in the environment definition in your dev center catalog.
134
142
135
-
# [Azure Developer CLI](#tab/azure-developer-cli)
136
-
137
-
```powershell
138
-
azd provision
139
-
```
140
-
141
143
# [Visual Studio Code](#tab/visual-studio-code)
142
144
143
145
1. In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (azd)** > **Provision Azure Resources (provision)**.
144
146
145
147
:::image type="content" source="media/how-to-create-environment-with-azure-developer/azure-developer-menu-environment-provision.png" alt-text="Screenshot of Visual Studio Code with azure.yaml highlighted, and the AZD context menu with Azure Developer CLI and Provision environment highlighted." lightbox="media/how-to-create-environment-with-azure-developer/azure-developer-menu-environment-provision.png":::
146
148
147
-
1. AZD scans Azure Deployment Environments for projects that you have access to. In the AZD terminal, select or enter the following:
149
+
1. AZD scans Azure Deployment Environments for projects that you have access to. In the AZD terminal, select or enter the following information:
148
150
1. Project
149
151
1. Environment definition
150
152
1. Environment name
@@ -154,18 +156,18 @@ azd provision
154
156
155
157
1. You can view the resources created in the Azure portal or in the [developer portal](https://devportal.microsoft.com).
156
158
159
+
# [Azure Developer CLI](#tab/azure-developer-cli)
160
+
161
+
```bash
162
+
azd provision
163
+
```
164
+
157
165
---
158
166
159
167
### List existing environments (optional)
160
168
161
169
Verify that your environment is created by listing the existing environments.
162
170
163
-
# [Azure Developer CLI](#tab/azure-developer-cli)
164
-
165
-
```powershell
166
-
azd env list
167
-
```
168
-
169
171
# [Visual Studio Code](#tab/visual-studio-code)
170
172
171
173
In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (azd)** > **View Local and Remote Environments (env list)**.
@@ -174,38 +176,36 @@ In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (
174
176
175
177
You're prompted to select a project and an environment definition.
176
178
177
-
---
178
-
179
-
### Deploy code to Azure Deployment Environments
180
-
181
179
# [Azure Developer CLI](#tab/azure-developer-cli)
182
180
183
-
```powershell
184
-
azd env deploy
181
+
```bash
182
+
azd env list
185
183
```
184
+
---
186
185
187
-
#[Visual Studio Code](#tab/visual-studio-code)
186
+
### Deploy code to Azure Deployment Environments
188
187
189
188
When your environment is provisioned, you can deploy your code to the environment.
190
189
190
+
# [Visual Studio Code](#tab/visual-studio-code)
191
+
191
192
1. In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (azd)** > **Deploy Azure Resources (deploy)**.
192
193
193
194
:::image type="content" source="media/how-to-create-environment-with-azure-developer/azure-developer-menu-env-deploy.png" alt-text="Screenshot of Visual Studio Code with azure.yaml highlighted, and the AZD context menu with Azure Developer CLI and Deploy to Azure highlighted." lightbox="media/how-to-create-environment-with-azure-developer/azure-developer-menu-env-deploy.png":::
194
195
195
196
1. You can verify that your code is deployed by selecting the end point URLs listed in the AZD terminal.
196
197
198
+
# [Azure Developer CLI](#tab/azure-developer-cli)
199
+
200
+
```bash
201
+
azd env deploy
202
+
```
197
203
---
198
204
199
205
## Clean up resources
200
206
201
207
When you're finished with your environment, you can delete the Azure resources.
202
208
203
-
# [Azure Developer CLI](#tab/azure-developer-cli)
204
-
205
-
```powershell
206
-
azd down
207
-
```
208
-
209
209
# [Visual Studio Code](#tab/visual-studio-code)
210
210
211
211
In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (azd)** > **Delete Deployment and Resources (down)**.
@@ -214,6 +214,13 @@ In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (
214
214
215
215
Confirm that you want to delete the environment by entering `y` when prompted.
216
216
217
+
# [Azure Developer CLI](#tab/azure-developer-cli)
218
+
219
+
```bash
220
+
azd down --environment <environmentName>
221
+
```
222
+
---
223
+
217
224
## Related content
218
225
-[Create and configure a dev center](/azure/deployment-environments/quickstart-create-and-configure-devcenter)
219
226
-[What is the Azure Developer CLI?](/azure/developer/azure-developer-cli/overview)
0 commit comments