Skip to content

[AzureRT] Sprint 58 update #1986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Mar 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c39e44e
Merge branch 'dev' of https://github.com/Azure/azure-powershell into de
hyonholee Oct 28, 2015
ac1932c
Merge branch 'dev' of https://github.com/hyonholee/azure-powershell i…
hyonholee Mar 15, 2016
7b4f1ca
Update Compute client library to 12.0.0-prelease
hyonholee Mar 16, 2016
8a59316
Merge branch 'de' of https://github.com/hyonholee/azure-powershell in…
hyonholee Mar 16, 2016
6af0ac7
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Mar 19, 2016
aecab47
Fix LicenseType issue when piping to New-AzureRmVM.
hyonholee Mar 21, 2016
8307e2f
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Mar 21, 2016
4166301
Creating branch off hylee's dev branch and incorporating changes for …
moisesac Mar 22, 2016
7cf05cc
Updating help file for Disable encryption cmdlet
moisesac Mar 22, 2016
2a880dd
Merge pull request #2 from moisesac/mocardev
hyonholee Mar 22, 2016
2b18858
Fix forceRerun parameter to accept any string.
hyonholee Mar 23, 2016
ede83f6
Add "EA" value for permission parameter of Set-AzurePlatformVMImage c…
hyonholee Mar 23, 2016
7dbf8b0
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Mar 23, 2016
db9ac37
Updating AzureDiskEncryption extension name and version for Production
moisesac Mar 23, 2016
2399ff7
Merge pull request #3 from moisesac/mocardev
hyonholee Mar 23, 2016
53dc417
Update the default version for BGInfo and VMAccess extension to "2.*"
hyonholee Mar 23, 2016
6df2bce
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Mar 23, 2016
4cbce53
Fixing disable encryption operation when VolumeType is Data
moisesac Mar 23, 2016
893887b
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Mar 23, 2016
ab27ef2
Merge pull request #4 from moisesac/mocardev
hyonholee Mar 23, 2016
ed4a2d8
update network powershell to new api version
deepakswifty Mar 23, 2016
547e0d3
Merge pull request #5 from DeepakRajendranMsft/UpdateNetworkAndCompute
hyonholee Mar 23, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.Compute, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.11.3.0-prerelease\lib\net45\Microsoft.Azure.Management.Compute.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.12.0.1-prerelease\lib\net45\Microsoft.Azure.Management.Compute.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.Network, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.3.3.0-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
<Reference Include="Microsoft.Azure.Management.Network, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.4.1.0-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.Storage, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -923,15 +923,15 @@ function Test-AzureDiskEncryptionExtension
{
# This test should be run in Live mode only not in Playback mode
#Pre-requisites to be filled in before running this test. The AAD app should belong to the directory as the user running the test.
$aadClientID = "";
$aadClientSecret = "";
#Fill in VM admin user and password
$adminUser = "";
$adminPassword = "";

$aadAppName = "detestaadapp";

#Resource group variables
$rgName = "detestrg";
$loc = "South Central US";
$rgName = Get-ComputeTestResourceName;
$loc = Get-ComputeVMLocation;

#Fill in VM admin user and password
$adminUser = "Foo12";
$adminPassword = "BaR@123" + $rgName;

#KeyVault config variables
$vaultName = "detestvault";
Expand All @@ -951,30 +951,54 @@ function Test-AzureDiskEncryptionExtension
$osDiskName = 'osdisk' + $vmName;
$dataDiskName = 'datadisk' + $vmName;
$osDiskCaching = 'ReadWrite';
$extraDataDiskName1 = $dataDiskName + '1';
$extraDataDiskName2 = $dataDiskName + '2';

#Network config variables
$vnetName = "detestvnet";
$subnetName = "detestsubnet";
$publicIpName = 'pubip' + $vmName;
$nicName = 'nic' + $vmName;



#Disk encryption variables
$keyEncryptionAlgorithm = "RSA-OAEP";
$volumeType = "All";

try
{
Login-AzureRmAccount;
# Create new resource group
New-AzureRmResourceGroup -Name $rgname -Location $loc -Force;
# Create new resource group
New-AzureRmResourceGroup -Name $rgName -Location $loc -Force;

#Check if AAD app was already created
$SvcPrincipals = (Get-AzureRmADServicePrincipal -SearchString $aadAppName);
if(-not $SvcPrincipals)
{
# Create a new AD application if not created before
$identifierUri = [string]::Format("http://localhost:8080/{0}", $rgname);
$defaultHomePage = 'http://contoso.com';
$now = [System.DateTime]::Now;
$oneYearFromNow = $now.AddYears(1);
$aadClientSecret = Get-ResourceName;
$ADApp = New-AzureRmADApplication -DisplayName $aadAppName -HomePage $defaultHomePage -IdentifierUris $identifierUri -StartDate $now -EndDate $oneYearFromNow -Password $aadClientSecret;
Assert-NotNull $ADApp;
$servicePrincipal = New-AzureRmADServicePrincipal -ApplicationId $ADApp.ApplicationId;
$SvcPrincipals = (Get-AzureRmADServicePrincipal -SearchString $aadAppName);
# Was AAD app created?
Assert-NotNull $SvcPrincipals;
$aadClientID = $servicePrincipal.ApplicationId;
}
else
{
# Was AAD app already created?
Assert-NotNull $aadClientSecret;
$aadClientID = $SvcPrincipals[0].ApplicationId;
}

# Create new KeyVault
$keyVault = New-AzureRmKeyVault -VaultName $vaultName -ResourceGroupName $rgname -Location $loc -Sku standard;
$keyVault = Get-AzureRmKeyVault -VaultName $vaultName -ResourceGroupName $rgname
#set enabledForDiskEncryption
Write-Host 'Press go to https://resources.azure.com and set enabledForDiskEncryption flag on KeyVault. [ENTER] to continue or [CTRL-C] to abort...'
Read-Host
Set-AzureRmKeyVaultAccessPolicy -VaultName $vaultName -ResourceGroupName $rgname -EnabledForDiskEncryption;
#set permissions to AAD app to write secrets and keys
Set-AzureRmKeyVaultAccessPolicy -VaultName $vaultName -ServicePrincipalName $aadClientID -PermissionsToKeys all -PermissionsToSecrets all
#create a key in KeyVault to use as Kek
Expand Down Expand Up @@ -1019,17 +1043,69 @@ function Test-AzureDiskEncryptionExtension

$p = Set-AzureRmVMOperatingSystem -VM $p -Windows -ComputerName $computerName -Credential $cred -ProvisionVMAgent;
$p = Set-AzureRmVMSourceImage -VM $p -PublisherName $imagePublisher -Offer $imageOffer -Skus $imageSku -Version "latest";



# Virtual Machine
New-AzureRmVM -ResourceGroupName $rgname -Location $loc -VM $p;

#Enable encryption on the VM
Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $rgname -VMName $vmName -AadClientID $aadClientID -AadClientSecret $aadClientSecret -DiskEncryptionKeyVaultUrl $diskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $keyVaultResourceId -KeyEncryptionKeyUrl $keyEncryptionKeyUrl -KeyEncryptionKeyVaultId $keyVaultResourceId -Force;
#Get encryption status
$encryptionStatus = Get-AzureRmVmDiskEncryptionStatus -ResourceGroupName $rgname -VMName $vmName;
#Verify encryption is enabled on OS volume and data volumes
$OsVolumeEncryptionSettings = $encryptionStatus.OsVolumeEncryptionSettings;
Assert-AreEqual $encryptionStatus.OsVolumeEncrypted $true;
Assert-AreEqual $encryptionStatus.DataVolumesEncrypted $true;
#verify diskencryption keyvault url & kek url are not null
Assert-NotNull $OsVolumeEncryptionSettings;
Assert-NotNull $OsVolumeEncryptionSettings.DiskEncryptionKey.SecretUrl;
Assert-NotNull $OsVolumeEncryptionSettings.DiskEncryptionKey.SourceVault;

#Add a couple of data volumes to encrypt them
$p = Add-AzureRmVMDataDisk -VM $p -Name $extraDataDiskName1 -Caching 'ReadOnly' -DiskSizeInGB 2 -Lun 1 -VhdUri $dataDiskVhdUri -CreateOption Empty;
$p = Add-AzureRmVMDataDisk -VM $p -Name $extraDataDiskName2 -Caching 'ReadOnly' -DiskSizeInGB 2 -Lun 1 -VhdUri $dataDiskVhdUri -CreateOption Empty;
#Enable encryption on the VM
Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $rgname -VMName $vmName -AadClientID $aadClientID -AadClientSecret $aadClientSecret -DiskEncryptionKeyVaultUrl $diskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $keyVaultResourceId -KeyEncryptionKeyUrl $keyEncryptionKeyUrl -KeyEncryptionKeyVaultId $keyVaultResourceId -Force;
#Get encryption status
$encryptionStatus = Get-AzureRmVmDiskEncryptionStatus -ResourceGroupName $rgname -VMName $vmName;
#Verify encryption is enabled on OS volume and data volumes
$OsVolumeEncryptionSettings = $encryptionStatus.OsVolumeEncryptionSettings;
Assert-AreEqual $encryptionStatus.OsVolumeEncrypted $true;
Assert-AreEqual $encryptionStatus.DataVolumesEncrypted $true;
#verify diskencryption keyvault url & kek url are not null
Assert-NotNull $OsVolumeEncryptionSettings;
Assert-NotNull $OsVolumeEncryptionSettings.DiskEncryptionKey.SecretUrl;
Assert-NotNull $OsVolumeEncryptionSettings.DiskEncryptionKey.SourceVault;

#Disable encryption on the VM
Disable-AzureRmVMDiskEncryption -ResourceGroupName $rgname -VMName $vmName;
#Get encryption status
$encryptionStatus = Get-AzureRmVmDiskEncryptionStatus -ResourceGroupName $rgname -VMName $p.StorageProfile.OSDisk.Name;
#Verify encryption is disabled on OS volume and data volumes
$OsVolumeEncryptionSettings = $encryptionStatus.OsVolumeEncryptionSettings;
Assert-AreEqual $encryptionStatus.OsVolumeEncrypted $false;
Assert-AreEqual $encryptionStatus.DataVolumesEncrypted $false;

#Remove AzureDiskEncryption extension
Remove-AzureRmVMDiskEncryptionExtension -ResourceGroupName $rgname -VMName $vmName;
#Get encryption status again to make sure it's the same as before when the extension was installed
$encryptionStatus = Get-AzureRmVmDiskEncryptionStatus -ResourceGroupName $rgname -VMName $vmName;
#Verify encryption is disabled on OS volume and data volumes
$OsVolumeEncryptionSettings = $encryptionStatus.OsVolumeEncryptionSettings;
Assert-AreEqual $encryptionStatus.OsVolumeEncrypted $false;
Assert-AreEqual $encryptionStatus.DataVolumesEncrypted $false;

#Enable encryption on the VM
Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $rgname -VMName $vmName -AadClientID $aadClientID -AadClientSecret $aadClientSecret -DiskEncryptionKeyVaultUrl $diskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $keyVaultResourceId -KeyEncryptionKeyUrl $keyEncryptionKeyUrl -KeyEncryptionKeyVaultId $keyVaultResourceId -Force;
#Get encryption status
$encryptionStatus = Get-AzureRmVmDiskEncryptionStatus -ResourceGroupName $rgname -VMName $vmName;
#Verify encryption is enabled on OS volume and data volumes
$OsVolumeEncryptionSettings = $encryptionStatus.OsVolumeEncryptionSettings;
Assert-AreEqual $encryptionStatus.OsVolumeEncrypted $true;
Assert-AreEqual $encryptionStatus.DataVolumesEncrypted $true;
#verify diskencryption keyvault url & kek url are not null
Assert-NotNull $OsVolumeEncryptionSettings;
Assert-NotNull $OsVolumeEncryptionSettings.DiskEncryptionKey.SecretUrl;
Assert-NotNull $OsVolumeEncryptionSettings.DiskEncryptionKey.SourceVault;

#Remove the VM
Remove-AzureRmVm -ResourceGroupName $rgname -Name $vmName -Force;
Expand All @@ -1041,12 +1117,12 @@ function Test-AzureDiskEncryptionExtension
$p = Set-AzureRmVMOSDisk -VM $p -Name $p.StorageProfile.OSDisk.Name -VhdUri $p.StorageProfile.OSDisk.Vhd.Uri -Caching ReadWrite -CreateOption attach -DiskEncryptionKeyUrl $encryptionStatus.OsVolumeEncryptionSettings.DiskEncryptionKey.SecretUrl -DiskEncryptionKeyVaultId $encryptionStatus.OsVolumeEncryptionSettings.DiskEncryptionKey.SourceVault.Id -Windows;

New-AzureRmVM -ResourceGroupName $rgname -Location $loc -VM $p;

}
finally
{
# Cleanup
Remove-AzureRmResourceGroup -Name $rgname -Force;
Clean-ResourceGroup $rgname;
#Remove-AzureRmADApplication -ApplicationObjectId $ADApp.ApplicationId -Force;
}
}

