Skip to content

Commit e44ab8f

Browse files
authored
Merge pull request #233309 from JustPies/jprefresh-4-4
Freshness Pass for User Story: 79519
2 parents a2f7159 + 06a0cbe commit e44ab8f

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed
-3.77 KB
Loading

articles/virtual-machines/windows/tutorial-automate-vm-deployment.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,52 @@
11
---
22
title: Tutorial - Install applications on a Windows VM in Azure
3-
description: In this tutorial, you learn how to use the Custom Script Extension to run scripts and deploy applications to Windows virtual machines in Azure
3+
description: Learn how to use the Custom Script Extension to run scripts and deploy applications to Windows virtual machines in Azure.
44
author: cynthn
55
ms.service: virtual-machines
66
ms.collection: windows
77
ms.topic: tutorial
88
ms.workload: infrastructure
9-
ms.date: 11/29/2018
9+
ms.date: 04/07/2023
1010
ms.author: cynthn
1111
ms.custom: mvc, devx-track-azurepowershell
1212

13-
#Customer intent: As an IT administrator or developer, I want learn about how to install applications on Windows VMs so that I can automate the process and reduce the risk of human error of manual configuration tasks.
13+
#Customer intent: As an IT administrator or developer, I want to learn about how to install applications on Windows VMs so that I can automate the process and reduce the risk of human error of manual configuration tasks.
1414
---
1515

1616
# Tutorial - Deploy applications to a Windows virtual machine in Azure with the Custom Script Extension
17+
1718
**Applies to:** :heavy_check_mark: Window :heavy_check_mark: Flexible scale sets :heavy_check_mark: Uniform scale sets
1819

1920
To configure virtual machines (VMs) in a quick and consistent manner, you can use the [Custom Script Extension for Windows](../extensions/custom-script-windows.md). In this tutorial you learn how to:
2021

2122
> [!div class="checklist"]
22-
> * Use the Custom Script Extension to install IIS
23-
> * Create a VM that uses the Custom Script Extension
24-
> * View a running IIS site after the extension is applied
23+
> * Use the Custom Script Extension to install IIS.
24+
> * Create a VM that uses the Custom Script Extension.
25+
> * View a running IIS site after the extension is applied.
2526
2627
## Launch Azure Cloud Shell
2728

28-
The Azure Cloud Shell is a free interactive shell that you can use to run the steps in this article. It has common Azure tools preinstalled and configured to use with your account.
29+
The Azure Cloud Shell is a free interactive shell that you can use to run the steps in this article. It has common Azure tools preinstalled and configured to use with your account.
2930

