Get-AzureRmVirtualNetworkSubnetConfig Fails

This topic contains 3 replies, has 2 voices, and was last updated by  Soma sympli 1 year, 4 months ago.

  • Author
  • #55861

    Soma sympli

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

  • #55867

    Soma sympli
  • #55877

    Rob Simmers

    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
  • #55880

    Soma sympli

    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

You must be logged in to reply to this topic.