I'm sure I've done something stupid, but I can't figure out what. Here's the situation.
I need to be able to create VMs from within a Virtual Network in order to have the ability to connect to these VMs as an Administrator. It's part of some automation that I want to do within Azure, PowerShell and SQL Server running on the VMs. Here's the basic setup:
I have a virtual network set up, per the Microsoft example that Scott Klein wrote. It seems to be working. I can add servers to it. I have to log in using my CORP account, etc. It has an Affinity Group, GFVMDojo and a name GFDojo. I have a storage account, newly created, gfbudemo. It’s location is GFVMDojo (East US), which means it’s part of the same location as the VM. I have a cloud service, gfvmbudemo (yes, I stopped trying to name stuff appropriately when I got frustrated. I’ll rebuild everything once I figure out what’s wrong). It’s location is also GFVmDojo (East US). I’m logged into a VM who’s location is GFVMDojo (East US), using the CORP login that is part of the virtual network. So, as near as I can tell, everything is stacked up appropriately.
Now, in PowerShell, I have the imported my certificate for my subscription. I’ve supplied
$subscriptionid $subscriptionname $thumbprint $virtualnetworkid $password ##All 100% correct. I then set variables: $azureLocation = "East US"; $login = "Grant"; $vmImage = "fb83b3509582419d99629ce476bcb5c8__SQL-Server-2014CTP2-CU1-12.0.1736.0-Evaluation-ENU-WS2012R2-CY13SU12"; $vmName ="BackupTesting"; $certificate = get-item Cert:\CurrentUser\my\$thumbprint $cloudService = "gfvmdemo"; $storageAccountName ="gfbudemo"; $domain ="CORP"; $FQDN ="corp.clouddojo.com"; $subnet ="Back"; $dnsSettings =New-AzureDns -Name"BackDNS" -IPAddress"10.10.2.0"; $medialocation ="http://gfbudemo.blob.core.windows.net/vmstorage";
And then these commands
Set-AzureSubscription -SubscriptionName $subscriptionname -SubscriptionId $subscriptionid -Certificate $certificate -CurrentStorageAccountName $storageAccountName; ##create a VM, wait until it's provisioned New-AzureVMConfig -Name $vmName -InstanceSize ExtraSmall -ImageName $vmImage -MediaLocation $medialocation ` | Add-AzureProvisioningConfig -WindowsDomain -Password $password -AdminUsername $login -Domain $domain -JoinDomain $FQDN -DomainUserName $login -DomainPassword $password ` | Set-AzureSubnet -SubnetNames $subnet ` | Add-AzureEndpoint -Protocol tcp -Name MSSQL -PublicPort 1433 -localport 1433 ` | New-AzureVM -WaitForBoot -ServiceName $cloudService -VNetName "GFDojo" -DnsSettings $dnsSettings;
When I was just running this externally from my local machine, everything worked. But now, on the VM within the virtual network, I keep getting this error:
New-AzureVM : CurrentStorageAccountName is not accessible. Ensure the current storage account is accessible and in the same location or affinity group as your cloud service.
The locations are the same. And what's marked as the storage account, at least according to what I see from Get-AzureSubscription. The URL for the storage account is also right. I'm just not sure what I've done wrong here, and I know I've screwed something up. Any help on what to look for in terms of troubleshooting beyond this one error message?