In some other post I have written how you can deploy a Nano Server on premise using PowerShell or the Nano Server Image Builder. In this post I will quickly show you how you can setup a new Nano Server in Microsoft Azure.
To deploy Nano Server in Azure, Microsoft offers you a Nano Server Image in the Marketplace.
Using the Azure Portal to deploy Nano Server on Microsoft Azure
There are also several ways you can deploy Nano Server, for example using the Azure Portal or PowerShell. First this will show you how you can create a Nano Server Virtual Machine using the Azure Portal.
Simply follow the steps to create a new Azure Virtual Machine.
The most important part is to configure the Network Security Groups to allow PowerShell Remoting since Nano Server does not support RDP. There are two options to do this, using WinRM over http (5985) or using WinRM using https (5986). To be honest in production you should only use https, but for some demos or if you are configuring Nano Server to be used over a VPN you can also use WinRM over http. I also recommend that you remove the RDP port rule, since this is not really necessary. If the WinRM rule in the network security group is not already there, just create it. For easy setup you can use 5985 if you want to use SSL you will require additional steps.
Follow the rest of the wizard to deploy the new Nano Server VM. After the VM is created you will see it in the Azure Portal. You can now use the IP address to connect to the virtual machine using PowerShell remoting. If you don’t have a VPN connection to the Azure VM Network you will need to use the public IP address, if it is connected trough a VPN or from another machine running in the same VM Network, you can use the internal IP address. In my demo case I am using the public IP address to connect to the virtual machine. To make it easier I also created a Public DNS name for this Azure IP address.
To connect to your Nano Server you also have to setup PowerShell Remoting on your machine and add the host to your trusted hosts group.
You can now connect to your Nano Server running in Azure.
Enter-PSSession -ComputerName tomsnano02.westeurope.cloudapp.azure.com -Credential ~\ThomasMaurer
Using the Azure PowerShell module to deploy Nano Server on Microsoft Azure
First you have to install the Azure PowerShell Module and get the NanoServerAzureHelper PowerShell Module (NanoServerAzureHelper_20160927) this will help you with the setup.
Time to fire up PowerShell and login to Azure
Login-AzureRmAccount
First create a new Azure Resource Group and a Key Vault if you don’t have them already available. The key vault will be helping you to use SSL configuration for your PowerShell remoting.
New-AzureRmResourceGroup -Name “NanoServerAzurePS” -Location "West Europe" New-AzureRmKeyVault -VaultName “NanoServerAzurePSVault” -ResourceGroupName “NanoServerAzurePS” -Location "West Europe" -EnabledForDeployment
Import the NanoServerAzureHelper PowerShell module which you have downloaded before.
Import-Module .\PowerShell\NanoServerAzureHelper_20160927\NanoServerAzureHelper.psm1 -Verbose
This will give you some new PowerShell cmdlets to deploy Nano Server quickly on Azure.
The most important for creating new Nano Server VMs in Azure is simply the New-NanoServerAzureVM.
Create a new Nano Server VM in Azure using the following PowerShell command:
New-NanoServerAzureVM -Location "West Europe" –VMName "tm01-nanops" -AdminUsername "ThomasMaurer" -VaultName "NanoServerAzurePSVault" -ResourceGroupName "NanoServerAzurePS" -Verbose
To connect you can get the public IP address for the system you deployed and connect to it
Get-AzureRmPublicIpAddress -ResourceGroupName "NanoServerAzurePS" Enter-PSSession -ConnectionUri "https://tm01-nanops.westeurope.cloudapp.azure.com:5986/WSMAN" -Credential "~\ThomasMaurer"
Using PowerShell Package Management to Install Roles and Features on Nano Server
Since in Nano Server does not include any roles per default you can now use PowerShell Package Management to installed Nano Server Packages on your Azure Virtual Machine.
If you want to know more about PowerShell Package Management on Nano Server, check out my blog post. If you want to know more about Nano Server in general check this post here: Nano Server – The future of Windows Server – Just enough OS
Tags: Azure, Microsoft, Microsoft Azure, Nano Server, PowerShell, Remoting, Virtual Machine, VM, Windows Server, Windows Server 2016 Last modified: June 26, 2019
Thanks for the info. Quick question – how would I get access to the EMS on a Nano instance hosted in Azure? I know the EMS has a console option for resetting WinRM (for instance) but with no console access in Azure how can I reset that if needed?
Yes this is true, if you run in azure you have no access to the Nano Server Recovery console. You would need to use the VM agent for this. I have not tried it yet :)
Hello,
I came across this article while searching how to deploy Nano Server on Azure. I know it’s an old one but I cannot find a more targeted article.
I try to deploy Nano Server on my MPN Azure subscription but I get an error. The same error appears both on portal and on PowerShell. It seems that the image is missing. Indeed, when I run the following cmdlet I get an empty result, which is an indication that although the image is advertised, it is not actually available.
Get-AzureRmVMImage -Location “west europe” -PublisherName MicrosoftWindowsServer -Offer WindowsServer -Skus 2016-Nano-Server
I opened a ticket on Azure and I got the reply that Nano Server is in preview. Is it true? How can it be in preview since 2016?? Am I missing something?
Hi Microsoft stopped supporting Nano Server as a full operating system and only supports it as a Container Image.
This means you should only deploy Windows Server Core or Windows Server with Desktop Experience.