简体   繁体   中英

Azure Automation: Onboarding DSC Node: “vmname, The entity was not found.”

I'm trying to onboard a VM to Azure Automation DSC using the Register-AzureRmAutomationDSCNode cmdlet as recommended here for non-classic vm's. The DSC nodeconfiguration has been both imported and compiled in Azure Automation.

Here is my code:

$AutomationAccountName = "PersistentAutomationAccount"
$VMName = "VM1" 
$AutomationResourceGroup = "PersistantResources" 
$VMResourceGroup = "AutomatingAutomation2"
$NodeConfigurationName = "HelloWorldDSC.localhost"
Register-AzureRmAutomationDscNode -AutomationAccountName $AutomationAccountName -AzureVMName $VMName -ResourceGroupName $AutomationResourceGroup -AzureVMResourceGroup $VMResourceGroup -NodeConfigurationName $NodeConfigurationName

But I'm getting the following error which I can't find an explanation for:

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."
  }
}'

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.

Is your VM in a different region from your automation account? If so, have you tried adding the AzureVMLocation variable and including the VM region?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM