RSS

Azure RemoteApp template image creation: make sure ALL requirements are met

21 Aug

Building your Azure RemoteApp template images is quite a straightforward operation. You can create your image .vhd on-premises or you can use the Windows Server 2012 R2 Session Host from the Azure Gallery. The latter contains a complete script to check if all requirements are met before shutting down the VM with Sysprep (but doesn’t facilitate the requirement mentioned in this post).

Fortunately, Microsoft was nice to provide an overview with the requirements which must be met to prepare your template image(s) which is available at the following location:

https://azure.microsoft.com/en-us/documentation/articles/remoteapp-imagereqs

Unfortunately, one requirement is missing which will cause the image upload process to fail. Before creating a generalized .vhd with Sysprep the file %SYSTEMDRIVE%\Windows\Panther\unattend.xml needs to be removed.

You can see in the Upload-AzureRemoteAppTemplateImage.ps1 file downloaded from Azure that the presence of this file is checked before the actual upload.

Below is the relevant part of the script that does this checking:

# verify unattend file locations

if(Test-Path -LiteralPath ($winVolume + “windows\Panther\Unattend\Unattend.xml”) -PathType Leaf)

{

Write-Error ($CurrentCultureTable[$UnattendFileError] + $winDrive\windows\Panther\Unattend\Unattend.xml.”)

$validImage = $false

}

if(Test-Path -LiteralPath ($winVolume + “windows\Panther\Unattend\Autounattend.xml”) -PathType Leaf)

{

Write-Error ($CurrentCultureTable[$UnattendFileError] + $winDrive\windows\Panther\Unattend\Autounattend.xml.”)

$validImage = $false

}

if(Test-Path -LiteralPath ($winVolume + “windows\Panther\Unattend.xml”) -PathType Leaf)

{

Write-Error ($CurrentCultureTable[$UnattendFileError] + $winDrive\windows\Panther\Unattend.xml.”)

$validImage = $false

}

if(Test-Path -LiteralPath ($winVolume + “windows\Panther\Autounattend.xml”) -PathType Leaf)

{

Write-Error ($CurrentCultureTable[$UnattendFileError] + $winDrive\windows\Panther\Autounattend.xml.”)

$validImage = $false

}

if(Test-Path -LiteralPath ($winVolume + “Unattend.xml”) -PathType Leaf)

{

Write-Error ($CurrentCultureTable[$UnattendFileError] + ” Found: $winDrive\Unattend.xml.”)

$validImage = $false

}

if(Test-Path -LiteralPath ($winVolume + “Autounattend.xml”) -PathType Leaf)

{

Write-Error ($CurrentCultureTable[$UnattendFileError] + $winDrive\Autounattend.xml.”)

$validImage = $false

}

 

 

Too bad that Microsoft forgot to mention this in the requirements overview…

 

 

 
 

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
Steve Thompson [MVP]

The automation specialist

Boudewijn Plomp

Cloud and related stuff...

Anything about IT

by Alex Verboon

MDTGuy.WordPress.com

Deployment Made Simple

Modern Workplace

The secret of smart working unveiled...

Daan Weda

This WordPress.com site is all about System Center and PowerShell

Abheek Speaks

My Views on Technology and Non Technical Issues

Heading To The Clouds

by Marthijn van Rheenen