AZ-140 Azure Virtual Desktop lab trouble?

There’s nothing more frustrating when trying to learn a new subject than being unable to complete the examples successfully. They are literally spelled out for you, they should just work, right? When I hit a problem like this it’s usually because I’ve overlooked something, perhaps skipped ahead or was interrupted and missed a key step. Occasionally though it turns out that it’s not my fault!

If you’re working through the Microsoft Learn modules for AZ-140 (AVD) might find that some of the lab examples don’t work. This appears to be due to the example code not keeping pace with the rapid rate of change in Azure.

Create an Azure Virtual Desktop image by using VM Image Builder

This unit (link )is the first practical example in the module Create and manage session host image for Azure Virtual Desktop, itself the third module in Implement an Azure Virtual Desktop infrastructure, in the recommended learning path.

When trying to create the session host image the provided code fails with an error “Platform image not found.”. It seems unable to locate the VM image SKU 20h1 for provider MicrosoftVirtualDesktop in location uksouth. Checking with Get-AzVMImageSku and it looks like it’s valid, but when you attempt the deployment it fails every time.

Get-AzVMImageSku -Location uksouth -PublisherName MicrosoftWindowsDesktop -Offer Windows-10
Red text is never a good sign.

Working around the problem

Simply updating the armTemplateWVD.json template file to use a different SKU (eg. replace 20h1 with 21h1) seems to get over this issue. This file is downloaded from GitHub as part of the example code, so if should be in the current working directory. To be sure, check the value of $templateFilePath.

The location of the json template is held in a variable.

It isn’t clear if it’s case sensitive but the “Windows-10” offer is the only offer with a has a capital letter and the example code does not capitalise it so it’s worth updating that while we’re here too. Don’t forget to save the file.

VSCode is nice, isn’t it?

If you’ve hit this problem, you will also find that future attempts will also not work because the failed template still exists and is stopping you from redeploying, so you have to go and delete that failed template before trying again. This can be achieved easily in the portal.

More red text.

Re-trying the New-AzResourceGroupDeployment should now complete and you can continue on to building the image and creating a VM.

That took far longer than it should have.

Conclusion

If you’re planning to implement AVD in your organisation, or take the exam once you’ve completed the Microsoft Learn modules then being able to successfully complete the labs is going to ensure you’re better prepared. Good luck!

About the author