30-
To open the Cloud Shell, just select **Try it** from the upper right corner of a code block. You can also launch Cloud Shell in a separate browser tab by going to [https://shell.azure.com/powershell](https://shell.azure.com/powershell). Select **Copy** to copy the blocks of code, paste it into the Cloud Shell, and press enter to run it.
31+
To open the Cloud Shell, select **Open Cloudshell** from the upper right corner of a code block. You can also launch Cloud Shell in a separate browser tab by going to [https://shell.azure.com/powershell](https://shell.azure.com/powershell). Select **Copy** to copy the blocks of code, paste it into the Cloud Shell, and press enter to run it.
3132

3233
## Custom script extension overview
33-
The Custom Script Extension downloads and executes scripts on Azure VMs. This extension is useful for post deployment configuration, software installation, or any other configuration / management task. Scripts can be downloaded from Azure storage or GitHub, or provided to the Azure portal at extension run time.
3434

35-
The Custom Script extension integrates with Azure Resource Manager templates, and can also be run using the Azure CLI, PowerShell, Azure portal, or the Azure Virtual Machine REST API.
35+
The Custom Script Extension downloads and executes scripts on Azure VMs. This extension is useful for post-deployment configuration, software installation, or any other configuration or management task. You can download scripts from Azure storage or GitHub, or you can provide scripts to the Azure portal at extension run time.
3636

37-
You can use the Custom Script Extension with both Windows and Linux VMs.
37+
The Custom Script extension integrates with Azure Resource Manager templates and can be run by using the Azure CLI, PowerShell, Azure portal, or the Azure Virtual Machine REST API.
3838

39+
You can use the Custom Script Extension with both Linux and Windows VMs.
3940

4041
## Create virtual machine
42+
4143
Set the administrator username and password for the VM with [Get-Credential](/powershell/module/microsoft.powershell.security/get-credential):
4244

4345
```azurepowershell-interactive
4446
$cred = Get-Credential
4547
```
4648

47-
Now you can create the VM with [New-AzVM](/powershell/module/az.compute/new-azvm). The following example creates a VM named *myVM* in the *EastUS* location. If they do not already exist, the resource group *myResourceGroupAutomate* and supporting network resources are created. To allow web traffic, the cmdlet also opens port *80*.
49+
Now you can create the VM with [New-AzVM](/powershell/module/az.compute/new-azvm). The following example creates a VM named *myVM* in the *EastUS* location. If they don't already exist, the resource group *myResourceGroupAutomate* and supporting network resources are created. To allow web traffic, the cmdlet also opens port *80*.
4850

4951
```azurepowershell-interactive
5052
New-AzVm `
@@ -59,10 +61,10 @@ New-AzVm `
5961
-Credential $cred
6062
```
6163

62-
It takes a few minutes for the resources and VM to be created.
63-
64+
The resources and VM take a few minutes to be created.
6465

6566
## Automate IIS install
67+
6668
Use [Set-AzVMExtension](/powershell/module/az.compute/set-azvmextension) to install the Custom Script Extension. The extension runs `powershell Add-WindowsFeature Web-Server` to install the IIS webserver and then updates the *Default.htm* page to show the hostname of the VM:
6769

6870
```azurepowershell-interactive
@@ -76,9 +78,9 @@ Set-AzVMExtension -ResourceGroupName "myResourceGroupAutomate" `
7678
-SettingString '{"commandToExecute":"powershell Add-WindowsFeature Web-Server; powershell Add-Content -Path \"C:\\inetpub\\wwwroot\\Default.htm\" -Value $($env:computername)"}'
7779
```
7880

79-
8081
## Test web site
81-
Obtain the public IP address of your load balancer with [Get-AzPublicIPAddress](/powershell/module/az.network/get-azpublicipaddress). The following example obtains the IP address for *myPublicIPAddress* created earlier:
82+
83+
Obtain the public IP address of your load balancer with [Get-AzPublicIPAddress](/powershell/module/az.network/get-azpublicipaddress). The following example obtains the IP address for `myPublicIPAddress` created earlier:
8284

8385
```azurepowershell-interactive
8486
Get-AzPublicIPAddress `
@@ -88,17 +90,16 @@ Get-AzPublicIPAddress `
8890

8991
You can then enter the public IP address in to a web browser. The website is displayed, including the hostname of the VM that the load balancer distributed traffic to as in the following example:
9092

91-
![Running IIS website](./media/tutorial-automate-vm-deployment/running-iis-website.png)
92-
93+
:::image type="content" source="./media/tutorial-automate-vm-deployment/running-iis-website.png" alt-text="Screenshot of the public IP address in a web browser.":::
9394

9495
## Next steps
9596

9697
In this tutorial, you automated the IIS install on a VM. You learned how to:
9798

9899
> [!div class="checklist"]
99-
> * Use the Custom Script Extension to install IIS
100-
> * Create a VM that uses the Custom Script Extension
101-
> * View a running IIS site after the extension is applied
100+
> * Use the Custom Script Extension to install IIS.
101+
> * Create a VM that uses the Custom Script Extension.
102+
> * View a running IIS site after the extension is applied.
102103
103104
Advance to the next tutorial to learn how to create custom VM images.
104105

0 commit comments

Comments
 (0)