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/resource-group-authoring-templates.md
+26-26Lines changed: 26 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Describes the structure and properties of Azure Resource Manager te
4
4
author: tfitzmac
5
5
ms.service: azure-resource-manager
6
6
ms.topic: conceptual
7
-
ms.date: 10/09/2019
7
+
ms.date: 11/12/2019
8
8
ms.author: tomfitz
9
9
---
10
10
@@ -281,6 +281,31 @@ For examples of how to use outputs, see [Outputs in Azure Resource Manager templ
281
281
282
282
You have a few options for adding comments and metadata to your template.
283
283
284
+
### Comments
285
+
286
+
For inline comments, you can use either `//` or `/* ... */` but this syntax doesn't work with all tools. You can't use the portal template editor to work on templates with inline comments. If you add this style of comment, be sure the tools you use support inline JSON comments.
287
+
288
+
> [!NOTE]
289
+
> To deploy templates with comments by using Azure CLI, you must use the `--handle-extended-json-format` switch.
290
+
291
+
```json
292
+
{
293
+
"type": "Microsoft.Compute/virtualMachines",
294
+
"name": "[variables('vmName')]", // to customize name, change it in variables
295
+
"location": "[parameters('location')]", //defaults to resource group location
296
+
"apiVersion": "2018-10-01",
297
+
"dependsOn": [ /* storage account and network interface must be deployed first */
In Visual Studio Code, the [Azure Resource Manager Tools extension](./resource-manager-tools-vs-code.md#install-resource-manager-tools-extension) can automatically detect Resource Manager template and change the language mode accordingly. If you see **Azure Resource Manager Template** at the bottom right corner of VS Code, you can use the inline comments. The inline comments are no longer marked as invalid.
304
+
305
+

306
+
307
+
### Metadata
308
+
284
309
You can add a `metadata` object almost anywhere in your template. Resource Manager ignores the object, but your JSON editor may warn you that the property isn't valid. In the object, define the properties you need.
285
310
286
311
```json
@@ -350,31 +375,6 @@ For **outputs**, add a metadata object to the output value.
350
375
351
376
You can't add a metadata object to user-defined functions.
352
377
353
-
For inline comments, you can use either `//` or `/* ... */` but this syntax doesn't work with all tools. You can't use the portal template editor to work on templates with inline comments. If you add this style of comment, be sure the tools you use support inline JSON comments.
354
-
355
-
> [!NOTE]
356
-
> To deploy templates with comments by using Azure CLI, you must use the `--handle-extended-json-format` switch.
357
-
358
-
```json
359
-
{
360
-
"type": "Microsoft.Compute/virtualMachines",
361
-
"name": "[variables('vmName')]", // to customize name, change it in variables
362
-
"location": "[parameters('location')]", //defaults to resource group location
363
-
"apiVersion": "2018-10-01",
364
-
"dependsOn": [ /* storage account and network interface must be deployed first */
0 commit comments