An Azure service that is used to provision Windows and Linux virtual machines.
The VM is getting an APIPA address because it cannot reach a DHCP server or its NIC/IP configuration inside the guest OS does not match the Azure NIC configuration. Since RDP is already unavailable and ipconfig /renew fails, use out‑of‑band recovery to fix the NIC configuration from Azure side and inside the OS.
Follow these steps in order:
- Take a backup of the OS disk
Before making changes, snapshot the OS disk so the VM can be recovered if needed. See Snapshot a disk. - Use Serial Console to verify and fix NIC configuration in the guest OS
- Connect to the VM using Serial Console and open CMD instance.
- Check NIC state:
If the interface is disabled, enable it:netsh interface show interfacenetsh interface set interface name="<NIC Name>" admin=enabled - Check IP configuration:
If the interface shows a static IP that does not match the Azure NIC, or an APIPA address, reset it to DHCP so Azure can assign the correct IP:netsh interface ip show confignetsh interface ip set address name="<NIC Name>" source=dhcp - Verify the new configuration:
The IPv4 address should now match the private IP configured on the Azure NIC. Once this matches, the VM should regain network connectivity and RDP should work again.netsh interface ip show config
- If Serial Console is not usable, reset the NIC from Azure
If Serial Console cannot be used or the NIC still does not get a valid IP after setting DHCP, reset the NIC from Azure: Option A – Recommended Azure CLI reset
In Azure Cloud Shell:
Then test RDP. Option B – Reset NIC via Azure portalaz vm repair reset-nic -g MyResourceGroup -n vmName --subscription subscriptionId --yes- In the Azure portal, open the VM → Networking → select the NIC.
- Go to IP configurations → select the IP.
- Set Private IP assignment to Static (if not already).
- Change the IP address to another available IP in the same subnet. This forces Azure to reinitialize the NIC and restarts the VM.
- After restart, test RDP. If successful, the private IP can be changed back to the original if desired.
- Clean up unavailable/old Hyper‑V adapters (after access is restored)
Once RDP access is back:- Open Device Manager → View → Show hidden devices.
- Expand Network adapters.
- Uninstall only grayed‑out adapters named Microsoft Hyper‑V Network Adapter.
This avoids future conflicts with stale NICs.
- Avoid manual static IPs inside the OS
For Azure VMs, do not manually set a different static IP inside Windows than the one configured on the Azure NIC. If a static IP is required, configure it on the Azure NIC and, if set inside the OS, ensure it matches the Azure NIC’s primary private IP. Mismatched or incorrect static configuration can cause loss of connectivity and APIPA behavior.
After these steps, the VM should obtain the correct private IP from Azure and RDP should work again.
References: