Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Login into Microsoft Azure
- add-azureaccount
- #Create a new storage account, if not already having one
- $storageAccountName = "qastoragenortheurope"
- $storageAccountLocation = "north europe"
- $storageAccountType = "Standard_LRS"
- New-AzureStorageAccount -StorageAccountName $storageAccountName `
- -Location $storageAccountLocation `
- -Type $storageAccountType
- #Set default storage account for current azure subscription
- Set-AzureSubscription -SubscriptionId <your subscription id> `
- -CurrentStorageAccountName "qastoragenortheurope"
- #create quick azure vm
- $adminUser = "itadmin"
- $password = "itadmin@123"
- $serviceName = "metavrsewebqa"
- $location = "north europe"
- $size = "Small"
- $vmName = "metavrse-web-01"
- $imageFamily = "Windows Server 2012 R2 Datacenter"
- $imageName = Get-AzureVMImage |
- where { $_.ImageFamily -eq $imageFamily } |
- sort PublishedDate -Descending |
- select -ExpandProperty ImageName -First 1
- New-AzureQuickVM -Windows `
- -ServiceName $serviceName `
- -Name $vmName `
- -ImageName $imageName `
- -AdminUsername $adminUser `
- -Password $password `
- -InstanceSize $size
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement