Thursday, June 1, 2017

Install .NET Framework 3.5 on Azure VM

Older applications often require .NET Framework 3.5. The images available in the Azure Gallery of Windows Server 2012 and Windows Server 2016 don't include this piece of software which can be quite frustrating at times. Typically in order to install this piece of software you need to mount the iso or image of the operating system and add the role using the image as source.

Luckily Microsoft have decided to include the source files in the gallery images. The files are located in the following location c:\windows\sxs\.

Now how do i install .NET Framework 3.5?

Well there are a few options, the simplest is through Add or Remove Roles or through PowerShell. In this article I will demonstrate how to install it using PowerShell.

The command to run in PowerShell is:

Install-WindowsFeature Net-Framework-Core -source c:\windows\sxs

The steps:

1. Open PowerShell in the administrative context

Open PowerShell and run the command

2. Watch the installation progress. (takes approx. 30 seconds)

Track the progress
 3. Installation feedback confirms the success.

.NET Framework 3.5 install completed

Friday, March 17, 2017

Finding images in Azure

Microsoft Azure has lots of images available through the marketplace. All of them can be deployed through PowerShell but how do you actually select the right version.

An easy way to do this is by running the following little script. It will query the available images based on the location that you select. Use the box in the prompt to search for the publisher, or version that you are after. It will provide a clear output of the available templates and version. Super simple.



#Logon to Azure
#Select your location
$loc = Get-AzureRmLocation | OGV -passthru | select Location
#View the templates available
$publisher=Get-AzureRmVMImagePublisher -Location $loc.Location |OGV -passthru | select publishername #check all the publishers available
$offer=Get-AzureRmVMImageOffer -Location $loc.Location -PublisherName $publisher.PublisherName|OGV -passthru |select offer #look for offers for a publisher
$sku=Get-AzureRmVMImageSku -Location $loc.Location -PublisherName $publisher.PublisherName -Offer $offer.Offer | OGV -passthru |select skus #view SKUs for an offer
Get-AzureRmVMImage -Location $loc.Location -PublisherName $publisher.PublisherName -Offer $offer.Offer -Skus $sku.Skus #Pick one

How does it work?

1. Select the Location you are planning to deploy your virtual machine.

2. Select the Publisher

3. Select the Offer

4. Select the Sku.

5. Review the output and use this in your deployment.