Prepare Azure VM using ARM Template to deploy AzureStack Development KIT (ASDK) for PoC

By Yagmur Sahin

I was recently working to build up AzureStack PoC on Azure VM.

Found those posts helped me a lot. Thanks for the Authors.

Thought that if there is an ARM template that builds up the PoC infra is a good idea. So here we are, let me summarize what this template does.
  • Creates an Azure VM with 256GB OS disk and 4 x 128GB data disks with 64GB additional disk for downloads all as Managed disk and on Azure Premium Storage.
  • Post script using custom script extension to configure some setup prerequisites.
    • Install Hyper-v Failover Cluster, IIS and tools, and AD powershell and tools.
    • Installs latest Nuget Package provider.
    • Some CredSSP settings
    • Renames local admin back to Administrator
    • Restart computer

Please aware that this is not intended to be for production use. Just to test and evaluate.

Feel free to post questions and ideas.
Here is github repo link for the ARM Template
Here are my quick notes that might help.
** Template take care of this step.
Create new Azure VM using this template
**Set VM’s disk size to 256GB
**Add 4x128GB disk premium storage
**Add additional disk 64GB to store downloads
RDP to Azure VM
Download and extract Azure Stack Development Kit: https://azure.microsoft.com/en-us/overview/azure-stack/development-kit/ to 64GB disk
**Install Hyper-v, Failover Cluster and Web Server including Management tools and NuGet Package provider on Azure VM, run following commands
Add-WindowsFeature Hyper-V, Failover-Clustering, Web-Server -IncludeManagementTools
Add-WindowsFeature RSAT-AD-PowerShell, RSAT-ADDS -IncludeAllSubFeature
Install-PackageProvider nuget –Verbose
Restart the VM
Mount cloudBuilder.vhdx from 64GB disk
Copy CloudDeployment, fwupdate and tools folder from mounted volume to root of C: drive
Find Microsoft.AzureStack.Solution.Deploy.CloudDeployment.1.0.522.0.nupkg file and change file extension to zip open and find .contentRolesPhysicalMachinesTestsBareMetal.Tests.ps1 and edit. Find $isVirtualizedDeployment and remove -not in the is statement (check all if statement there will be 3 of them) save zip file and change file extension back to nupkg.
**Run following to allow CredSSP
New-ItemProperty -Path HKLM:SOFTWAREPoliciesMicrosoftWindowsCredentialsDelegation -Name AllowFreshCredentialsWhenNTLMOnly -Value 1 -Force
New-ItemProperty -Path HKLM:SOFTWAREPoliciesMicrosoftWindowsCredentialsDelegationAllowFreshCredentialsWhenNTLMOnly -Name 1 -Value ‘WSMAN/*’ -Force
Create Azure AD tenant and Admin user with Global Administrator permission
Run setup using following (Complete information according to your environment)
#Using Azure AAD
cd C:CloudDeploymentSetup
$adminpass = ConvertTo-SecureString -AsPlainText -Force
$aadpass = ConvertTo-SecureString -AsPlainText -Force
$aadAdmin = “”
$aadTenant = “.onmicrosoft.com”
$aadcred = New-Object System.Management.Automation.PSCredential ($(“$aadAdmin” + ‘@’ + “$aadTenant”), $aadpass)
.InstallAzureStackPOC.ps1 -AdminPassword $adminpass -InfraAzureDirectoryTenantAdminCredential $aadcred -InfraAzureDirectoryTenantName $aadTenant -NATIPv4Subnet 172.16.0.0/24 -NATIPv4Address 172.16.0.2 -NATIPv4DefaultGateway 172.16.0.1
Follow the setup progress and Enable Time zone sync from Hyper-V integration components for AzS-ACS01 once the machine deployed if there is time zone difference between Hyper-v server and AzS-ACS01
Once the Host joined to the domain, Logon to Host using AzureStackAdmin and run following command to continue setup, if setup fails make sure that all previous steps are done.
cd C:CloudDeploymentSetup
.InstallAzureStack.ps1 -Rerun -Verbose
Follow the setup progress once AzS-BGPNAT01 machine deployed change the NAT adapter virtual switch from PublicSwitch to NatSwitch by running following command

$swName = “NATSwitch”

New-VMSwitch -Name $swName -SwitchType Internal -Verbose

$NIC=Get-NetAdapter “vEthernet `($swName`)”

New-NetIPAddress -IPAddress 172.16.0.1 -PrefixLength 24 -InterfaceIndex $NIC.ifIndex

New-NetNat -Name $swName -InternalIPInterfaceAddressPrefix “172.16.0.0/24” –Verbose

Get-VM -Name AzS-BGPNAT01 | Get-VMNetworkAdapter -Name NAT | Connect-VMNetworkAdapter -SwitchName $swName

Once the installation completed open https://portal.local.azurestack.external/ from the host.

If you face any issues, troubleshoot the issue and re-run setup using “.InstallAzureStack.ps1 -Rerun -Verbose”
Hope this help, enjoy!

Source:: Technet2

0 comments on “Prepare Azure VM using ARM Template to deploy AzureStack Development KIT (ASDK) for PoCAdd yours →

Leave a Reply