-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure in Connect-mgGraph with certificate after upgrading to Microsoft365DSC 1.24.1016.1 #5461
Comments
Can anyone suggest the code flow, during Start-dscconfiguration ? Export commands are going to various util scripts under .\modules\Microsoft365DSc<version>\Modules. But to debug the code flow for start-dscconfiguration to fidn where it is failing, its being unkown. |
What does it show in the Entra portal under your app registration in the sign-in logs? Anything related that the login failed? Is the certificate you're using in the certificate store of the machine and the user? |
Yes, the certificate im using is in the machine store (authentication works fine if I use the version '1.24.417.1' ). Entra portal does not show any failure log entry. I am assuming the information of the cert seems not being properly passed during connect-mgGraph.. Is there a way to debug, when I do 'start-DSCConfiguration' ? I tried to put break points in 'Get-TargetResource' function in MSFt_AADApplication.psm1 (the resource im trying to create) . But session is not even reaching there it seems. So trying to understand the flow, what all other scripts are called (once authentication Type was identified as 'ServicePrincipalWithThumbprint' ie Line # 2053 in M365DSCUtil.psm1) ? |
Trying with 1.24.1106.3 too. same error. Assuming some thing with Graph Auth. not working fine. Import-module Microsoft365DSC -RequiredVersion 1.24.1106.3 -Force PS C:\Subhash> Update-M365DSCDependencies -Force |
The flow is hard to debug unfortunately. |
@FabienTschanz Actually you can debug DSC, it's a pain in the rear let me tell you but you can. Just follow the instructions on https://learn.microsoft.com/en-us/powershell/dsc/troubleshooting/debugresource?view=dsc-1.1 |
Uhh that's bloody ugly... I'd rather stay as many miles away from there as humanly possible 😅 |
You gotta try it someday, it's so enfuriating when you're following the debug line by line, like 15 or more minutes into it,and by mistake you press the key and step into the function instead which will take you to the end of the process and have to restart the whole thing from the start... Nothing beats the good and ol' printf! |
@subhashvinjamuri Do you at least see the correct values for appid, cert thumbprint, and tenantid in the resulting mof and confirm they're all correct? |
Description of the issue
While working to create AADApplication in DSC, I upgraded to Microsoft365DSC verstion 1.24.1016.1 (from 1.24.417.1, as new features go added for AADApplication). Performed dependency updates and removed unsupported versions etc as per standard procedure. Now I have Microosfot365DSC 1.24.1016.1 & Microsoft.Graph.Authentication 2.23.0 installed.
Create New configuration for AADApplication (basic details) with certificate authentication of my DSC service principle which has permission to create new App Reg in AAD.
mof file gets created. But send configuration fails for this mof file with below error. This is happening at -
###############
This event indicates that a non-terminating error was thrown when DSCEngine was executing Test-TargetResource on MSFT_AADApplication DSC resource. FullyQualifiedErrorId :
ClientCertificateCredential authentication failed: Retry failed after 4 tries. Retry settings can be adjusted in ClientOptions.Retry or by configuring a custom retry policy
in ClientOptions.RetryPolicy.
+ CategoryInfo : NotSpecified: (:) [], CimException
+ FullyQualifiedErrorId : Microsoft.Graph.PowerShell.Authentication.Cmdlets.ConnectMgGraph
+ PSComputerName : localhost
##################
However, export works fine with same service principle and corresponding cert authentication. But Apply configuration fails.
please suggest.
Microsoft 365 DSC Version
1.24.1016.1
Which workloads are affected
Azure Active Directory (Entra ID)
The DSC configuration
Verbose logs showing the problem
Environment Information + PowerShell Version
The text was updated successfully, but these errors were encountered: