Skip to content

Commit 44e76ec

Browse files
author
RoseHJM
committed
Adding more content.
1 parent 924bf2d commit 44e76ec

File tree

1 file changed

+60
-53
lines changed

1 file changed

+60
-53
lines changed

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

Lines changed: 60 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.author: rosemalcolm
77
ms.service: deployment-environments
88
ms.custom: ignite-2023
99
ms.topic: how-to
10-
ms.date: 11/07/2023
10+
ms.date: 12/18/2023
1111
---
1212

1313
# 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
3838

3939
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).
4040

41-
4241
## Prepare to work with AZD
4342

4443
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.
4544

46-
# [Azure Developer CLI](#tab/azure-developer-cli)
45+
### Install the Azure Developer CLI extension for Visual Studio Code
4746

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.
4948

50-
```powershell
51-
powershell -ex AllSigned -c "Invoke-RestMethod 'https://aka.ms/install-azd.ps1' | Invoke-Expression"
52-
```
49+
# [Visual Studio Code](#tab/visual-studio-code)
5350

54-
### Sign in with Azure Developer CLI
51+
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**.
5552

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

60-
### Enable AZD support for ADE
55+
# [Azure Developer CLI](#tab/azure-developer-cli)
6156

62-
```powershell
63-
azd config set platform.type devcenter
6457

58+
```bash
59+
powershell -ex AllSigned -c "Invoke-RestMethod 'https://aka.ms/install-azd.ps1' | Invoke-Expression"
6560
```
6661

67-
# [Visual Studio Code](#tab/visual-studio-code)
68-
69-
### 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+
---
7463

7564
### Sign in with Azure Developer CLI
7665

7766
Sign in to AZD using the command palette:
7867

68+
# [Visual Studio Code](#tab/visual-studio-code)
69+
7970
:::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":::
8071

8172
The output of commands issued from the command palette is displayed in an **azd dev** terminal like the following example:
8273

8374
:::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":::
8475

76+
# [Azure Developer CLI](#tab/azure-developer-cli)
77+
78+
79+
```bash
80+
azd auth login
81+
```
82+
83+
---
84+
8585
### Enable AZD support for ADE
8686

8787
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.
8888

89+
# [Visual Studio Code](#tab/visual-studio-code)
90+
8991
:::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":::
9092

93+
94+
# [Azure Developer CLI](#tab/azure-developer-cli)
95+
96+
```bash
97+
azd config set platform.type devcenter
98+
```
99+
91100
---
92101

93102
## Create an environment from existing code
@@ -100,12 +109,6 @@ Initializing a new application creates the files and folders that are required f
100109

101110
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).
102111

103-
# [Azure Developer CLI](#tab/azure-developer-cli)
104-
105-
```powershell
106-
azd init
107-
```
108-
109112
# [Visual Studio Code](#tab/visual-studio-code)
110113

111114
1. In Visual Studio Code, and then open the folder that contains your application code.
@@ -126,25 +129,24 @@ azd init
126129

127130
AZD creates an *azure.yaml* file in the root of your project.
128131

132+
# [Azure Developer CLI](#tab/azure-developer-cli)
133+
134+
```bash
135+
azd init
136+
```
129137
---
130138

131139
### Provision infrastructure to Azure Deployment Environment
132140

133141
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.
134142

135-
# [Azure Developer CLI](#tab/azure-developer-cli)
136-
137-
```powershell
138-
azd provision
139-
```
140-
141143
# [Visual Studio Code](#tab/visual-studio-code)
142144

143145
1. In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (azd)** > **Provision Azure Resources (provision)**.
144146

145147
:::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":::
146148

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:
148150
1. Project
149151
1. Environment definition
150152
1. Environment name
@@ -154,18 +156,18 @@ azd provision
154156

155157
1. You can view the resources created in the Azure portal or in the [developer portal](https://devportal.microsoft.com).
156158

159+
# [Azure Developer CLI](#tab/azure-developer-cli)
160+
161+
```bash
162+
azd provision
163+
```
164+
157165
---
158166

159167
### List existing environments (optional)
160168

161169
Verify that your environment is created by listing the existing environments.
162170

163-
# [Azure Developer CLI](#tab/azure-developer-cli)
164-
165-
```powershell
166-
azd env list
167-
```
168-
169171
# [Visual Studio Code](#tab/visual-studio-code)
170172

171173
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 (
174176

175177
You're prompted to select a project and an environment definition.
176178

177-
---
178-
179-
### Deploy code to Azure Deployment Environments
180-
181179
# [Azure Developer CLI](#tab/azure-developer-cli)
182180

183-
```powershell
184-
azd env deploy
181+
```bash
182+
azd env list
185183
```
184+
---
186185

187-
# [Visual Studio Code](#tab/visual-studio-code)
186+
### Deploy code to Azure Deployment Environments
188187

189188
When your environment is provisioned, you can deploy your code to the environment.
190189

190+
# [Visual Studio Code](#tab/visual-studio-code)
191+
191192
1. In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (azd)** > **Deploy Azure Resources (deploy)**.
192193

193194
:::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":::
194195

195196
1. You can verify that your code is deployed by selecting the end point URLs listed in the AZD terminal.
196197

198+
# [Azure Developer CLI](#tab/azure-developer-cli)
199+
200+
```bash
201+
azd env deploy
202+
```
197203
---
198204

199205
## Clean up resources
200206

201207
When you're finished with your environment, you can delete the Azure resources.
202208

203-
# [Azure Developer CLI](#tab/azure-developer-cli)
204-
205-
```powershell
206-
azd down
207-
```
208-
209209
# [Visual Studio Code](#tab/visual-studio-code)
210210

211211
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 (
214214

215215
Confirm that you want to delete the environment by entering `y` when prompted.
216216

217+
# [Azure Developer CLI](#tab/azure-developer-cli)
218+
219+
```bash
220+
azd down --environment <environmentName>
221+
```
222+
---
223+
217224
## Related content
218225
- [Create and configure a dev center](/azure/deployment-environments/quickstart-create-and-configure-devcenter)
219226
- [What is the Azure Developer CLI?](/azure/developer/azure-developer-cli/overview)

0 commit comments

Comments
 (0)