Author Posts

October 24, 2016 at 10:09 am

Not sure why the Get-AzureRmVirtualNetworkSubnetConfig Fails, any help?

October 24, 2016 at 4:32 pm

The error:

Get-AzureRmVirtualNetworkSubnetConfig : Cannot bind parameter 'VirtualNetwork'. Cannot convert the "VNET1" value of type "System.String" to type 

indicates that the cmdlet is expecting a PSVirtualNetwork and not a String (e.g. VNET1). Try using Get-AzureRmVirtualNetwork to get the network prior calling Get-AzureRmVirtualNetworkSubnetConfig. Try something like this:

Get-AzureRmVirtualNetwork -Name VNET1 | Get-AzureRmVirtualNetworkSubnetConfig

October 24, 2016 at 4:54 pm

Tried that as well didnt work, somtimes it works and sometimes it doest, not sure why..

PS C:\Windows\system32> Get-AzureRmVirtualNetwork -ResourceGroupName $resourceGroup|Get-AzureRmVirtualNetworkSubnetConfig -VirtualNetwork $vnet -Name Subnet02

Get-AzureRmVirtualNetworkSubnetConfig : Cannot convert 'System.Object[]' to the type

'Microsoft.Azure.Commands.Network.Models.PSVirtualNetwork' required by parameter
'VirtualNetwork'. Specified method is not supported.
At line:1 char:115
+ ... VirtualNetwork $vnet -Name Subnet02
+ ~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-AzureRmVirtualNetworkSubnetConfig], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Microsoft.Azure.Commands.Network.GetAzureVirtualNetworkSubnetConfigCommand