My Azure VM getting APIPA IP

Raviraj Shetty 0 Reputation points
2026-07-10T13:47:35.85+00:00

My Azure VM in private subnet getting APIPA IP. unable to RDP from IP.

below steps already performed:

  1. Server Stop Start done
  2. Server Redeployed.
  3. Network card Disabled/Enabled from serial console
  4. NIC reset done by changing private IP.
  5. Created new NIC and associated to VM keeping IP same
  6. ipconfig /release -->end up with error
    1. ipconfig /renew --> end up with error --> An error occurred while renewing interface Ethernet : unable to contact your dhcp server. request timed out.
Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.


1 answer

Sort by: Newest
  1. AI answer

    2026-07-10T13:48:36.6966667+00:00

    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:

    1. 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.
    2. Use Serial Console to verify and fix NIC configuration in the guest OS
      1. Connect to the VM using Serial Console and open CMD instance.
      2. Check NIC state:
              netsh interface show interface
        
        If the interface is disabled, enable it:
              netsh interface set interface name="<NIC Name>" admin=enabled
        
      3. Check IP configuration:
              netsh interface ip show config
        
        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 set address name="<NIC Name>" source=dhcp
        
      4. Verify the new configuration:
              netsh interface ip show config
        
        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.
    3. 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:
         az vm repair reset-nic -g MyResourceGroup -n vmName --subscription subscriptionId --yes
      
      Then test RDP. Option B – Reset NIC via Azure portal
      1. In the Azure portal, open the VM → Networking → select the NIC.
      2. Go to IP configurations → select the IP.
      3. Set Private IP assignment to Static (if not already).
      4. Change the IP address to another available IP in the same subnet. This forces Azure to reinitialize the NIC and restarts the VM.
      5. After restart, test RDP. If successful, the private IP can be changed back to the original if desired.
    4. Clean up unavailable/old Hyper‑V adapters (after access is restored)
      Once RDP access is back:
      1. Open Device ManagerViewShow hidden devices.
      2. Expand Network adapters.
      3. Uninstall only grayed‑out adapters named Microsoft Hyper‑V Network Adapter.
        This avoids future conflicts with stale NICs.
    5. 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:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.