Closed gibi916 closed 2 weeks ago
Both logs show that the deployment fails, do you have a log of one that succeeds?
Sorry for that. I corrected the log.
hello, I am facing the same issue.
Moreover, in the eventlog, you may see the below error Error creating new policy: { Response status code does not indicate success: BadRequest (Bad Request). } \ at Set-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365dsc\1.24.522.1\DscResources\MSFT_AADConditionalAccessPolicy\MSFT_AADConditionalAccessPolicy.psm1: line 1682
I have one computer with module Microsoft365dsc version 1.24.522.1. I have update the Microsoft365dsc recently. And I have another computer on which I did not updated recently and it is using module version 1.24.228.1. With version 1.24.228.1, everything is working fine for EntraID ConditionAccess, I can created and update conditionalAccess from MOF file without error. But with version 1.24.522.1, creation and update of conditionalAccess does not work anymore. The DSC agent verbose log does not output any error, it seems that everything is working fine. But when checking the conditionalAccess M365 console, nothing changed. And looking at eventlog, there is this error "BadRequest". It seems that since update of Microsoft365DSC, some functionality for conditionalaccess are not working anymore.
Moreover, I can see that new export have new option for "TransferMethods" in conditionaccess settings.
Does any one manage to create and update conditionalAccess object with version 1.24.522.1 ? Regards
hello, One update from my end if this can help. M365DSC deployment is successfull by removing from the MOF file, the line corresponding: TransferMethods = "";
The M365DSC team has switched from "Update-MgBetaIdentityConditionalAccessPolicy" to Invoke-MgGraphRequest. There maybe some fine tuning to do with this new property TransferMethods on $newparameters variable. Great job to the team by the way. Regards
I am experiencing the same issue as @vinam779
I was also able to fix the issue by removing the "Transfermethods" property. I removed it from the export .ps1 file, before generating the .mof file.
Thank you @vinam779 for sharing the fix 😊
Description of the issue
I'm not able to use the latest version 1.24.522.1 because I have a deployment bug that I don't have with 1.24.515.2. This only concerns a few conditional access policies with specific configuration. The error I get is :
If I delete the policy I get the same kind of message but with failed to create policy message. Without changing anything else except the DSC module version, I have a different result. I noticed that with module 1.24.522.1 I have an additional property that appears in the verbose log, which is not set with the 1.24.515.2 module. It's this one: includeGuestsOrExternalUsers=$null
Here the log when it's successfully deployed with module 1.24.515.2
And the log when it failed with module 1.24.522.1 :
Microsoft 365 DSC Version
1.24.522.1
Which workloads are affected
Azure Active Directory (Entra ID)
The DSC configuration
Verbose logs showing the problem
Environment Information + PowerShell Version
No response