2

I'm trying to wire up Scaleset VMs to the Azure Automation DSC server using the DSC extension. This is not exposed via the Portal, but from this documentation it seems that it should be possible though templates and powershell cmd line.

I have the boiled things down to the following snippet (with sensitive vars masked):

$settings = @{
    configurationArguments = @{
        registrationUrl = "https://ne-agentservice-prod-1.azure-automation.net/accounts/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"
    }
}    
$protectedSettings = @{
    configurationArguments = @{
        registrationKey = @{
            userName = "NOT_USED"
            password = "/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="
        } 
    } 
}

Get-AzureRmVmss -ResourceGroupName $resourceGroupName -VMScaleSetName $VmSsName | 
    Add-AzureRmVmssExtension -Name "DSC" -Publisher "Microsoft.Powershell" -Type "DSC" -TypeHandlerVersion "2.24" -Setting $settings -ProtectedSetting $protectedSettings |
    Update-AzureRmVmss

In the portal, the extension is listed. However nothing is happening: I neither see any VMs listed in the Automation DSC "Nodes" list, nor do I see an DSC activity on the scaleset VMs - the event viewer for DSC is empty; the "c:\WindowsAzure\Logs" folder has nothing related to DSC.

I'm at wits-end as I feel tantalizingly close to getting this working, but am getting no feedback as to what is wrong...

1 Answer 1

0

I've managed to get the Add-AzureRmVmssExtension as part of a New-AzureRmVmss powershell pipeline flow. I needed to make two changes:

1) to not encode the $setting and $protectedSetting hashtables as Json - my original snippet was using ConvertTo-Json on the hashtable to get string json. In my defence, the documentation for those params indicates: "Specifies private configuration for the extension, as a string.". I will file a documentation bug.

2) (and this I think is the main reason), I updated the TypeHandlerVersion to 2.76 which is the current latest version - copy-paste from an Internet example gave me 2.24. I'm gonna see if I can get away with not specifying the version at all - I would always want the latest.

1
  • TypeHandlerVersion is a mandatory param. Sigh. I'll just have to call Get-AzureRmVMExtensionImage to dynamically discover the latest version Oct 11, 2018 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.