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
+74-1Lines changed: 74 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,29 @@ To get help with AZD compatibility, see [Make your project compatible with Azure
43
43
44
44
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.
### Install the Azure Developer CLI extension for Visual Studio Code
47
70
48
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**.
@@ -61,10 +84,12 @@ The output of commands issued from the command palette is displayed in an **azd
61
84
62
85
### Enable AZD support for ADE
63
86
64
-
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.
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.
65
88
66
89
:::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":::
67
90
91
+
---
92
+
68
93
## Create an environment from existing code
69
94
70
95
Now you're ready to create an environment to work in. You can begin with code in a local folder, or you can clone an existing repository. In this example, you create an environment by using code in a local folder.
@@ -75,6 +100,14 @@ Initializing a new application creates the files and folders that are required f
75
100
76
101
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).
77
102
103
+
# [Azure Developer CLI](#tab/azure-developer-cli)
104
+
105
+
```powershell
106
+
azd init
107
+
```
108
+
109
+
# [Visual Studio Code](#tab/visual-studio-code)
110
+
78
111
1. In Visual Studio Code, and then open the folder that contains your application code.
79
112
80
113
1. Open the command palette, and enter *Azure Developer CLI init*, then from the list, select **Azure Developer CLI (azd): init**.
@@ -93,10 +126,20 @@ AZD uses an *azure.yaml* file to define the environment. The azure.yaml file def
93
126
94
127
AZD creates an *azure.yaml* file in the root of your project.
95
128
129
+
---
130
+
96
131
### Provision infrastructure to Azure Deployment Environment
97
132
98
133
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.
99
134
135
+
# [Azure Developer CLI](#tab/azure-developer-cli)
136
+
137
+
```powershell
138
+
azd provision
139
+
```
140
+
141
+
# [Visual Studio Code](#tab/visual-studio-code)
142
+
100
143
1. In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (azd)** > **Provision Azure Resources (provision)**.
101
144
102
145
:::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":::
@@ -111,18 +154,38 @@ When you're ready, you can provision your local environment to a remote Azure De
111
154
112
155
1. You can view the resources created in the Azure portal or in the [developer portal](https://devportal.microsoft.com).
113
156
157
+
---
158
+
114
159
### List existing environments (optional)
115
160
116
161
Verify that your environment is created by listing the existing environments.
117
162
163
+
# [Azure Developer CLI](#tab/azure-developer-cli)
164
+
165
+
```powershell
166
+
azd env list
167
+
```
168
+
169
+
# [Visual Studio Code](#tab/visual-studio-code)
170
+
118
171
In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (azd)** > **View Local and Remote Environments (env list)**.
119
172
120
173
:::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":::
121
174
122
175
You're prompted to select a project and an environment definition.
123
176
177
+
---
178
+
124
179
### Deploy code to Azure Deployment Environments
125
180
181
+
# [Azure Developer CLI](#tab/azure-developer-cli)
182
+
183
+
```powershell
184
+
azd env deploy
185
+
```
186
+
187
+
# [Visual Studio Code](#tab/visual-studio-code)
188
+
126
189
When your environment is provisioned, you can deploy your code to the environment.
127
190
128
191
1. In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (azd)** > **Deploy Azure Resources (deploy)**.
@@ -131,10 +194,20 @@ When your environment is provisioned, you can deploy your code to the environmen
131
194
132
195
1. You can verify that your code is deployed by selecting the end point URLs listed in the AZD terminal.
133
196
197
+
---
198
+
134
199
## Clean up resources
135
200
136
201
When you're finished with your environment, you can delete the Azure resources.
137
202
203
+
# [Azure Developer CLI](#tab/azure-developer-cli)
204
+
205
+
```powershell
206
+
azd down
207
+
```
208
+
209
+
# [Visual Studio Code](#tab/visual-studio-code)
210
+
138
211
In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (azd)** > **Delete Deployment and Resources (down)**.
139
212
140
213
:::image type="content" source="media/how-to-create-environment-with-azure-developer/azure-developer-menu-environment-down.png" alt-text="Screenshot of Visual Studio Code with azure.yaml highlighted, and the AZD context menu with Azure Developer CLI and Delete Deployment and Resources (down) highlighted." lightbox="media/how-to-create-environment-with-azure-developer/azure-developer-menu-environment-down.png":::
0 commit comments