Skip to content

Commit e7ea52a

Browse files
authored
Merge pull request #49822 from mumian/0822-arm-quickstarts
[ARM] update the quickstart-vscode
2 parents 1c46c20 + 681807c commit e7ea52a

7 files changed

+69
-72
lines changed
Loading

articles/azure-resource-manager/resource-manager-quickstart-create-templates-use-the-portal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ When the Azure resources are no longer needed, clean up the resources you deploy
196196

197197
## Next steps
198198

199-
In this tutorial, you learned how to generate a template from the Azure portal, and how to deploy the template using the portal. The template used in this Quickstart is a simple template with one Azure resource. When the template is complex, it is easier to use Visual Studio Code or Visual Studio to develop the template.
199+
In this tutorial, you learned how to generate a template from the Azure portal, and how to deploy the template using the portal. The template used in this Quickstart is a simple template with one Azure resource. When the template is complex, it is easier to use Visual Studio Code or Visual Studio to develop the template. The next quickstart also show you how to deploy templates using Azure PowerShell and Azure Command-line Interface (CLI).
200200

201201
> [!div class="nextstepaction"]
202202
> [Create templates by using Visual Studio Code](./resource-manager-quickstart-create-templates-use-visual-studio-code.md)

articles/azure-resource-manager/resource-manager-quickstart-create-templates-use-visual-studio-code.md

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Use Visual Studio Code to create Azure Resource Manager template | Microsoft Docs
3-
description: Use the Azure Resource Manager tools extension to work on Resource Manager templates.
3+
description: Use Visual Studio Code and the Azure Resource Manager tools extension to work on Resource Manager templates.
44
services: azure-resource-manager
55
documentationcenter: ''
66
author: mumian
@@ -11,11 +11,11 @@ ms.service: azure-resource-manager
1111
ms.workload: multiple
1212
ms.tgt_pltfrm: na
1313
ms.devlang: na
14-
ms.date: 07/17/2018
14+
ms.date: 08/24/2018
1515
ms.topic: quickstart
1616
ms.author: jgao
1717

18-
#Customer intent: As a developer new to Azure deployment, I want to learn how to create a resource manager template so I can deploy Azure resources.
18+
#Customer intent: As a developer new to Azure deployment, I want to learn how to create a resource manager template using Visual Studio Code, so I can deploy Azure resources.
1919

2020
---
2121

@@ -88,32 +88,49 @@ To learn how to edit a template using Visual Studio Code, you add one more eleme
8888

8989
## Deploy the template
9090

91-
There are many methods for deploying templates. In this quickstart, you use the Cloud shell from the Azure portal. The Cloud shell supports both Azure CLI and Azure PowerShell. The instructions provided here use CLI.
91+
There are many methods for deploying templates. In this quickstart, you use Azure Cloud Shell from the Azure portal. Cloud Shell supports both Azure CLI and Azure PowerShell.
9292

