My current script to create vm in ARM or classic mode does not work; I get an error: New-AzureVM : ResourceNotFound: The hosted service does not exist.
can someone please share the powershell script to create new VM in AzureGovernment subscription? my script:
Set-AzureEnvironment "AzureGovernment"
New-AzureVMConfig -Name "test1" -InstanceSize "Standard_D14" `
-ImageName "myimage" |
Add-AzureProvisioningConfig –Linux `
–LinuxUser "myuser" -Password "mypwd" |
New-AzureVM –ServiceName "myservice"
I am able to create a new VM using Azure portal, but fail with powershell