Add Existing NIC to Azure VM

This topic contains 0 replies, has 1 voice, and was last updated by  Barry 6 months, 1 week ago.

  • Author
  • #84062


    While learning how to create VM's my session timed out and I lost my variable for the NIC, so I am trying to figure out how to add the NIC. As you can see it does not accept the NIC ID. Any thoughts?

    PS Azure:\> $nicId = (Get-AzureRmNetworkInterface -ResourceGroupName "myRG" -Name "NIC1").Id

    PS Azure:\> $nicID

    PS Azure:\> $vm = Add-AzureRmVMNetworkInterface -VM $vm -Id $nicID

    PS Azure:\> New-AzureRmVM -ResourceGroupname myRG -Location westUS -VM $vm
    New-AzureRmVM : Property id '5........' at path
    'properties.networkProfile.networkInterfaces[0].id' is invalid. Expect fully qualified
    resource Id that start with '/subscriptions/{subscriptionId}' or

You must be logged in to reply to this topic.