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

export of AADCrossTenantAccessPolicyConfigurationPartner broken since 1.25.122.2 #5711

Open
slaurentpco opened this issue Feb 3, 2025 · 0 comments

Comments

@slaurentpco
Copy link

Description of the issue

Since the refactoring introduced by 1.25.122.2 the export of AADCrossTenantAccessPolicyConfigurationPartner is broken, which leads to the following error when calling ConvertTo-DSCObject:
Unable to find type [Instance].

I tested OK with 1.25.122.1. See below the 2 differing DSC configurations exported by the 2 different versions.

Microsoft 365 DSC Version

1.25.122.2

Which workloads are affected

Azure Active Directory (Entra ID)

The DSC configuration

Here is the buggy configuration exported by 1.25.122.2:

Configuration M365TenantConfig
{
    param (
    )

    $OrganizationName = $ConfigurationData.NonNodeData.OrganizationName

    Import-DscResource -ModuleName 'Microsoft365DSC' -ModuleVersion '1.25.122.2'

    Node localhost
    {

        # For information on how to use this resource, please refer to:
        # https://github.com/microsoft/Microsoft365DSC/wiki/AADCrossTenantAccessPolicyConfigurationPartner
        AADCrossTenantAccessPolicyConfigurationPartner "AADCrossTenantAccessPolicyConfigurationPartner-REDACTED"
        {
            ApplicationId            = $ConfigurationData.NonNodeData.ApplicationId;
            B2BCollaborationInbound  = MSFT_AADCrossTenantAccessPolicyB2BSetting{
                Applications = $null
                UsersAndGroups = $null

            };
            B2BCollaborationOutbound = MSFT_AADCrossTenantAccessPolicyB2BSetting{
                Applications = $null
                UsersAndGroups = $null

            };
...


Here is the same config exported by 1.25.122.1:

Configuration M365TenantConfig
{
    param (
    )

    $OrganizationName = $ConfigurationData.NonNodeData.OrganizationName

    Import-DscResource -ModuleName 'Microsoft365DSC' -ModuleVersion '1.25.122.1'

    Node localhost
    {

        # For information on how to use this resource, please refer to:
        # https://github.com/microsoft/Microsoft365DSC/wiki/AADCrossTenantAccessPolicyConfigurationPartner
        AADCrossTenantAccessPolicyConfigurationPartner "AADCrossTenantAccessPolicyConfigurationPartner-REDACTED"
        {
            ApplicationId            = $ConfigurationData.NonNodeData.ApplicationId;
            B2BDirectConnectInbound  = MSFT_AADCrossTenantAccessPolicyB2BSetting {
                Applications = MSFT_AADCrossTenantAccessPolicyTargetConfiguration{
                    AccessType = 'allowed'
                    Targets    = @(
                        MSFT_AADCrossTenantAccessPolicyTarget{
                            Target     = 'AllApplications'
                            TargetType = 'application'
                        }
                    )
                }
                UsersAndGroups = MSFT_AADCrossTenantAccessPolicyTargetConfiguration{
                    AccessType = 'allowed'
                    Targets    = @(
                        MSFT_AADCrossTenantAccessPolicyTarget{
                            Target     = 'AllUsers'
                            TargetType = 'user'
                        }
                    )
                }
            };
            B2BDirectConnectOutbound = MSFT_AADCrossTenantAccessPolicyB2BSetting {
                Applications = MSFT_AADCrossTenantAccessPolicyTargetConfiguration{
                    AccessType = 'allowed'
                    Targets    = @(
                        MSFT_AADCrossTenantAccessPolicyTarget{
                            Target     = 'AllApplications'
                            TargetType = 'application'
                        }
                    )
                }
                UsersAndGroups = MSFT_AADCrossTenantAccessPolicyTargetConfiguration{
                    AccessType = 'allowed'
                    Targets    = @(
                        MSFT_AADCrossTenantAccessPolicyTarget{
                            Target     = 'AllUsers'
                            TargetType = 'user'
                        }
                    )
                }
            };
....

Verbose logs showing the problem

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-GB
OsMuiLanguages       : {en-GB}

Name                           Value
----                           -----
PSVersion                      7.4.6
PSEdition                      Core
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant