Skip to content

Commit 924bf2d

Browse files
author
RoseHJM
committed
WIP
1 parent ab422d8 commit 924bf2d

File tree

1 file changed

+74
-1
lines changed

1 file changed

+74
-1
lines changed

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

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,29 @@ To get help with AZD compatibility, see [Make your project compatible with Azure
4343

4444
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.
4545

46+
# [Azure Developer CLI](#tab/azure-developer-cli)
47+
48+
### Install the Azure Developer CLI
49+
50+
```powershell
51+
powershell -ex AllSigned -c "Invoke-RestMethod 'https://aka.ms/install-azd.ps1' | Invoke-Expression"
52+
```
53+
54+
### Sign in with Azure Developer CLI
55+
56+
```powershell
57+
azd auth login
58+
```
59+
60+
### Enable AZD support for ADE
61+
62+
```powershell
63+
azd config set platform.type devcenter
64+
65+
```
66+
67+
# [Visual Studio Code](#tab/visual-studio-code)
68+
4669
### Install the Azure Developer CLI extension for Visual Studio Code
4770

4871
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
6184

6285
### Enable AZD support for ADE
6386

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

6689
:::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":::
6790

91+
---
92+
6893
## Create an environment from existing code
6994

7095
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
75100

76101
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).
77102

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+
78111
1. In Visual Studio Code, and then open the folder that contains your application code.
79112

80113
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
93126

94127
AZD creates an *azure.yaml* file in the root of your project.
95128

129+
---
130+
96131
### Provision infrastructure to Azure Deployment Environment
97132

98133
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.
99134

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+
100143
1. In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (azd)** > **Provision Azure Resources (provision)**.
101144

102145
:::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
111154

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

157+
---
158+
114159
### List existing environments (optional)
115160

116161
Verify that your environment is created by listing the existing environments.
117162

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+
118171
In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (azd)** > **View Local and Remote Environments (env list)**.
119172

120173
:::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":::
121174

122175
You're prompted to select a project and an environment definition.
123176

177+
---
178+
124179
### Deploy code to Azure Deployment Environments
125180

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+
126189
When your environment is provisioned, you can deploy your code to the environment.
127190

128191
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
131194

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

197+
---
198+
134199
## Clean up resources
135200

136201
When you're finished with your environment, you can delete the Azure resources.
137202

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+
138211
In Explorer, right-click **azure.yaml**, and then select **Azure Developer CLI (azd)** > **Delete Deployment and Resources (down)**.
139212

140213
:::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

Comments
 (0)