Reputation: 7057
I'm writing PowerShell in order to take a local .vhd image, upload it to a Storage Account, and create a VM based on it. Everything I'm doing is with the new "Resource Manager" vs. the classic.
Everything so far works great. I can create the resource group, the storage account, the container, etc. All these commandlets are found fine, and works as expected.
I'm now trying to create the network adapter for the VM. As part of that I'm trying to create a new Virtual Network. Every guide I pull up online says to use "New-AzureVirtualNetwork", but that doesn't seem to exist for me.
Is there an extra package I need to install that covers the creation of the Virtual Network that is different from the rest of the Azure CLI, or has this been renamed or something in the latest version and I'm not following the right documentation?
Error is below:
New-AzureVirtualNetwork : The term 'New-AzureVirtualNetwork' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ New-AzureVirtualNetwork
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (New-AzureVirtualNetwork:String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : CommandNotFoundException
Upvotes: 2
Views: 2001
Reputation: 71028
Since you're using ARM,you should have access to New-AzureRmVirtualNetwork
.
Upvotes: 2
Reputation: 7057
I figured out the answer to my question. It seems whenever you post a question, often right afterwards you find an answer :-).
With Resource Manager the command is:
New-AzureRmVirtualNetwork
Just add Rm to just about every command if it doesn't work right, and most of the old code works.
Upvotes: 1