Pre-requisites
The following prerequisites must be met, before performing the Core capacity check steps.
- Internet connection
- Valid Azure Subscription
- The person who will perform the below steps must have one of the following roles in the Azure subscription
- Owner
- Contributor
- Some familiarity with the Azure Portal would be beneficial, although not necessary
- Latest version of Microsoft .NET Framework (download link)
- Latest version of Microsoft Windows Management Framework (download link)
- Latest version of Microsoft PowerShell (download link including detailed installation guide)
- Latest version of Azure cmdlets (installation guide), although steps are provided below
- Some familiarity with PowerShell ISE, although not necessary (documentation)
- Some familiarity with the Azure Portal would be beneficial, although not necessary
- Some familiarity with PowerShell scripting would be beneficial, although not necessary
- OS level Steps
- Go to sysprep folder (C:\windows\system32\sysprep) and setup manager

- Follow the steps given below –


- Select Fully automate the installation

- Click on browse and select file type as inf
File with .INF extension will already be present in the sysprep folder

- Click on next till you Reach this screen (don’t change anything) –
















- Setup in now completed. Press cancel now

For 64 bit open sysprep.INF file and modify 4th line replace I386 with amd64

- Go C:\sysprep and make the same changes as above for 64 bit

- Right click on the task bar and go properties –
Then go to customize and advance
In advance click on clear list


- Go to sysprep.exe and click Reseal

- Run the below script to commands to capture Image from sysprep VM
$vmname="Vmname" Login-AzureRmAccount Set-AzureRmContext -SubscriptionId "Sunscription ID" Stop-AzureRmVM -ResourceGroupName 'RGName' -Name $vmname Set-AzureRmVm -ResourceGroupName 'RGName' -Name $vmname -Generalized Save-AzureRmVMImage -ResourceGroupName 'RGName' -VMName $vmname -DestinationContainerName mytemplates -VHDNamePrefix template -Path c:\test\$VMname.json
Note- VHD will be in captured in Same storage account as VM under myTemplates Container