9393
1. Sign in to the [Azure portal](https://portal.azure.com)
9494
2. Select **Cloud Shell** from the upper right corner as shown in the following image:
9595

9696
![Azure portal Cloud shell](./media/resource-manager-quickstart-create-templates-use-visual-studio-code/azure-portal-cloud-shell.png)
9797

98-
3. Select the down arrow and then select **Bash** to switch to CLI from PowerShell.
98+
Cloud Shell is opened on the bottom of the screen.
99+
100+
3. On the upper left corner of the Cloud shell, it shows either **PowerShell** or **Bash**. To use CLI, you need to open a Bash session. To run PowerShell, you need to open a PowerShell session. To switch, select the down arrow, and then select the interpreter. The following image shows switching from PowerShell to Bash.
99101

100102
![Azure portal Cloud shell CLI](./media/resource-manager-quickstart-create-templates-use-visual-studio-code/azure-portal-cloud-shell-choose-cli.png)
101-
4. Select **Restart** to restart the shell.
102-
5. Select **Upload/download files**, and then select **Upload**.
103+
104+
Restarting the shell is required when you switch.
105+
4. Select **Upload/download files**, and then select **Upload**.
103106

104107
![Azure portal Cloud shell upload file](./media/resource-manager-quickstart-create-templates-use-visual-studio-code/azure-portal-cloud-shell-upload-file.png)
105-
4. Select the file you saved earlier in the quickstart. The default name is **azuredeploy.json**.
106-
5. From the Cloud shell, run the **ls** command to verify the file is uploaded successfully. You can also use the **cat** command to verify the template content.
108+
109+
You must upload the template file before you can deploy it from the shell.
110+
5. Select the file you saved earlier in the quickstart. The default name is **azuredeploy.json**.
111+
6. From the Cloud shell, run the **ls** command to verify the file is uploaded successfully. You can also use the **cat** command to verify the template content. The following image shows running the command from Bash. You use the same commands from a PowerShell session.
107112

108113
![Azure portal Cloud shell list file](./media/resource-manager-quickstart-create-templates-use-visual-studio-code/azure-portal-cloud-shell-list-file.png)
109-
6. From the Cloud shell, run the following commands:
114+
7. From the Cloud shell, run the following commands. Select the tab to show the PowerShell code or the CLI code.
110115

116+
# [CLI](#tab/CLI)
111117
```cli
112118
az group create --name <ResourceGroupName> --location <AzureLocation>
113119

114120
az group deployment create --name <DeploymentName> --resource-group <ResourceGroupName> --template-file <TemplateFileName>
115121
```
116-
Here is the screenshot of a sample deployment:
122+
123+
# [PowerShell](#tab/PowerShell)
124+
125+
```powershell
126+
New-AzureRmResourceGroup -Name <ResourceGroupName> -Location <AzureLocation>
127+
128+
New-AzureRmResourceGroupDeployment -ResourceGroupName <ResourceGroupName> -TemplateFile <TemplateFileName>
129+
```
130+
131+
---
132+
133+
The following screenshot shows a sample CLI deployment:
117134

118135
![Azure portal Cloud shell deploy template](./media/resource-manager-quickstart-create-templates-use-visual-studio-code/azure-portal-cloud-shell-deploy-template.png)
119136

@@ -126,11 +143,20 @@ There are many methods for deploying templates. In this quickstart, you use the
126143

127144
From the screenshot output, the storage account name is *3tqebj3slyfyestandardsa*.
128145

129-
7. Run the following CLI command to list the newly created storage account:
146+
7. Run the following CLI or PowerShell command to list the newly created storage account:
130147

148+
# [CLI](#tab/CLI)
131149
```cli
132150
az storage account show --resource-group <ResourceGroupName> --name <StorageAccountName>
133151
```
152+
153+
# [PowerShell](#tab/PowerShell)
154+
155+
```powershell
156+
Get-AzureRmStorageAccount -ResourceGroupName <ResourceGroupName> -Name <StorageAccountName>
157+
```
158+
159+
---
134160

135161
## Clean up resources
136162

@@ -143,7 +169,7 @@ When the Azure resources are no longer needed, clean up the resources you deploy
143169

144170
## Next steps
145171

146-
In this tutorial, you learned how to create a template using Visual Studio Code, and how to deploy the template using the Azure portal Cloud shell. In the next tutorial, you learn more about how to develop a template, and how to use template reference.
172+
The primary focus of this tutorial is to use Visual Studio Code to edit an existing template from Azure Quickstart templates. You also learned how to deploy the template using either CLI or PowerShell from Azure Cloud Shell. The templates from Azure Quickstart templates might not give you everything you need. The next tutorial shows you how to find the information from template reference so you can create an encrypted Azure Storage account.
147173

148174
> [!div class="nextstepaction"]
149-
> [Create an encrypted Storage account](./resource-manager-tutorial-create-encrypted-storage-accounts.md)
175+
> [Create an encrypted storage account](./resource-manager-tutorial-create-encrypted-storage-accounts.md)

articles/azure-resource-manager/resource-manager-tutorial-create-encrypted-storage-accounts.md

Lines changed: 10 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.service: azure-resource-manager
1111
ms.workload: multiple
1212
ms.tgt_pltfrm: na
1313
ms.devlang: na
14-
ms.date: 07/20/2018
14+
ms.date: 08/27/2018
1515
ms.topic: tutorial
1616
ms.author: jgao
1717

@@ -27,9 +27,7 @@ This tutorial covers the following tasks:
2727

2828
> [!div class="checklist"]
2929
> * Open a Quickstart template
30-
> * Understand the template format
31-
> * Use parameters in template
32-
> * Use variables in template
30+
> * Understand the template
3331
> * Edit the template
3432
> * Deploy the template
3533
@@ -98,7 +96,7 @@ Variables allow you to construct values that can be used throughout your templat
9896
This template defines one variable *storageAccountName*. In the definition, two template functions are used:
9997

10098
- **concat()**: concatenates strings. For more information, see [concat](./resource-group-template-functions-string.md#concat).
101-
- **uniqueString()**: creates a deterministic hash string based on the values provided as parameters. Each Azure storage account must have an unique name across of all Azure. This function provides an unique string. For more string functions, see [String functions](./resource-group-template-functions-string.md).
99+
- **uniqueString()**: creates a deterministic hash string based on the values provided as parameters. Each Azure storage account must have a unique name across of all Azure. This function provides a unique string. For more string functions, see [String functions](./resource-group-template-functions-string.md).
102100

103101
To use the variable defined in the template:
104102

@@ -108,10 +106,10 @@ To use the variable defined in the template:
108106

109107
## Edit the template
110108

111-
To find the storage account encryption-related configuration, you can use the template reference of Azure Storage account.
109+
The goal of this tutorial is to define a template to create an encrypted storage account. The sample template only creates a basic unencrypted storage account. To find the encryption-related configuration, you can use the template reference of Azure Storage account.
112110

113111
1. Browse to [Azure Templates](https://docs.microsoft.com/azure/templates/).
114-
2. From the TOC on the left, select **Reference**->**Storage**->**Storage Accounts**. The page contains the information for defining a Storage Account information.
112+
2. From the TOC on the left, select **Reference**->**Storage**->**Storage Accounts**. You can also enter **storage** in the **Filter by title** field. The page contains the schema for defining a Storage Account information.
115113
3. Explore the encryption-related information.
116114
4. Inside the properties element of the storage account resource definition, add the following json:
117115

@@ -127,59 +125,17 @@ To find the storage account encryption-related configuration, you can use the te
127125
```
128126
This part enables the encryption function of the blob storage service.
129127

130-
The final resources element looks like:
128+
From Visual Studio Code, modify the template so that the final resources element looks like:
131129

132130
![Resource Manager template encrypted storage account resources](./media/resource-manager-tutorial-create-encrypted-storage-accounts/resource-manager-template-encrypted-storage-resources.png)
133131

134132
## Deploy the template
135133

136-
There are many methods for deploying templates. In this tutorial, you use the Cloud shell from the Azure portal. The Cloud shell supports both Azure CLI and Azure PowerShell. The instructions provided here use CLI.
134+
Refer to the [Deploy the template](./resource-manager-quickstart-create-templates-use-visual-studio-code.md#deploy-the-template) section in the Visual Studio Code quickstart for the deployment procedure.
137135

138-
1. Sign in to the [Azure portal](https://portal.azure.com)
139-
2. Select **Cloud Shell** from the upper right corner as shown in the following image:
136+
The following screenshot shows the CLI command for listing the newly created storage account, which indicates encryption has been enabled for the blob storage.
140137

141-
![Azure portal Cloud shell](./media/resource-manager-tutorial-create-encrypted-storage-accounts/azure-portal-cloud-shell.png)
142-
143-
3. Select the down arrow and then select **Bash** if it is not Bash. You use Azure CLI in this tutorial.
144-
145-
![Azure portal Cloud shell CLI](./media/resource-manager-tutorial-create-encrypted-storage-accounts/azure-portal-cloud-shell-choose-cli.png)
146-
4. Select **Restart** to restart the shell.
147-
5. Select **Upload/download files**, and then select **Upload**.
148-
149-
![Azure portal Cloud shell upload file](./media/resource-manager-tutorial-create-encrypted-storage-accounts/azure-portal-cloud-shell-upload-file.png)
150-
6. Select the file you saved earlier in the tutorial. The default name is **azuredeploy.json**.
151-
7. From the Cloud shell, run the **ls** command to verify the file is uploaded successfully. You can also use the **cat** command to verify the template content.
152-
153-
![Azure portal Cloud shell list file](./media/resource-manager-tutorial-create-encrypted-storage-accounts/azure-portal-cloud-shell-list-file.png)
154-
8. From the Cloud shell, run the following commands:
155-
156-
```cli
157-
az group create --name <ResourceGroupName> --location <AzureLocation>
158-
159-
az group deployment create --name <DeploymentName> --resource-group <ResourceGroupName> --template-file azuredeploy.json
160-
```
161-
Here is the screenshot of a sample deployment:
162-
163-
![Azure portal Cloud shell deploy template](./media/resource-manager-tutorial-create-encrypted-storage-accounts/azure-portal-cloud-shell-deploy-template.png)
164-
165-
On the screenshot, these values are used:
166-
167-
* **&lt;ResourceGroupName>**: myresourcegroup0719. There are two appearances of the parameter. Make sure to use the same value.
168-
* **&lt;AzureLocation>**: eastus2
169-
* **&lt;DeployName>**: mydeployment0719
170-
* **&lt;TemplateFile>**: azuredeploy.json
171-
172-
From the screenshot output, the storage account name is *fhqbfslikdqdsstandardsa*.
173-
174-
9. Run the following PowerShell command to list the newly created storage account:
175-
176-
```cli
177-
az storage account show --resource-group <ResourceGroupName> --name <StorageAccountName>
178-
```
179-
180-
You shall see an output similar to the following screenshot which indicates encryption has been enabled for the blob storage.
181-
182-
![Azure resource manager encrypted storage account](./media/resource-manager-tutorial-create-encrypted-storage-accounts/resource-manager-template-encrypted-storage-account.png)
138+
![Azure Resource Manager encrypted storage account](./media/resource-manager-tutorial-create-encrypted-storage-accounts/resource-manager-template-encrypted-storage-account.png)
183139

184140
## Clean up resources
185141

@@ -192,7 +148,7 @@ When the Azure resources are no longer needed, clean up the resources you deploy
192148

193149
## Next steps
194150

195-
In this tutorial, you learned how to use template reference to customize an existing template. The template used in this tutorial only contains one Azure resource. In the next tutorial, you develop a template with multiple resources. Some of the resources have dependent resources.
151+
In this tutorial, you learned how to use template reference to customize an existing template. The template used in this tutorial only contains one Azure resource. In the next tutorial, you develop a template with multiple resources. Some of the resources have dependent resources.
196152

197153
> [!div class="nextstepaction"]
198154
> [Create multiple resources](./resource-manager-tutorial-create-templates-with-dependent-resources.md)

articles/azure-resource-manager/resource-manager-tutorial-create-templates-with-dependent-resources.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.service: azure-resource-manager
1111
ms.workload: multiple
1212
ms.tgt_pltfrm: na
1313
ms.devlang: na
14-
ms.date: 07/20/2018
14+
ms.date: 08/27/2018
1515
ms.topic: tutorial
1616
ms.author: jgao
1717
---
@@ -53,12 +53,27 @@ Azure QuickStart Templates is a repository for Resource Manager templates. Inste
5353

5454
## Explore the template
5555

56+
When you explore the template in this section, try to answer these questions:
57+
58+
- How many Azure resources defined in this template?
59+
- One of the resources is an Azure storage account. Does the definition look like the one used in the last tutorial?
60+
- Can you find the template references for the resources defined in this template?
61+
- Can you find the dependencies of the resources?
62+
5663
1. From Visual Studio Code, collapse the elements until you only see the first-level elements and the second-level elements inside **resources**:
5764

5865
![Visual Studio Code Azure Resource Manager templates](./media/resource-manager-tutorial-create-templates-with-dependent-resources/resource-manager-template-visual-studio-code.png)
5966

6067
There are five resources defined by the template.
61-
2. Expand the fourth element:
68+
2. Expand the first resource. It is a storage account. The definition shall be identical to the one used at the begining of the last tutorial.
69+
70+
![Visual Studio Code Azure Resource Manager templates storage account definition](./media/resource-manager-tutorial-create-templates-with-dependent-resources/resource-manager-template-storage-account-definition.png)
71+
72+
3. Expand the second resource. The resource type is **Microsoft.Network/publicIPAddresses**. To find the template reference, browse to [template reference](https://docs.microsoft.com/azure/templates/), enter **public ip address** or **public ip addresses** in the **Filter by title** field. Compare the resource definition to the template reference.
73+
74+
![Visual Studio Code Azure Resource Manager templates public IP address definition](./media/resource-manager-tutorial-create-templates-with-dependent-resources/resource-manager-template-public-ip-address-definition.png)
75+
4. Repeat the last step to find the template references for the other resources defined in this template. Compare the resource definitions to the references.
76+
5. Expand the fourth resource:
6277

6378
![Visual Studio Code Azure Resource Manager templates dependson](./media/resource-manager-tutorial-create-templates-with-dependent-resources/resource-manager-template-visual-studio-code-dependson.png)
6479

@@ -67,7 +82,7 @@ Azure QuickStart Templates is a repository for Resource Manager templates. Inste
6782
* publicIPAddress
6883
* virtualNetwork
6984

70-
3. Expand the fifth element. This resource is a virtual machine. It depends on two other resources:
85+
6. Expand the fifth resource. This resource is a virtual machine. It depends on two other resources:
7186

7287
* storageAccount
7388
* networkInterface

0 commit comments

Comments
 (0)