Configure LCM so that configuration only applies on demand

Hello

I have been working on setting up a build&test pipeline for a configuration of 5 server roles (app, web, database, etc.).

The pipeline runs in TFS. There is a build agent on a VM in azure in the same virtual network where the VMs are provisioned. The build agent server is also running a tug server. I also have a domain controller and certificate authority as ‘persistent’ vms to ease the process of remoting to the configured vms (no need to configure trustedhosts etc.)

  1. build and publish config to tug server in azure.
  2. provision vms in azure, and join them to the domain.
  3. apply LCM configuration with configuration names to the provisioned vms
  4. update-dscconfiguration on the provisioned vms
  5. execute pester test suite to confirm configuration is correct
  6. delete azure resource group where the vms were provisioned

The problem is the VMs seem to be immediately applying the configuration after the LCM is configured. I would like to be able to apply the configuration through update-dscconfiguration -verbose -wait -ComputerName $ComputerName so that I can see the result of applying the configuration in the build output. Is there a way to prevent the LCM from automatically pulling and applying configurations when configured?

Thanks

Nope. The LCM is designed to maintain a configuration. Not really an option to run on demand.

Then it seems the only option for me is to not use pull server, but to publish configuration instead. The nice thing about pull server is it handles all the module installation for you, you don’t need to install modules on the remote servers ahead of publishing the configuration (AFAIK)

The way I worked out for fixing my issue was to change order of operations a little bit:

register the lcms to pull server, then immediately queue jobs to update-dscconfiguration. The problem then becomes waiting for configuration to complete, after reboots which I think should be automatic.

Even when pushing a config the LCM can be configured to pull modules from a file server so that you don’t have to pre stage them.

Cool! I didn’t know that, thanks.

Found a blog post which describes how:

Setting up a Simple File share based Module Repository for DSC configurations