Table of Contents
Network Adapters and Virtual Machines in Azure.
I have several virtual machines within my own test tenant. I did not manage to get the new machine within the domain. Somehow DNS screwed something up.
Because of this I came up with the brilliant idea to temporarily switch off the network adapter and then restart it in a few seconds. After disabling the network adapter, I immediately lost my connection with the Virtual machine in Azure.
Alright, how can you connect to a Virtual Machine in the Azure cloud that does not have a network adapter enabled? No idea what I thought.
Let’s re-enable the Network Adapter on an Azure VM, or actually… let’s add a new network interface.
Okay this is a refurbished post. More about that in the Summary.
Until a few years ago this was a more annoying problem than now. first you had to remove the old Network Interface and then add a new one, all via PowerShell. You could not then create a new Network Interface and link it within the Azure GUI. Now that is possible though.
Let’s first create a new Network Interface.
First let’s create a new network interface within the Azure portal.
See the screenshot below.
Go to All Services and search for Network Interfaces.
Click on Add to add a new network interface.
Enter the correct information here.
Choose the virtual Network that the Virtual Machine is currently in. You do not need to create a new one for this.
For IP Address, enter a different address than the existing Network Interface (which is disabled).
Let’s re-enable internet connectivity for the VM.
Now that we have a new network interface, we can link it to the Virtual Machine.
Go to the VM in the Azure Portal and switch it off temporarily.
Open Networking and click on Attach network Interface.
Add your new network interface and restart the VM.
You could now connect to the vm with the new IP address.
Keep in mind that when you use a NSG with port 3389 blocked you still can not connect.
Did your previous network interface have an external IP address and did you make a connection via the internet? Then add an external IP address to the new network interface.
The post was often viewed, but the old content was no longer relevant with what it is now. Within Azure you can now more easily connect a Network interface to a Virtual Machine. And therefore, I’ve refurbished the post.
On 22 October 2018 I modified the post and re-published it.
A little extra
This post contains PowerShell. Would you like to learn the basics better? I have created a new website to learn basic PowerShell in an ’emulator’ environment.
Click here to go learn Basic PowerShell.