AZURE

VMNetworkInterfaceNotFound - VM Network Interface Not Found: Interface Missing or Detached

VMNetworkInterfaceNotFound means ARM couldn't locate the network interface—wrong name/ID, interface was deleted, or it's detached from the VM. This 404 client-side error happens when ARM validates network interface references before VM operations. VMs need at least one network interface attached for connectivity. While specific to Virtual Machines, similar NIC lookup issues occur in AKS node network interfaces and App Service networking. The interface must exist and be attached for operations to work.

#Common Causes

  • Invalid Network Interface Identifier: The network interface name or ID is incorrect or contains typos. Network interface identifiers must match exactly what's stored in Azure (case-sensitive). This is persistent—you must use the correct identifier.
  • Detached Network Interface: The network interface exists but isn't attached to the VM. VMs require at least one network interface to be attached for network connectivity and most operations. This is persistent—you must attach the network interface to the VM.
  • Deleted Network Interface: The network interface has been deleted or doesn't exist. Deleted interfaces can't be attached to VMs. This is persistent—you must create a new network interface or use an existing one.

Solutions

  1. 1Step 1: Diagnose - List network interfaces attached to the VM: az vm show --resource-group <rg> --name <vm> --query "networkProfile.networkInterfaces[].id" --output table
  2. 2Step 2: Diagnose - Get network interface details if you have the ID: az network nic show --ids <nic-id> --query "{Name:name,ProvisioningState:provisioningState,IPConfigurations:ipConfigurations[].name}" --output table
  3. 3Step 3: Diagnose - List all network interfaces in the resource group: az network nic list --resource-group <rg> --query "[].{Name:name,ProvisioningState:provisioningState,VM:virtualMachine.id}" --output table
  4. 4Step 4: Fix - If interface is detached, attach it to the VM: az vm nic add --resource-group <rg> --vm-name <vm> --nics <nic-name>
  5. 5Step 5: Fix - If interface doesn't exist, create a new network interface: az network nic create --resource-group <rg> --name <nic> --vnet-name <vnet> --subnet <subnet> --network-security-group <nsg> Then attach it to the VM using Step 4.
  6. 6Step 6: Verify - After attaching or creating the interface, retry your VM operation. It should succeed instead of returning VMNetworkInterfaceNotFound.

</>Code Examples

VM Network Interface Diagnosis and Management
1# This script helps diagnose VMNetworkInterfaceNotFound by checking network interfaces
2
3# Step 1: Set VM details (replace with your values)
4RESOURCE_GROUP="my-resource-group"
5VM_NAME="my-vm"
6echo "Checking network interfaces for VM: ${VM_NAME}"
7
8# Step 2: List network interfaces attached to the VM
9echo "Listing network interfaces attached to VM..."
10az vm show \
11  --resource-group ${RESOURCE_GROUP} \
12  --name ${VM_NAME} \
13  --query "networkProfile.networkInterfaces[].id" \
14  --output table
15
16# Step 3: Get detailed network interface information
17NIC_IDS=$(az vm show \
18  --resource-group ${RESOURCE_GROUP} \
19  --name ${VM_NAME} \
20  --query "networkProfile.networkInterfaces[].id" \
21  --output tsv)
22
23if [ ! -z "${NIC_IDS}" ]; then
24  echo "Found network interfaces attached to VM:"
25  for nic_id in ${NIC_IDS}; do
26    echo "Getting details for: ${nic_id}"
27    az network nic show \
28      --ids ${nic_id} \
29      --query "{Name:name,ProvisioningState:provisioningState,IPConfigurations:ipConfigurations[].name,VM:virtualMachine.id}" \
30      --output table
31  done
32else
33  echo "WARNING: No network interfaces found attached to VM"
34fi
35
36# Step 4: List all network interfaces in resource group
37echo "Listing all network interfaces in resource group..."
38az network nic list \
39  --resource-group ${RESOURCE_GROUP} \
40  --query "[].{Name:name,ProvisioningState:provisioningState,VM:virtualMachine.id,Location:location}" \
41  --output table
42
43# Step 5: Check for detached network interfaces (interfaces without VM reference)
44echo "Checking for detached network interfaces..."
45DETACHED_NICS=$(az network nic list \
46  --resource-group ${RESOURCE_GROUP} \
47  --query "[?virtualMachine.id==null].{Name:name,ProvisioningState:provisioningState}" \
48  --output table)
49
50if [ ! -z "${DETACHED_NICS}" ]; then
51  echo "Found detached network interfaces:"
52  echo "${DETACHED_NICS}"
53  echo "These can be attached to the VM"
54fi
55
56# Step 6: Create network interface if needed (example)
57NIC_NAME="my-nic"
58VNET_NAME="my-vnet"
59SUBNET_NAME="my-subnet"
60NSG_NAME="my-nsg"
61
62echo "To create a new network interface, run:"
63echo "  az network nic create \"
64echo "    --resource-group ${RESOURCE_GROUP} \"
65echo "    --name ${NIC_NAME} \"
66echo "    --vnet-name ${VNET_NAME} \"
67echo "    --subnet ${SUBNET_NAME} \"
68echo "    --network-security-group ${NSG_NAME}"
69
70# Step 7: Attach network interface to VM (if needed)
71echo "To attach a network interface to VM, run:"
72echo "  az vm nic add \"
73echo "    --resource-group ${RESOURCE_GROUP} \"
74echo "    --vm-name ${VM_NAME} \"
75echo "    --nics ${NIC_NAME}"

Related Errors

Provider Information

This error code is specific to AZURE services. For more information, refer to the official AZURE documentation.

VMNetworkInterfaceNotFound - VM Network Interface Not Found: Interface Missing or Detached | AZURE Error Reference | Error Code Reference