How to force an on-premises Linux machine to pull new DSC information from Azure Automation

On a Windows-based machine you can easily issue Update-DSCConfiguration to force pull the updated DSC information you have uploaded to Azure Automation (or even your own server).

On a Linux based machine the command Update-DSCConfiguration doesn’t exist in Powershell and it is not available as a script inĀ  /opt/microsoft/dsc/Scripts/

The way to force the update is through Windows-based machine, Powershell and CIM:

$LinuxIP = ""

$Credentials = Get-Credential -UserName:'root' -Message 'Enter Root Credentials'

$CIMOptions = New-CimSessionOption -SkipCACheck -SkipCNCheck -UseSsl -SkipRevocationCheck

$CIMSession = New-CimSession -Credential $Credentials -ComputerName $LinuxIP -Port 5986 -Authentication Basic -SessionOption $CIMOptions

Update-DscConfiguration -CimSession $CIMSession

Also a good idea is to stop omid service (service omid stop) and start omiserver (/opt/omi/bin/omiserver) interactively to see the output in the screen as it provides more debug information. Once everything works OK you can start it again as a service.

If anyone finds another way (probably to initiate it directly from the Linux box), please do let me know!

Leave a Reply

Your email address will not be published. Required fields are marked *