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

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: 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 .\content\Roles\PhysicalMachines\Tests\BareMetal.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-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation\AllowFreshCredentialsWhenNTLMOnly -Force
    New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation\ -Name AllowFreshCredentialsWhenNTLMOnly -Value 1 -Force
    New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation\AllowFreshCredentialsWhenNTLMOnly\ -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:\CloudDeployment\Setup
$adminpass = ConvertTo-SecureString <Admin Password> -AsPlainText -Force
$aadpass = ConvertTo-SecureString <> -AsPlainText -Force
$aadAdmin = "<aad user>"
$aadTenant = "<aad name>"
$aadcred = New-Object System.Management.Automation.PSCredential ($("$aadAdmin" + '@' + "$aadTenant"), $aadpass)
.\InstallAzureStackPOC.ps1 -AdminPassword $adminpass -InfraAzureDirectoryTenantAdminCredential $aadcred -InfraAzureDirectoryTenantName $aadTenant -NATIPv4Subnet -NATIPv4Address -NATIPv4DefaultGateway
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:\CloudDeployment\Setup
.\InstallAzureStackPOC.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 -PrefixLength 24 -InterfaceIndex $NIC.ifIndex

New-NetNat -Name $swName -InternalIPInterfaceAddressPrefix "" –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!
Comments (0)

Skip to main content