Skip to content

Commit 37991dd

Browse files
committed
open port 80
1 parent e00f914 commit 37991dd

File tree

1 file changed

+41
-20
lines changed

1 file changed

+41
-20
lines changed

articles/azure-resource-manager/templates/template-tutorial-deploy-vm-extensions.md

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Deploy VM extensions with template
33
description: Learn how to deploy virtual machine extensions with Azure Resource Manager templates
44
author: mumian
5-
ms.date: 11/13/2018
5+
ms.date: 03/31/2020
66
ms.topic: tutorial
77
ms.author: jgao
88
---
@@ -71,25 +71,25 @@ Add a virtual machine extension resource to the existing template with the follo
7171

7272
```json
7373
{
74-
"type": "Microsoft.Compute/virtualMachines/extensions",
75-
"apiVersion": "2018-06-01",
76-
"name": "[concat(variables('vmName'),'/', 'InstallWebServer')]",
77-
"location": "[parameters('location')]",
78-
"dependsOn": [
79-
"[concat('Microsoft.Compute/virtualMachines/',variables('vmName'))]"
80-
],
81-
"properties": {
82-
"publisher": "Microsoft.Compute",
83-
"type": "CustomScriptExtension",
84-
"typeHandlerVersion": "1.7",
85-
"autoUpgradeMinorVersion":true,
86-
"settings": {
87-
"fileUris": [
88-
"https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/tutorial-vm-extension/installWebServer.ps1"
89-
],
90-
"commandToExecute": "powershell.exe -ExecutionPolicy Unrestricted -File installWebServer.ps1"
91-
}
92-
}
74+
"type": "Microsoft.Compute/virtualMachines/extensions",
75+
"apiVersion": "2018-06-01",
76+
"name": "[concat(variables('vmName'),'/', 'InstallWebServer')]",
77+
"location": "[parameters('location')]",
78+
"dependsOn": [
79+
"[concat('Microsoft.Compute/virtualMachines/',variables('vmName'))]"
80+
],
81+
"properties": {
82+
"publisher": "Microsoft.Compute",
83+
"type": "CustomScriptExtension",
84+
"typeHandlerVersion": "1.7",
85+
"autoUpgradeMinorVersion":true,
86+
"settings": {
87+
"fileUris": [
88+
"https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/tutorial-vm-extension/installWebServer.ps1"
89+
],
90+
"commandToExecute": "powershell.exe -ExecutionPolicy Unrestricted -File installWebServer.ps1"
91+
}
92+
}
9393
}
9494
```
9595

@@ -100,6 +100,27 @@ For more information about this resource definition, see the [extension referenc
100100
* **fileUris**: The locations where the script files are stored. If you choose not to use the provided location, you need to update the values.
101101
* **commandToExecute**: This command invokes the script.
102102

103+
You must also open the HTTP port so that you would be able to access the web server.
104+
105+
1. Find **securityRules** in the template.
106+
1. Add the following rule next to **default-allow-3389**.
107+
108+
```json
109+
{
110+
"name": "AllowHTTPInBound",
111+
"properties": {
112+
"priority": 1010,
113+
"access": "Allow",
114+
"direction": "Inbound",
115+
"destinationPortRange": "80",
116+
"protocol": "Tcp",
117+
"sourcePortRange": "",
118+
"sourceAddressPrefix": "",
119+
"destinationAddressPrefix": "*"
120+
}
121+
}
122+
```
123+
103124
## Deploy the template
104125

105126
For the deployment procedure, see the "Deploy the template" section of [Tutorial: Create ARM templates with dependent resources](./template-tutorial-create-templates-with-dependent-resources.md#deploy-the-template). We recommended that you use a generated password for the virtual machine administrator account. See this article's [Prerequisites](#prerequisites) section.

0 commit comments

Comments
 (0)