Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

M365 DSC configuration - ApplyAndAutoCorrect is NOT really what it says

Open subhashvinjamuri opened this issue 5 months ago • 3 comments

we are trying to implement M365DSC to manage tenant configuration using standard devops process (github and jenkins pipeline). During this process, using github we defined resource configuration files in github and update them via github Pull Request (PR). And our jenkins pipeline will compile them to .mof files and apply to the tenant. Example - Configuration contains - Resource1 - in PR1 Resource1 and resource 2 - in PR2 Resource1, resource 2 and Resource 3 - in PR3 Resource1, resource 2, resource 3 and Resource 4 - in PR4 All works fine and good. But now, if I do github revert a commit and want to bring the tenant state to the time of that at PR2 (from PR4) - there the issue comes. When i revert to PR2, we get config from PR2 and that get forced on the tenant to have only resources 1 & 2 to exist. However, the previously created resources : resource 3 & resource 4 still stay in the tenant. And even though DSC sees some extra resources (3 & 4) in the tenant, it does NOT delete them even though I apply DSC with tried the same with LCM config - ApplyAndAutoCorrect , no luck.

Please suggest how to proceed further

subhashvinjamuri avatar Sep 20 '24 18:09 subhashvinjamuri