title: Azure Failed to restart virtual machine - NIC is not in Succeeded state
body: <p>After I've broken the default user I created for VM, I wanted to reset password or create new user. I'm getting the following error:</p>
  
  <blockquote>
    <p>Failed to restart the virtual machine 'vm'. Error: Cannot proceed with
    operation because resource
    xx-Pipeline-Agent/providers/Microsoft.Network/publicIPAddresses/xx-agent-ip'>xx-agent-ip
    used by resource
    /subscriptions/xxx/resourceGroups/xxx-Pipeline-Agent/providers/Microsoft.Network/networkInterfaces/xxx-agent442
    is not in Succeeded state. Resource is in Failed state and the last
    operation that updated/is updating the resource is
    PutPublicIpAddressOperation.</p>
  </blockquote>
  
  <p>I'm also trying to redeploy or restart the vm but Im getting the same error. Also I've tried this with no luck:</p>
  
  <pre><code>az network nic update --resource-group xx-Pipeline-Agent --name xx-agent442
  </code></pre>
  
  <p>How can I fix the state of NIC?</p>