Advertisement
Guest User

Untitled

a guest
Jan 2nd, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. #Login into Microsoft Azure
  2. add-azureaccount
  3.  
  4. #Create a new storage account, if not already having one
  5. $storageAccountName = "qastoragenortheurope"
  6. $storageAccountLocation = "north europe"
  7. $storageAccountType = "Standard_LRS"
  8. New-AzureStorageAccount -StorageAccountName $storageAccountName `
  9. -Location $storageAccountLocation `
  10. -Type $storageAccountType
  11.  
  12. #Set default storage account for current azure subscription
  13. Set-AzureSubscription -SubscriptionId <your subscription id> `
  14. -CurrentStorageAccountName "qastoragenortheurope"
  15.  
  16. #create quick azure vm
  17. $adminUser = "itadmin"
  18. $password = "itadmin@123"
  19. $serviceName = "metavrsewebqa"
  20. $location = "north europe"
  21. $size = "Small"
  22. $vmName = "metavrse-web-01"
  23. $imageFamily = "Windows Server 2012 R2 Datacenter"
  24. $imageName = Get-AzureVMImage |
  25. where { $_.ImageFamily -eq $imageFamily } |
  26. sort PublishedDate -Descending |
  27. select -ExpandProperty ImageName -First 1
  28.  
  29. New-AzureQuickVM -Windows `
  30. -ServiceName $serviceName `
  31. -Name $vmName `
  32. -ImageName $imageName `
  33. -AdminUsername $adminUser `
  34. -Password $password `
  35. -InstanceSize $size
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement