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
Access your Azure resources by logging in. When you initiate a login, a browser window opens and prompts you to login to Azure. After you sign in, the terminal displays a message that you're signed in to Azure.
67
+
66
68
Sign in to AZD using the command palette:
67
69
68
70
# [Visual Studio Code](#tab/visual-studio-code)
@@ -75,11 +77,14 @@ The output of commands issued from the command palette is displayed in an **azd
75
77
76
78
# [Azure Developer CLI](#tab/azure-developer-cli)
77
79
80
+
Sign in to Azure at the CLI using the following command:
78
81
79
82
```bash
80
83
azd auth login
81
84
```
82
85
86
+
:::image type="content" source="media/how-to-create-environment-with-azure-developer/login.png" alt-text="Screenshot showing the azd auth login command and its result in the terminal." lightbox="media/how-to-create-environment-with-azure-developer/login.png":::
87
+
83
88
---
84
89
85
90
### Enable AZD support for ADE
@@ -97,6 +102,8 @@ You can configure AZD to provision and deploy resources to your deployment envir
97
102
azd config set platform.type devcenter
98
103
```
99
104
105
+
106
+
100
107
---
101
108
102
109
## Create an environment from existing code
@@ -125,15 +132,36 @@ AZD uses an *azure.yaml* file to define the environment. The azure.yaml file def
125
132
126
133
1. AZD scans the current directory and gathers more information depending on the type of app you're building. Follow the prompts to configure your AZD environment.
127
134
128
-
1. Finally, enter a name for your environment.
135
+
1. Finally, enter a name for your local AZD environment.
129
136
130
137
AZD creates an *azure.yaml* file in the root of your project.
131
138
132
139
# [Azure Developer CLI](#tab/azure-developer-cli)
133
140
134
-
```bash
135
-
azd init
136
-
```
141
+
1. At the CLI, navigate to the folder that contains your application code.
142
+
143
+
1. Run the following command to initialize your application and supply infomation when prompted:
144
+
145
+
```bash
146
+
azd init
147
+
```
148
+
1. In the AZD terminal, select ***Use code in the current directory***.
149
+
150
+
:::image type="content" source="media/how-to-create-environment-with-azure-developer/init-folder.png" alt-text="Screenshot showing the az init command and the prompt How do you want to initialize your app." lightbox="media/how-to-create-environment-with-azure-developer/init-folder.png":::
151
+
152
+
AZD scans the current directory and gathers more information depending on the type of app you're building. Follow the prompts to configure your AZD environment.
153
+
154
+
1.`azd init` identifies the services defined in your app code and prompts you to confirm and continue, remove a service, or add a service. Select ***Confirm and continue initializing my app***
155
+
156
+
:::image type="content" source="media/how-to-create-environment-with-azure-developer/init-services.png" alt-text="Screenshot showing the AZD init prompt to confirm and continue, remove a service, or add a service." lightbox="media/how-to-create-environment-with-azure-developer/init-services.png":::
157
+
158
+
1.`azd init` continues to gather information to configure your app. For this example application, you're prompted for the name of your MongoDB database instance.
159
+
160
+
:::image type="content" source="media/how-to-create-environment-with-azure-developer/init-database.png" alt-text="Screenshot showing the azd init prompt for a database name." lightbox="media/how-to-create-environment-with-azure-developer/init-database.png":::
161
+
162
+
1. Finally, enter a name for your local AZD environment.
163
+
164
+
AZD creates an *azure.yaml* file in the root of your project.
137
165
---
138
166
139
167
### Provision infrastructure to Azure Deployment Environment
@@ -158,10 +186,29 @@ When you're ready, you can provision your local environment to a remote Azure De
158
186
159
187
# [Azure Developer CLI](#tab/azure-developer-cli)
160
188
189
+
Provision your application to Azure using the following command:
190
+
161
191
```bash
162
192
azd provision
163
193
```
164
194
195
+
1. 'azd init' provides a list of projects that you have access to. Select the project that you want to provision your application to.
196
+
197
+
:::image type="content" source="media/how-to-create-environment-with-azure-developer/select-project.png" alt-text="Screenshot showing the azd init prompt to select a project." lightbox="media/how-to-create-environment-with-azure-developer/select-project.png":::
198
+
199
+
1. 'azd init' provides a list of environment definitions in the selected project. Select the environment definition that you want to use to provision your application.
200
+
201
+
:::image type="content" source="media/how-to-create-environment-with-azure-developer/select-environment-definition.png" alt-text="Screenshot showing the azd init prompt to select an environment definition." lightbox="media/how-to-create-environment-with-azure-developer/select-environment-definition.png":::
202
+
203
+
1. 'azd init' provides a list of environment types in the selected project. Select the environment type that you want to use to provision your application.
204
+
205
+
:::image type="content" source="media/how-to-create-environment-with-azure-developer/select-environment-type.png" alt-text="Screenshot showing the azd init prompt to select an environment type." lightbox="media/how-to-create-environment-with-azure-developer/select-environment-type.png":::
206
+
207
+
1. AZD instructs ADE to create a new environment based on the information you gave in the previous step.
208
+
209
+
:::image type="content" source="media/how-to-create-environment-with-azure-developer/provision-progress.png" alt-text="Screenshot showing the AZD provisioning progess." lightbox="media/how-to-create-environment-with-azure-developer/provision-progress.png":::
210
+
211
+
1. You can view the resources created in the Azure portal or in the [developer portal](https://devportal.microsoft.com).
165
212
---
166
213
167
214
### List existing environments (optional)
@@ -170,17 +217,24 @@ Verify that your environment is created by listing the existing environments.
170
217
171
218
# [Visual Studio Code](#tab/visual-studio-code)
172
219
173
-
In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (azd)** > **View Local and Remote Environments (env list)**.
220
+
1.In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (azd)** > **View Local and Remote Environments (env list)**.
174
221
175
-
:::image type="content" source="media/how-to-create-environment-with-azure-developer/azure-developer-menu-environment-list.png" alt-text="Screenshot of Visual Studio Code with azure.yaml highlighted, and the AZD context menu with Azure Developer CLI and View Local and Remote environments highlighted." lightbox="media/how-to-create-environment-with-azure-developer/azure-developer-menu-environment-list.png":::
222
+
:::image type="content" source="media/how-to-create-environment-with-azure-developer/azure-developer-menu-environment-list.png" alt-text="Screenshot of Visual Studio Code with azure.yaml highlighted, and the AZD context menu with Azure Developer CLI and View Local and Remote environments highlighted." lightbox="media/how-to-create-environment-with-azure-developer/azure-developer-menu-environment-list.png":::
176
223
177
-
You're prompted to select a project and an environment definition.
224
+
`You're prompted to select a project and an environment definition.
178
225
179
226
# [Azure Developer CLI](#tab/azure-developer-cli)
180
227
228
+
Use the following command to view the environments that you have access to: the local AZD environment and the remote Azure Deployment Environments environment.
229
+
181
230
```bash
182
231
azd env list
183
232
```
233
+
234
+
`azd init` prompts you to select a project and an environment definition.
235
+
236
+
:::image type="content" source="media/how-to-create-environment-with-azure-developer/environments-list.png" alt-text="Screenshot showing the local AZD environment and the remote Azure environment." lightbox="media/how-to-create-environment-with-azure-developer/environments-list.png":::
237
+
184
238
---
185
239
186
240
### Deploy code to Azure Deployment Environments
@@ -197,9 +251,29 @@ When your environment is provisioned, you can deploy your code to the environmen
197
251
198
252
# [Azure Developer CLI](#tab/azure-developer-cli)
199
253
254
+
Deploy your application code to the remote Azure Deployment Environments environment you provisioned using the following command:
255
+
200
256
```bash
201
257
azd env deploy
202
258
```
259
+
Deploying your code to the remote environment can take several minutes.
260
+
261
+
You can view the progress of the deployment in the Azure portal:
262
+
263
+
:::image type="content" source="media/how-to-create-environment-with-azure-developer/azure-portal-deploy-in-progress.png" alt-text="Screenshot showing AZD provisioning progress in the Azure portal." lightbox="media/how-to-create-environment-with-azure-developer/azure-portal-deploy-progress.png":::
264
+
265
+
When deployment completes, you can view the resources that were provisioned in the Azure portal:
266
+
267
+
:::image type="content" source="media/how-to-create-environment-with-azure-developer/azure-portal-resources.png" alt-text="Screenshot showing AZD provisioned resources in the Azure portal." lightbox="media/how-to-create-environment-with-azure-developer/azure-portal-resources.png":::
268
+
269
+
You can verify that your code is deployed by selecting the end point URLs listed in the AZD terminal.
0 commit comments