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/azure-resource-manager/templates/quickstart-create-templates-use-visual-studio-code.md
+29-29Lines changed: 29 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,111 +10,111 @@ ms.author: nepeters
10
10
11
11
---
12
12
13
-
# Quickstart: Create Azure Resource Manager templates by using Visual Studio Code
13
+
# Quickstart: Create Azure Resource Manager templates with Visual Studio Code
14
14
15
-
The Azure Resource Manager (ARM) Tools for Visual Studio Code provide language support, resource snippets, and resource autocompletion. These tools help create and validate Azure Resource Manager templates. In this quickstart, you use the ARM tools to create an Azure Resource Manager template from scratch. While doing so you experience ARM tools capabilities such as ARM template snippets, validation, completions, and parameter file support.
15
+
The Azure Resource Manager Tools for Visual Studio Code provide language support, resource snippets, and resource autocompletion. These tools help create and validate Azure Resource Manager templates. In this quickstart, you use the extension to create an Azure Resource Manager template from scratch. While doing so you experience the extensions capabilities such as ARM template snippets, validation, completions, and parameter file support.
16
16
17
-
To complete this quickstart, you need [Visual Studio Code](https://code.visualstudio.com/), with the [Azure Resource Manager (ARM) tools extension](https://marketplace.visualstudio.com/items?itemName=msazurermtools.azurerm-vscode-tools) installed. You also need either the [Azure CLI](https://docs.microsoft.com/cli/azure/?view=azure-cli-latest) or the [Azure PowerShell module](https://docs.microsoft.com/powershell/azure/new-azureps-module-az?view=azps-3.7.0) installed and authenticated.
17
+
To complete this quickstart, you need [Visual Studio Code](https://code.visualstudio.com/), with the [Azure Resource Manager tools extension](https://marketplace.visualstudio.com/items?itemName=msazurermtools.azurerm-vscode-tools) installed. You also need either the [Azure CLI](https://docs.microsoft.com/cli/azure/?view=azure-cli-latest) or the [Azure PowerShell module](https://docs.microsoft.com/powershell/azure/new-azureps-module-az?view=azps-3.7.0) installed and authenticated.
18
18
19
19
If you don't have an Azure subscription, [create a free account](https://azure.microsoft.com/free/) before you begin.
20
20
21
21
## Create an ARM template
22
22
23
-
Create and open with Visual Studio Code a new file named *azuredeploy.json*. Enter `arm` into the code editor, which initiates ARM Tools snippets for scaffolding out an ARM template.
23
+
Create and open with Visual Studio Code a new file named *azuredeploy.json*. Enter `arm` into the code editor, which initiates Azure Resource Manager snippets for scaffolding out an ARM template.
24
24
25
25
Select `arm!` to create a template scoped for an Azure resource group deployment.

32
32
33
-
Notice that the VS Code language mode has changed from *JSON* to *Azure Resource Manager Template*. The ARM Tools extension includes a language server specific to ARM templates which provides ARM template-specific validation, completion, and other language services.
33
+
Notice that the Visual Studio Code language mode has changed from *JSON* to *Azure Resource Manager Template*. The extension includes a language server specific to ARM templates which provides ARM template-specific validation, completion, and other language services.

52
52
53
53
## Completion and validation
54
54
55
-
One of the most powerful capabilities of the ARM Tools extension for VS Code is its integration with Azure schemas. Azure schemas provide the extension with validation and resource-aware completion capabilities. Let's modify the storage account to see validation and completion in action.
55
+
One of the most powerful capabilities of the extension is its integration with Azure schemas. Azure schemas provide the extension with validation and resource-aware completion capabilities. Let's modify the storage account to see validation and completion in action.
56
56
57
57
First, update the storage account kind to an invalid value such as `megaStorage`. Notice that this action produces a warning indicating that `megaStorage` is not a valid value.

60
60
61
61
To use the completion capabilities, remove `megaStorage`, place the cursor inside of the double quotes, and press `ctrl` + `space`. This action presents a completion list of valid values.
Now create and use a parameter to specify the storage account name.
68
68
69
69
Place your cursor in the parameters block, add a carriage return, type `par`, and then select the `arm-param-value` snippet. This action adds a generic parameter to the template.

76
76
77
77
Azure storage account names have a minimum length of 3 characters and a maximum of 24. Add both `minLength` and `maxLength` to the parameter and provide appropriate values.

80
80
81
-
Now, on the storage resource, update the name property to use the parameter. To do so, remove the current name. Enter a double quote and an opening square bracket `[`, which produces a list of ARM functions. Select *parameters* from the list.
81
+
Now, on the storage resource, update the name property to use the parameter. To do so, remove the current name. Enter a double quote and an opening square bracket `[`, which produces a list of ARM template functions. Select *parameters* from the list.

84
84
85
85
Entering a single quote `'` inside of the round brackets produces a list of all parameters defined in the template, in this case, *storageAccountName*. Select the parameter.

88
88
89
89
## Create a parameter file
90
90
91
91
An ARM template parameter file allows you to store environment-specific parameter values and pass these values in as a group at deployment time. For example, you may have a parameter file with values specific to a test environment and another for a production environment.
92
92
93
-
The ARM Tools extension for VS Code makes it easy to create a parameter file from your existing templates. To do so, right-click on the template in the code editor and select `Select/Create Parameter File`.
93
+
The extension makes it easy to create a parameter file from your existing templates. To do so, right-click on the template in the code editor and select `Select/Create Parameter File`.

96
96
97
97
Select `New` > `All Parameters` > Select a name and location for the parameter file.

100
100
101
-
This action creates a new parameters file and maps it with the template from which it was created. You can see and modify the current template/parameter file mapping in the VS Code status bar while the template is selected.
101
+
This action creates a new parameter file and maps it with the template from which it was created. You can see and modify the current template/parameter file mapping in the Visual Studio Code status bar while the template is selected.
Now that the parameter file has been mapped to the template, the ARM Tools extension validates both the template and parameter file together. To see this validation in practice, add a two-character value to the `storageAccountName` parameter in the parameter file and save the file.
105
+
Now that the parameter file has been mapped to the template, the extension validates both the template and parameter file together. To see this validation in practice, add a two-character value to the `storageAccountName` parameter in the parameter file and save the file.

112
112
113
113
Update the value to something appropriate, save the file, and navigate back to the template. Notice that the error on the parameter has been resolved.
114
114
115
115
## Deploy the template
116
116
117
-
Open the integrated VS Code terminal using the `ctrl` + ```` ` ```` key combination and use either the Azure CLI or Azure PowerShell module to deploy the template.
117
+
Open the integrated Visual Studio Code terminal using the `ctrl` + ```` ` ```` key combination and use either the Azure CLI or Azure PowerShell module to deploy the template.
0 commit comments