Skip to content

Commit 1a189ba

Browse files
author
RoseHJM
committed
Added graphics for CLI steps.
1 parent faad408 commit 1a189ba

14 files changed

+83
-7
lines changed

articles/deployment-environments/how-to-create-environment-with-azure-developer.md

Lines changed: 83 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ powershell -ex AllSigned -c "Invoke-RestMethod 'https://aka.ms/install-azd.ps1'
6363

6464
### Sign in with Azure Developer CLI
6565

66+
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+
6668
Sign in to AZD using the command palette:
6769

6870
# [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
7577

7678
# [Azure Developer CLI](#tab/azure-developer-cli)
7779

80+
Sign in to Azure at the CLI using the following command:
7881

7982
```bash
8083
azd auth login
8184
```
8285

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+
8388
---
8489

8590
### Enable AZD support for ADE
@@ -97,6 +102,8 @@ You can configure AZD to provision and deploy resources to your deployment envir
97102
azd config set platform.type devcenter
98103
```
99104

105+
106+
100107
---
101108

102109
## 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
125132

126133
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.
127134

128-
1. Finally, enter a name for your environment.
135+
1. Finally, enter a name for your local AZD environment.
129136

130137
AZD creates an *azure.yaml* file in the root of your project.
131138

132139
# [Azure Developer CLI](#tab/azure-developer-cli)
133140

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.
137165
---
138166

139167
### 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
158186

159187
# [Azure Developer CLI](#tab/azure-developer-cli)
160188

189+
Provision your application to Azure using the following command:
190+
161191
```bash
162192
azd provision
163193
```
164194

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).
165212
---
166213

167214
### List existing environments (optional)
@@ -170,17 +217,24 @@ Verify that your environment is created by listing the existing environments.
170217

171218
# [Visual Studio Code](#tab/visual-studio-code)
172219

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)**.
174221

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":::
176223

177-
You're prompted to select a project and an environment definition.
224+
`You're prompted to select a project and an environment definition.
178225

179226
# [Azure Developer CLI](#tab/azure-developer-cli)
180227

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+
181230
```bash
182231
azd env list
183232
```
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+
184238
---
185239

186240
### Deploy code to Azure Deployment Environments
@@ -197,9 +251,29 @@ When your environment is provisioned, you can deploy your code to the environmen
197251

198252
# [Azure Developer CLI](#tab/azure-developer-cli)
199253

254+
Deploy your application code to the remote Azure Deployment Environments environment you provisioned using the following command:
255+
200256
```bash
201257
azd env deploy
202258
```
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.
270+
271+
:::image type="content" source="media/how-to-create-environment-with-azure-developer/deploy-endpoint.png" alt-text="Screenshot showing the endpoint AZD deploy creates." lightbox="media/how-to-create-environment-with-azure-developer/deploy-endpoint.png":::
272+
273+
For this sample application, you'll see something like this:
274+
275+
:::image type="content" source="media/how-to-create-environment-with-azure-developer/test-swagger.png" alt-text="Screenshot showing application in swagger interface." lightbox="media/how-to-create-environment-with-azure-developer/test-swagger.png":::
276+
203277
---
204278

205279
## Clean up resources
@@ -216,6 +290,8 @@ Confirm that you want to delete the environment by entering `y` when prompted.
216290

217291
# [Azure Developer CLI](#tab/azure-developer-cli)
218292

293+
Delete the Azure resources by using the following command:
294+
219295
```bash
220296
azd down --environment <environmentName>
221297
```
Loading
88.8 KB
Loading
31.2 KB
Loading
3.8 KB
Loading
6.8 KB
Loading
10.7 KB
Loading
29.7 KB
Loading
1.94 KB
Loading
55.9 KB
Loading

0 commit comments

Comments
 (0)