Quantcast
Channel: Azure Virtual Machines forum
Viewing all articles
Browse latest Browse all 12545

Getting CurrentStorageAccountName is not accessible when trying to create a VM with a static IP

$
0
0

I’m have an Azure PowerShell challenge.

I am trying to create a VM with a static IP based on an existing disk.

I have run the following and can see my disk in the list of VM disks

Add-AzureDisk -DiskName $diskname -MediaLocation $medialocation -Label "bootdisk" -OS "Linux"

However when I run the following script:

Set-AzureSubscription -SubscriptionName "my subscrption" -CurrentStorageAccountName "my storage account" $vmImg = New-AzureVMConfig -Name $vmname -InstanceSize Large -DiskName $diskname -Verbose | Set-AzureSubnet -SubnetNames "my subnet" | Set-AzureStaticVNetIP -IPAddress "192.168.58.101" New-AzureVM -ServiceName $cloudservicename -VMs $vmImg -VNetName - "my vnet"

I get the following 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

I did some research and found that is an issue when the cloud service already exits. However, I have tried all the workarounds suggested including allowing the New-AzureVM to create the cloud service.

Have you come across this? The reason I need the static IP is that everything in the VM breaks if I allow dynamic IP.

Any suggestions would be greatly appreciated.


Viewing all articles
Browse latest Browse all 12545

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>