You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting the following error when I run an export using a powershell script task in my DevOps pipeline for extracting non-compliant resources. I'm able to do it manually on the agent machine but when it's run through the devops automation pipeline, I'm getting the following. I'm having a tough time figuring out the cause. Any ideas? Also noticed #4491 is having the same issue.
Connect-MgGraph : The type initializer for 'Microsoft.Graph.PowerShell.Authentication.Common.ProtectedFileProvider'
threw an exception.
At C:\Program Files\WindowsPowerShell\Modules\MSCloudLoginAssistant\1.1.16\Workloads\MicrosoftGraph.psm1:115 char:21
+ ... Connect-MgGraph -ClientId $Global:MSCloudLoginConnectionP ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Connect-MgGraph], TypeInitializationException
+ FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.Graph.PowerShell.Authentication.Cmdlets.Con
nectMgGraph
PowerShell exited with code '1'.
Microsoft 365 DSC Version
V1.24.424.1
Which workloads are affected
Azure Active Directory (Entra ID)
The DSC configuration
# Import the Production configuration file$configData=Import-PowerShellDataFile-Path "$workingdirectory\Production\Production.psd1"# Access the NonNodeData section$nonNodeData=$configData.NonNodeData# Specify the workload$workload='ReportAutomation'# Find credentials for the specified workload$workloadCredentials=$nonNodeData.AppCredentials|Where-Object { $_.Workload-eq$workload }
# Set the Tenant ID$TenantId=$nonNodeData.Environment.TenantId$DashName=$nonNodeData.Environment.DashName# Access the specific values for the Report Automation workloadif ($workloadCredentials) {
$ApplicationId=$workloadCredentials.ApplicationId$CertificateThumbprint=$workloadCredentials.CertThumbprint
}
else {
Write-Host"No credentials found for workload '$workload'."
}
# Export individual policy$DateTime= (Get-Date).ToString("yyyy-MM-dd_HH-mm-ss")
Export-M365DSCConfiguration-Components $array-Path "$workingDirectory"-FileName "$DashName-$DateTime-Export.ps1"-ApplicationId $ApplicationId-CertificateThumbprint $CertificateThumbprint-TenantId $TenantId
Verbose logs showing the problem
Connect-MgGraph : The type initializer for'Microsoft.Graph.PowerShell.Authentication.Common.ProtectedFileProvider'
threw an exception.
At C:\Program Files\WindowsPowerShell\Modules\MSCloudLoginAssistant\1.1.16\Workloads\MicrosoftGraph.psm1:115 char:21+ ...Connect-MgGraph-ClientId $Global:MSCloudLoginConnectionP ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Connect-MgGraph], TypeInitializationException
+ FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.Graph.PowerShell.Authentication.Cmdlets.Con
nectMgGraph
PowerShell exited with code '1'.
Environment Information + PowerShell Version
OsName : Microsoft Windows 10 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage : en-US
OsMuiLanguages : {en-US}
Key : PSVersion
Value : 5.1.19041.4291
Name : PSVersion
Key : PSEdition
Value : Desktop
Name : PSEdition
Key : PSCompatibleVersions
Value : {1.0,2.0,3.0,4.0...}
Name : PSCompatibleVersions
Key : BuildVersion
Value : 10.0.19041.4291
Name : BuildVersion
Key : CLRVersion
Value : 4.0.30319.42000
Name : CLRVersion
Key : WSManStackVersion
Value : 3.0
Name : WSManStackVersion
Key : PSRemotingProtocolVersion
Value : 2.3
Name : PSRemotingProtocolVersion
Key : SerializationVersion
Value : 1.1.0.1
Name : SerializationVersion
The text was updated successfully, but these errors were encountered:
This only seems to be an issue if I run the export within a the test compliance pipeline. If I run this in a totally separate release pipeline by itself, it will complete. This is an issue though because I need access to output from the test compliance pipeline.
Description of the issue
I'm getting the following error when I run an export using a powershell script task in my DevOps pipeline for extracting non-compliant resources. I'm able to do it manually on the agent machine but when it's run through the devops automation pipeline, I'm getting the following. I'm having a tough time figuring out the cause. Any ideas? Also noticed #4491 is having the same issue.
Microsoft 365 DSC Version
V1.24.424.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: