Skip to content
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

Error on PR Validation for Conditional Access Policies #5804

Open
tld6764 opened this issue Feb 18, 2025 · 1 comment
Open

Error on PR Validation for Conditional Access Policies #5804

tld6764 opened this issue Feb 18, 2025 · 1 comment
Labels
DevOps Issues related to using M365DSC in DevOps

Comments

@tld6764
Copy link

tld6764 commented Feb 18, 2025

Description of the issue

According to the example file (M365ConfigurationDataExample.psd1) the section for conditional access policies should look like:
ConditionalAccessPolicies = @( @{ TransferMethods = 'String | Optional | Names of the associated authentication flow transfer methods. Possible values are '''', ''deviceCodeFlow'', ''authenticationTransfer'', or ''deviceCodeFlow,authenticationTransfer''.' PersistentBrowserIsEnabled = 'Boolean | Optional | Specifies, whether Browser Persistence is controlled by the Policy.'

However when I commit this and it runs the PR validation, I see:
Running tests from 'C:\Users\VssAdministrator\AppData\Local\Temp\tmpfklx3t.tests.ps1' Describing --- Check M365-DSC-CompositeResources configuration --- Context NonNodeData Context NonNodeData.AADConditionalAccessPolicy ##[error] [-] NonNodeData.AADConditionalAccessPolicy 45ms (42ms|4ms) ##[error] Expected $null or empty, because Not available as Composite Resource, but got @(System.Collections.Hashtable, System.Collections.Hashtable, System.Collections.Hashtable, System.Collections.Hashtable, System.Collections.Hashtable, System.Collections.Hashtable, System.Collections.Hashtable, System.Collections.Hashtable, System.Collections.Hashtable, System.Collections.Hashtable, ...4 more). ##[error] at $inputObject.NonNodeData.AADConditionalAccessPolicy | Should -BeNullOrEmpty -Because 'Not available as Composite Resource', C:\Users\VssAdministrator\AppData\Local\Temp\tmpfklx3t.tests.ps1:8 ##[error] [-] NonNodeData.AADConditionalAccessPolicy[0] 7ms (6ms|1ms) ##[error] Expected $null or empty, because Not available as Composite Resource, but got System.Collections.Hashtable. ##[error] at $inputObject.NonNodeData.AADConditionalAccessPolicy[0] | Should -BeNullOrEmpty -Because 'Not available as Composite Resource', C:\Users\VssAdministrator\AppData\Local\Temp\tmpfklx3t.tests.ps1:11 ##[error] [-] NonNodeData.AADConditionalAccessPolicy[1] 3ms (2ms|1ms)

Microsoft 365 DSC Version

1.25.129.3

Which workloads are affected

Azure Active Directory (Entra ID)

The DSC configuration

@{
    NonNodeData = @{
        ConditionalAccessPolicies = @(
            @{
                ApplicationEnforcedRestrictionsIsEnabled = $False
                AuthenticationContexts                   = @()
                BuiltInControls                          = @('block')
                ClientAppTypes                           = @('exchangeActiveSync', 'other')
                CloudAppSecurityIsEnabled                = $False
                CloudAppSecurityType                     = ''
                CustomAuthenticationFactors              = @()
                DeviceFilterRule                         = ''
                DisableResilienceDefaultsIsEnabled       = $False....

Etc.

Verbose logs showing the problem

##[error]     [-] NonNodeData.AADConditionalAccessPolicy[8] 3ms (2ms|1ms)
##[error]      Expected $null or empty, because Not available as Composite Resource, but got System.Collections.Hashtable.
##[error]      at $inputObject.NonNodeData.AADConditionalAccessPolicy[8] | Should -BeNullOrEmpty -Because 'Not available as Composite Resource', C:\Users\VssAdministrator\AppData\Local\Temp\tmpfklx3t.tests.ps1:35
##[error]     [-] NonNodeData.AADConditionalAccessPolicy[9] 3ms (2ms|1ms)
##[error]      Expected $null or empty, because Not available as Composite Resource, but got System.Collections.Hashtable.
##[error]      at $inputObject.NonNodeData.AADConditionalAccessPolicy[9] | Should -BeNullOrEmpty -Because 'Not available as Composite Resource', C:\Users\VssAdministrator\AppData\Local\Temp\tmpfklx3t.tests.ps1:38
##[error]     [-] NonNodeData.AADConditionalAccessPolicy[10] 2ms (2ms|0ms)
##[error]      Expected $null or empty, because Not available as Composite Resource, but got System.Collections.Hashtable.
##[error]      at $inputObject.NonNodeData.AADConditionalAccessPolicy[10] | Should -BeNullOrEmpty -Because 'Not available as Composite Resource', C:\Users\VssAdministrator\AppData\Local\Temp\tmpfklx3t.tests.ps1:41
##[error]     [-] NonNodeData.AADConditionalAccessPolicy[11] 3ms (2ms|1ms)
##[error]      Expected $null or empty, because Not available as Composite Resource, but got System.Collections.Hashtable.
##[error]      at $inputObject.NonNodeData.AADConditionalAccessPolicy[11] | Should -BeNullOrEmpty -Because 'Not available as Composite Resource', C:\Users\VssAdministrator\AppData\Local\Temp\tmpfklx3t.tests.ps1:44
##[error]     [-] NonNodeData.AADConditionalAccessPolicy[12] 13ms (12ms|1ms)
##[error]      Expected $null or empty, because Not available as Composite Resource, but got System.Collections.Hashtable.
##[error]      at $inputObject.NonNodeData.AADConditionalAccessPolicy[12] | Should -BeNullOrEmpty -Because 'Not available as Composite Resource', C:\Users\VssAdministrator\AppData\Local\Temp\tmpfklx3t.tests.ps1:47
##[error]     [-] NonNodeData.AADConditionalAccessPolicy[13] 2ms (2ms|1ms)
##[error]      Expected $null or empty, because Not available as Composite Resource, but got System.Collections.Hashtable.
##[error]      at $inputObject.NonNodeData.AADConditionalAccessPolicy[13] | Should -BeNullOrEmpty -Because 'Not available as Composite Resource', C:\Users\VssAdministrator\AppData\Local\Temp\tmpfklx3t.tests.ps1:50
Tests completed in 425ms
Tests Passed: 0, Failed: 15, Skipped: 0, Inconclusive: 0, NotRun: 0

Environment Information + PowerShell Version

Azure DevOps.
@FabienTschanz
Copy link
Collaborator

@ykuijs FYI

@FabienTschanz FabienTschanz added the DevOps Issues related to using M365DSC in DevOps label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DevOps Issues related to using M365DSC in DevOps
Projects
None yet
Development

No branches or pull requests

2 participants