Hi @Pers ,
Welcome to Microsoft Q&A! Thanks for posting the question.
Based on the information available in the question that - the "desired state configuration" for a machine gets applied only once, and then does not correct/restore "desired state" after onboarding the machine, it looks like the ConfigurationMode
for Local Configuration Manager (LCM) is set to ApplyAndMonitor
or ApplyOnly
. Please refer to ConfigurationMode details in table available at Metaconfig basic settings.
You can verify it by using the configuration management scripts available locally at /opt/microsoft/dsc/Scripts
. If you have used the default options to register the machine from Portal or if you have used Az
Module from PowerShell, the output of GetDscLocalConfigurationManager.py
, would look like below:
Once you set the ConfigurationMode
to ApplyAndAutoCorrect
, after initial application of a new configuration, if the target node drifts from the desired state, DSC reports the discrepancy in logs, and then re-applies the current configuration. To perform this update, you may either:
1. use the SetDscLocalConfigurationManager.py
locally on the machine (ref: Working with configurations locally) -- which is a bit complex
2. use the Azure Portal to unregister the machine and register it again with the following options:
Please let me know if you have any questions.
---
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.