Expand Down Expand Up @@ -1306,7 +1382,10 @@ function Test-VirtualMachineExtensionWithSwitch
# Set extension settings by raw strings
$settingstr = '{"fileUris":[],"commandToExecute":""}';
$protectedsettingstr = '{"storageAccountName":"' + $stoname + '","storageAccountKey":"' + $stokey + '"}';
Set-AzureRmVMExtension -ResourceGroupName $rgname -Location $loc -VMName $vmname -Name $extname -Publisher $publisher -ExtensionType $exttype -TypeHandlerVersion $extver -SettingString $settingstr -ProtectedSettingString $protectedsettingstr -DisableAutoUpgradeMinorVersion -ForceRerun
Set-AzureRmVMExtension -ResourceGroupName $rgname -Location $loc -VMName $vmname `
-Name $extname -Publisher $publisher `
-ExtensionType $exttype -TypeHandlerVersion $extver -SettingString $settingstr -ProtectedSettingString $protectedsettingstr `
-DisableAutoUpgradeMinorVersion -ForceRerun "RerunExtension";

# Get VM Extension
$ext = Get-AzureRmVMExtension -ResourceGroupName $rgname -VMName $vmname -Name $extname;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ function Test-VirtualMachineProfile
Assert-AreEqual $timeZone $p.OSProfile.WindowsConfiguration.TimeZone;

# Verify Additional Unattend Content
Assert-AreEqual "Microsoft-Windows-Shell-Setup" $p.OSProfile.WindowsConfiguration.AdditionalUnattendContent[0].ComponentName;
#Assert-AreEqual "Microsoft-Windows-Shell-Setup" $p.OSProfile.WindowsConfiguration.AdditionalUnattendContent[0].ComponentName;
Assert-AreEqual $aucContent $p.OSProfile.WindowsConfiguration.AdditionalUnattendContent[0].Content;
Assert-AreEqual "oobeSystem" $p.OSProfile.WindowsConfiguration.AdditionalUnattendContent[0].PassName;
Assert-AreEqual $aucSetting $p.OSProfile.WindowsConfiguration.AdditionalUnattendContent[0].SettingName;
Assert-AreEqual "Microsoft-Windows-Shell-Setup" $p.OSProfile.WindowsConfiguration.AdditionalUnattendContent[1].ComponentName;
#Assert-AreEqual "Microsoft-Windows-Shell-Setup" $p.OSProfile.WindowsConfiguration.AdditionalUnattendContent[1].ComponentName;
Assert-AreEqual $aucContent $p.OSProfile.WindowsConfiguration.AdditionalUnattendContent[1].Content;
Assert-AreEqual "oobeSystem" $p.OSProfile.WindowsConfiguration.AdditionalUnattendContent[1].PassName;
Assert-AreEqual $aucSetting $p.OSProfile.WindowsConfiguration.AdditionalUnattendContent[1].SettingName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,6 @@ function Test-VirtualMachinePiping
# VM Profile & Hardware
$vmsize = 'Standard_A4';
$vmname = 'vm' + $rgname;
$p = New-AzureRmVMConfig -VMName $vmname -VMSize $vmsize;
Assert-AreEqual $p.HardwareProfile.VmSize $vmsize;

# NRP
$subnet = New-AzureRmVirtualNetworkSubnetConfig -Name ('subnet' + $rgname) -AddressPrefix "10.0.0.0/24";
Expand All @@ -252,16 +250,6 @@ function Test-VirtualMachinePiping
$nic = Get-AzureRmNetworkInterface -Name ('nic' + $rgname) -ResourceGroupName $rgname;
$nicId = $nic.Id;

$p = Add-AzureRmVMNetworkInterface -VM $p -Id $nicId;
Assert-AreEqual $p.NetworkProfile.NetworkInterfaces.Count 1;
Assert-AreEqual $p.NetworkProfile.NetworkInterfaces[0].Id $nicId;

# Adding the same Nic but not set it Primary
$p = Add-AzureRmVMNetworkInterface -VM $p -Id $nicId -Primary;
Assert-AreEqual $p.NetworkProfile.NetworkInterfaces.Count 1;
Assert-AreEqual $p.NetworkProfile.NetworkInterfaces[0].Id $nicId;
Assert-AreEqual $p.NetworkProfile.NetworkInterfaces[0].Primary $true;

# Storage Account (SA)
$stoname = 'sto' + $rgname;
$stotype = 'Standard_GRS';
Expand All @@ -275,23 +263,6 @@ function Test-VirtualMachinePiping
$dataDiskVhdUri2 = "https://$stoname.blob.core.windows.net/test/data2.vhd";
$dataDiskVhdUri3 = "https://$stoname.blob.core.windows.net/test/data3.vhd";

$p = Set-AzureRmVMOSDisk -VM $p -Name $osDiskName -VhdUri $osDiskVhdUri -Caching $osDiskCaching -CreateOption FromImage;
$p = Add-AzureRmVMDataDisk -VM $p -Name 'testDataDisk1' -Caching 'ReadOnly' -DiskSizeInGB 10 -Lun 1 -VhdUri $dataDiskVhdUri1 -CreateOption Empty;
$p = Add-AzureRmVMDataDisk -VM $p -Name 'testDataDisk2' -Caching 'ReadOnly' -DiskSizeInGB 11 -Lun 2 -VhdUri $dataDiskVhdUri2 -CreateOption Empty;

Assert-AreEqual $p.StorageProfile.OSDisk.Caching $osDiskCaching;
Assert-AreEqual $p.StorageProfile.OSDisk.Name $osDiskName;
Assert-AreEqual $p.StorageProfile.OSDisk.Vhd.Uri $osDiskVhdUri;
Assert-AreEqual $p.StorageProfile.DataDisks.Count 2;
Assert-AreEqual $p.StorageProfile.DataDisks[0].Caching 'ReadOnly';
Assert-AreEqual $p.StorageProfile.DataDisks[0].DiskSizeGB 10;
Assert-AreEqual $p.StorageProfile.DataDisks[0].Lun 1;
Assert-AreEqual $p.StorageProfile.DataDisks[0].Vhd.Uri $dataDiskVhdUri1;
Assert-AreEqual $p.StorageProfile.DataDisks[1].Caching 'ReadOnly';
Assert-AreEqual $p.StorageProfile.DataDisks[1].DiskSizeGB 11;
Assert-AreEqual $p.StorageProfile.DataDisks[1].Lun 2;
Assert-AreEqual $p.StorageProfile.DataDisks[1].Vhd.Uri $dataDiskVhdUri2;

# OS & Image
$user = "Foo12";
$password = 'BaR@123' + $rgname;
Expand All @@ -300,23 +271,15 @@ function Test-VirtualMachinePiping
$computerName = 'test';
$vhdContainer = "https://$stoname.blob.core.windows.net/test";

$p = Set-AzureRmVMOperatingSystem -VM $p -Windows -ComputerName $computerName -Credential $cred;
$p = New-AzureRmVMConfig -VMName $vmname -VMSize $vmsize `
| Add-AzureRmVMNetworkInterface -Id $nicId -Primary `
| Set-AzureRmVMOSDisk -Name $osDiskName -VhdUri $osDiskVhdUri -Caching $osDiskCaching -CreateOption FromImage `
| Add-AzureRmVMDataDisk -Name 'testDataDisk1' -Caching 'ReadOnly' -DiskSizeInGB 10 -Lun 1 -VhdUri $dataDiskVhdUri1 -CreateOption Empty `
| Add-AzureRmVMDataDisk -Name 'testDataDisk2' -Caching 'ReadOnly' -DiskSizeInGB 11 -Lun 2 -VhdUri $dataDiskVhdUri2 -CreateOption Empty `
| Set-AzureRmVMOperatingSystem -Windows -ComputerName $computerName -Credential $cred;

$imgRef = Get-DefaultCRPImage -loc $loc;
$p = ($imgRef | Set-AzureRmVMSourceImage -VM $p);

Assert-AreEqual $p.OSProfile.AdminUsername $user;
Assert-AreEqual $p.OSProfile.ComputerName $computerName;
Assert-AreEqual $p.OSProfile.AdminPassword $password;

Assert-AreEqual $p.StorageProfile.ImageReference.Offer $imgRef.Offer;
Assert-AreEqual $p.StorageProfile.ImageReference.Publisher $imgRef.PublisherName;
Assert-AreEqual $p.StorageProfile.ImageReference.Sku $imgRef.Skus;
Assert-AreEqual $p.StorageProfile.ImageReference.Version $imgRef.Version;

# Virtual Machine
# TODO: Still need to do retry for New-AzureRmVM for SA, even it's returned in Get-.
New-AzureRmVM -ResourceGroupName $rgname -Location $loc -VM $p;
$imgRef | Set-AzureRmVMSourceImage -VM $p | New-AzureRmVM -ResourceGroupName $rgname -Location $loc;

# Get VM
$vm1 = Get-AzureRmVM -Name $vmname -ResourceGroupName $rgname;
Expand Down
Loading