issue with Powershell dsc for linux in Azure Automation

184 Views Asked by At

I have setup DSC in Azure Automation Account and an Azure Ubuntu VM has been configured to pull dsc from the Automation Account.

I have a sample config as below:

Import-DSCResource -Module nx

Node $Node
{
   
   nxFile testConf
   {
      DestinationPath = "/etc/test.conf"
      Mode = "644"
      Type = "file"
      Contents = "hello test"
   }
}
}

It works well in first run and later if I delete it the DSC doesn't create it.

I have similar issue with nxScript which runs script first time but afterwards it doesn't run the script (I'm always returning false in TestScript so it should always run).

It seems the issue is in Pull mode. For test I tried in Push mode and it works well.

1

There are 1 best solutions below

0
pers On

I turned out that I had to set the ConfigurationMode to ApplyAndAutoCorrect instead of ApplyAndMonitor.