Dec 27 2017 06:01 AM - last edited on Jul 23 2018 01:19 PM by Eric Starker
I am unable to add VMs as DSC Nodes in my Azure Automation Account. So I tried to install the dsc extension using the powershell cmdlet "Register-AzureRmAutomationDscNode". This failed with the error (Somes details removed and replaced with < .. >)
eploymentName : 20171227013800
ResourceGroupName :<RG NAME>
ProvisioningState : Failed
Timestamp : 27/12/2017 13:38:05
Mode : Incremental
ContentVersion : 184.108.40.206
Name Type Value
=============== ========================= ==========
vmName String <VMNAME>
location String uksouth
modulesUrl String https://eus2oaasibizamarketprod1.blob.core.window
registrationUrl String https://uks-agentservice-prod-1.azure-automation.
configurationMode String ApplyAndAutocorrect
configurationModeFrequencyMins Int 15
refreshFrequencyMins Int 30
rebootNodeIfNeeded Bool False
actionAfterReboot String ContinueConfiguration
allowModuleOverwrite Bool False
timestamp String 27/12/2017 13:38:00
I can see that this is an ARM error, but I can't understand why im getting it. The target VM exists and I have also tried pulling the name straight from the get-azurermvm cmdlet. Any ideas?
Dec 29 2017 10:21 PM
for this to work you need to have your DSC scripts uploaded and compiled within the automation account first.
Upload Step code excerpt
Upload-DscScript -automationAccount $inAutomationAccount -resourceGroup $inResourceGroup -scriptPath $inScriptPath -published $inPublish -force $inForce
Compile Step code excerpt
$CompilationJob = Start-AzureRmAutomationDscCompilationJob -ResourceGroupName $resourceGroup -AutomationAccountName $automationAccount -ConfigurationName $configurationName -ConfigurationData $configurationData -Parameters $Parameters -Verbose
When you consume the node configurations if they name does not match the name in the configuration it will fail.
The function name within the DSC needs to match the filename as well.
Jan 03 2018 03:32 AM
Thanks for the reply, everything is published so I think it must just be a badly formatted command (Spelling of my inputs probably). I have however figured out why I couldn't do this via the console (this was my first issue) so I should be good for what I need now. Once I have it working I can take another look at the ps
just in case your interested, it looks like our firewall is blocking access to some metadata files the extension needs to install properly
Apr 30 2020 10:43 AMSolution
@Chris Gibson Late to the show, but I figured this out cause I ran into the same issue. You need to include the -azurevmresourcegroup option on the cmdlet. It's a bit deceiving cause the cmdlet will run, but without that, it can't actually reference the VM on which to deploy the extension, which is why you get the (very non-informative!) ParentResourceNotFound error.