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

Full export produces duplicate entries #3182

Closed
leitzler opened this issue Apr 19, 2023 · 6 comments
Closed

Full export produces duplicate entries #3182

leitzler opened this issue Apr 19, 2023 · 6 comments
Labels

Comments

@leitzler
Copy link

Details of the scenario you tried and the problem that is occurring

Similar to #3181 but for SPOPropertyBag entries (that require a full export).

Exported a clean developer tenant with default sample data using certificate thumbprint and Full mode:

Export-M365DSCConfiguration -CertificateThumbprint $Cert.Thumbprint -TenantId <redacted>.onmicrosoft.com -ApplicationId 01234567-890a-bcde-f012-34567890abcd -Path full -Mode Full -MaxProcesses 64

Trying to convert gives me:

PSDesiredStateConfiguration\Configuration : A duplicate resource identifier '[SPOPropertyBag]SPOPropertyBag' was found while processing the specification for node 'localhost'. Change the name of this resource so
that it is unique within the node specification.
At C:\full\M365TenantConfig.ps1:6 char:1
+ Configuration M365TenantConfig
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Write-Error], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : DuplicateResourceIdInNodeStatement,Configuration

And the M365TenantConfig.ps1 file do contain several SPOPropertyBag entries, this is just the first 3 out of 198:

        SPOPropertyBag "SPOPropertyBag"
        {
            ApplicationId         = $ConfigurationData.NonNodeData.ApplicationId;
            CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint;
            Ensure                = "Present";
            Key                   = "vti_associategroups";
            TenantId              = $ConfigurationData.NonNodeData.TenantId;
            Url                   = "https://$($OrganizationName.Split('.')[0]).sharepoint.com/";
            Value                 = "8;7;6";
        }
        SPOPropertyBag "SPOPropertyBag"
        {
            ApplicationId         = $ConfigurationData.NonNodeData.ApplicationId;
            CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint;
            Ensure                = "Present";
            Key                   = "FollowLinkEnabled";
            TenantId              = $ConfigurationData.NonNodeData.TenantId;
            Url                   = "https://$($OrganizationName.Split('.')[0]).sharepoint.com/";
            Value                 = "TRUE";
        }
        SPOPropertyBag "SPOPropertyBag"
        {
            ApplicationId         = $ConfigurationData.NonNodeData.ApplicationId;
            CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint;
            Ensure                = "Present";
            Key                   = "vti_associateownergroup";
            TenantId              = $ConfigurationData.NonNodeData.TenantId;
            Url                   = "https://$($OrganizationName.Split('.')[0]).sharepoint.com/";
            Value                 = "6";
        }

Verbose logs showing the problem

See above.

Suggested solution to the issue

Include enough details in key to make different labels unique.

The DSC configuration that is used to reproduce the issue (as detailed as possible)

Using Windows Server Core container, mcr.microsoft.com/windows/servercore:1809-amd64.

Install-PackageProvider -Name NuGet -Force
Install-Module Microsoft365DSC -Force
Update-M365DSCDependencies

The operating system the target node is running

OsName               : Microsoft Windows Server 2019 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 1809
WindowsBuildLabEx    : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage           : en-US
OsMuiLanguages       : {en-US}
$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.17763.3770
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.3770
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version of the DSC module that was used ('dev' if using current dev branch)

1.23.412.1 Microsoft365DSC                     PSGallery            This DSC module is used to configure and monitor Microsoft tenants, including SharePoint Online, Exchange, Teams, etc.
@leitzler leitzler changed the title Export produces duplicate SPOPropertyBag entries Full export produces duplicate SPOPropertyBag entries Apr 20, 2023
@leitzler leitzler changed the title Full export produces duplicate SPOPropertyBag entries Full export produces duplicate entries Apr 20, 2023
@leitzler
Copy link
Author

The same applies to the following resource types. I'll lump them together here but let me know if you want separate issues for each.

  • SPOSiteAuditSettings
  • SPOSiteGroup
  • TeamsChannel
  • TeamsUser

@NikCharlebois
Copy link
Collaborator

Yes, we are aware of this unfortunate issue. A fix has already been merged for this and will be available in next week's release. Sorry for the troubles, this is related to a recent change in the naming logic in hopes of making the deployment progress more intuitive.

@leitzler
Copy link
Author

Good to know, thanks for the update! I'm looking forward to trying it out :)

@andikrueger andikrueger added Bug Something isn't working Core Engine labels Apr 25, 2023
@NikCharlebois
Copy link
Collaborator

@leitzler can you please confirm if this issue was solved for you with the latest release? Thanks

@leitzler
Copy link
Author

leitzler commented May 4, 2023

Apologies for the late reply.

Unfortunately I don't have bandwidth to run another test at the moment (and my sandbox env is deleted so I need to wait for the 60 days quarantine to end before I can create a new). I'll add a calendar reminder to take another look when the quarantine is over.

@NikCharlebois
Copy link
Collaborator

To help remediate to the issue, we have introduced a new -Validate switch to the Export-M365DSCConfiguration cmdlet. While this won't automatically solve the issue, it is the best we can do to help customers troubleshoot their config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants