In this blog post I will show you how to create an Azure RemoteApp custom template using a Virtual Machine (VM) in the Azure portal.

Microsoft has provided a VM image in Azure, already configured with “Remote Desktop Session Host”, which is an excellent base image to use for an Azure RemoteApp collection.


  • Create an Azure Account.
  • Create a Virtual Machine running Microsoft Windows.
  • Install and configure your apps.
  • Prepare and Sysprep the image.
  • Add your image to the template image library.

When you start your project and while following this guide, please ensure that all Azure resources you create, are located in the same region; most importantly of all, the template image and the Azure RemoteApp collection.


  • Create an Azure Account

Azure portal

  • Create a Virtual Machine running Windows.

Create an Azure Virtual Machine running Windows, using the “Windows Server Remote Desktop Session Host” image. This image contains the necessary “Remote Desktop Session Host” role and all the settings needed to host RemoteApp programs.

There are two Azure portals available, the NEW Azure ARM and the most common one Windows Azure Classic . For the purpose of this blog, I am usingWindows Azure Classic“. I wanted to make it easy to understand and set up the template without going through the new features and explaining the differences between the two.

Please use this link if you wish to explore the new Azure preview portal.

Log in to the Azure management portal and Click New > Compute > Virtual Machine > From Gallery.








Select Windows Server > Windows Server Remote Desktop Session Host.

First part of selecting the template is done. Now you will have to configure the remaining settings. To do so, please follow this link “Create an Azure virtual machine running windows

Once the creation of the VM is completed. You can now connect to the VM to install and configure your applications. Logon on to an Azure VM .

First time you connect; a quick message (might come up) “RDSH is not configured”. This is normal and you do not need to worry about. The image will look the same as the usual server 2012 R2 interface, but you won’t see server manager starting on start up.

If you open “Program and Features” in the control panel, you will see Silver Light and System Centre 2012 Endpoint protection installed along with the necessary windows updates and patches to make the image up to date.


Upload the application installation files. To do so, you can copy and paste the files directly to the VM (this is the simplest). Another way is to connect to the VM directly.

  • Sign in to Azure Portal
  • Click Virtual Machines and then select the appropriate VM.
  • On the command bar below, click “Connect”


This will prompt you to open or save an RDP file that will allow a remote connection to the VM. Select save as and save the RDP file to your local machine. Right-click on it and select the “EDIT” option to Edit the RDP files’ settings. Select the Local Resources tab and then click the More.. button.


The Local devices and resource window appears


Expand the “Drives” node to reveal a list of local drives that can be selected to use with the Azure VM. Check the drives you want use then click OK to close the window and then click on the Connect button to launch an RDP session to your Azure VM. Once the RDP connection has opened, use File Explorer to open the local drive. At this point you can drag and drop files between your local drives and the drives on the Azure VM.

Install and configure your applications. Please see best practices  to install and configure your apps.


Once you finish installing the applications and configuring your image, it is time to validate and Sysprep the image. One very important adding to this image is the PowerShell command line to validate all the pre-requisites for Azure RemoteApp. Ensuring all errors (if any) are fixed before proceeding to the image SysPrep preparation steps. On the VMs’ desktop, right click on “ValidateRemoteAppImage” shortcut and then select “Run as administrator”.


Will take couple of minutes. Once is ready, you will see a command prompt starting with all the necessary information about your image.


You will be prompted to press yes if all went well and you will get a warning that if you press yes SysPrep will start automatically. If you get prompted this is fine you can skip the steps below to start a SysPrep manually.

Running SysPrep manually Open a command prompt window as an administrator


Change the directory to “c:\windows\System32\Sysprep” and then run sysprep.exe

The System Preparation Tool dialog box appears. Select Enter System Out-of-Box Experience (OOBE) and make sure that Generalize is checked. In Shutdown Options, select Shutdown and then click OK.


SysPrep Windo will appear and starts working.  Couple of minutes and Sysprep shuts down the virtual machine, which changes the status of the virtual machine in the Management Portal to Stopped. In the Azure management portal, click on “Virtual Machines”, select the VM you want to capture (the one you just SysPreped) and then click on the “Capture” button.


The “Capture the Virtual machine” dialog appears. Fill the information required, then select “I have run Sysprep on the virtual machine” and then hit the check mark.


The capture action, will delete the VM from the management portal. But it keeps a copy of the VM VHD (Virtual Hard Disk) for later use. Still in the same screen but under “IMAGES”, the new image is now available.



Go to the Template Images tab under the RemoteApp extension in Azure Management Portal. Click on “UPLOAD OR IMPORT A TEMPLATE IMAGE” link. If you have another image already uploaded, the link won’t be visible, instead you will see a list of images.


If you have another image already uploaded, you can just select the + ADD sign shown on the bottom of your page.


Select “Import an image from your Virtual Machines library”


Select the customised image from the drop down (the image will be selected automatically if you only have one in the list) and then confirm that you have followed the steps listed below to create your image.


Provide name and location for the RemoteApp template image (Make sure that the image is in the same region as your RemoteApp collection) and then hit the check mark.


At this stage the upload starts and the status of your uploaded image will change to “Upload pending”. The upload time will depend on the network speed and datacentre location. It can take up to 45 minutes max. Once is done, the image status will change to “Ready”.



Notice above the image is uploaded but not linked yet (LINKED COLLECTIONS is 0).


After the template upload is completed, navigate to RemoteApp link in Azure Portal, select NEW and then QUICK CREATE.

Optionally we can select CREATE WITH VPN which will use a VPN connection to Azure if data and files are needed by apps from an on premises data centre.

Add a name, select a region (MAKE SURE IT IS THE SAME REGION AS THE ONE YOU USED TO UPLOAD YOUR IMAGE), and choose the image uploaded in the previous steps and then complete this stage by selecting the check mark.


Will take up to 30 minutes max to provision a new RemoteApp collection.




Leave a Reply