1

Can someone please tell me why I keep on getting the error shown in the image each time I attempt to create a NIC with Powershell in Azure?

NIC

Thank you

1 Answer 1

1

You are not creating a Network Interface, instead, you are trying to get one that does not exist. To create a NIC, use the following procedures:

# Get the Virtual Network 
$VNET = Get-AzureRmVirtualNetwork -Name ‘Demo-vnet’ -ResourceGroupName ‘Demo’

# Get the Subnet Id
$SubnetID = (Get-AzureRmVirtualNetworkSubnetConfig -Name ‘default’ -VirtualNetwork $VNET).Id

# Create the Network Interface
New-AzureRmNetworkInterface -Name "NICFW" -ResourceGroupName "AdatumRG" -Location "East Us" -SubnetId $SubnetID 

Change variables accordingly and make sure -Location parameter matches your VNet location.

Sign up to request clarification or add additional context in comments.

2 Comments

Hi Bruno, thanks mate. The solution fixed the problem. Cheers mate.
Great! Don't forget to mark it as an answer if it worked for you. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.