title: Azure Automation: Onboarding DSC Node: "vmname, The entity was not found."
body: <p>I'm trying to onboard a VM to Azure Automation DSC using the <code>Register-AzureRmAutomationDSCNode</code> cmdlet as recommended <a href="https://docs.microsoft.com/en-us/azure/automation/automation-dsc-onboarding" rel="nofollow noreferrer">here</a> for non-classic vm's. The DSC nodeconfiguration has been both imported and compiled in Azure Automation.</p>
  
  <p>Here is my code: </p>
  
  <pre><code>$AutomationAccountName = "PersistentAutomationAccount"
  $VMName = "VM1" 
  $AutomationResourceGroup = "PersistantResources" 
  $VMResourceGroup = "AutomatingAutomation2"
  $NodeConfigurationName = "HelloWorldDSC.localhost"
  Register-AzureRmAutomationDscNode -AutomationAccountName $AutomationAccountName -AzureVMName $VMName -ResourceGroupName $AutomationResourceGroup -AzureVMResourceGroup $VMResourceGroup -NodeConfigurationName $NodeConfigurationName
  </code></pre>
  
  <p>But I'm getting the following error which I can't find an explanation for:</p>
  
  <pre><code>New-AzureRmResourceGroupDeployment : 10:56:57 AM - Resource 
  
  Microsoft.Compute/virtualMachines/extensions 'VM1/Microsoft.Powershell.DSC' failed with message '{
    "error": {
      "code": "NotFound",
      "target": "vmName",
      "message": "The entity was not found."
    }
  }'
  </code></pre>
  
  <p>The VM name is correct, it exists, the resourcesgroup names are correct, so what is not being found?  I thought maybe the VM needed an extension preinstalled, but according to an Azure rep it's Automation's job to install the dsc agent/extension once the node is onboarded.</p>