Closed leitzler closed 1 year ago
as per https://github.com/microsoft/Microsoft365DSC/issues/2594#issuecomment-1327183498:
In the past I used a windows server core too and was able to run M365DSC successfully. As soon as you need interactive windows, you won't be able to do so. Please try to use an account without MFA or a service principal.
Thanks for the response. If I understand it correctly I might be able to authenticate using Connect-MgGraph
before running the export to get around the MFA issue?
But that won't work due to the Newtonsoft.Json
failure, and from what I found it seems like the root cause of that issue is that Microsoft356DSC uses a version of Microsoft.Graph
that require a newer version of Newtonsoft.Json
(see https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/1439#issue-1329706224).
The resolution is to use PowerShell v7.2.5+ (https://github.com/PowerShell/PowerShell/pull/15084) due to a security vulnerability.
However Microsoft365DSC lists v7.1 as requirement and doesn't have official support for v7.2 😅.
I'm going to give it a go with v7.2 despite the fact that it isn't officially supported and might end up filing additional issues for reference.
For reference, running v7.3 (with manual call to Connect-MgGraph
before the export) fails too:
TenantId must be in format contuse.onmicrosoft.com
Yes, we still limited to PS 5.1 and PS 7.1. This is due to the dependencies on the various modules like Graph, Teams, Exchange,... The module itself would need some rework to.
What is your use case that you want to meet with the container version of M365DSC?
Yes, we still limited to PS 5.1 and PS 7.1. This is due to the dependencies on the various modules like Graph, Teams, Exchange,... The module itself would need some rework to.
Got it, you don't happen to have a roadmap or rough estimate when that could happen?
What is your use case that you want to meet with the container version of M365DSC?
I'm investigating if it is possible to use M365DSC without access to an actual Windows host, and if there are any limitations. The idea would be to run it as a plain Azure container or using AKS. So far I haven't found a combination of version(s) that works fully so any suggestions would be highly appreciated!
I went through this process a while ago and opted for an Azure Runbook. The container provisioning times were way to long and the issues around the container to challenging. With a PS runbook in V5.1 you mitigate the issues and still get the full set of features.
Ah, runbooks are a new concept to me, I'll look into if that route fits my use case. Thank you!
Details of the scenario you tried and the problem that is occurring
I tried to export component
SPOSite
from within amcr.microsoft.com/powershell:7.1.5-windowsservercore-ltsc2022
container.There are three separate issues here, let me know if I should split this issue into multiple ones. 1)
Import-Module
fails forPnP.PowerShell
. RunningImport-Module -Name PnP.PowerShell
only from the prompt works.2)
Connect-MgGraph
fails because it can't locateNewtonsoft.Json
.3) The export itself fails due to:
Device code terminal timed-out after 120 seconds.
. I never get any device code terminal so that output is probably suppressed.Verbose logs showing the problem
Suggested solution to the issue
The DSC configuration that is used to reproduce the issue (as detailed as possible)
N/A, default.
The operating system the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)