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

[SPOTenantCdnEnabled] False does not provide any export results #2466

Closed
ykuijs opened this issue Oct 28, 2022 · 2 comments · Fixed by #2651 or #2667
Closed

[SPOTenantCdnEnabled] False does not provide any export results #2466

ykuijs opened this issue Oct 28, 2022 · 2 comments · Fixed by #2651 or #2667
Assignees
Labels
Enhancement New feature or request SharePoint Online V1.22.1026.2 Version 1.22.1026.2

Comments

@ykuijs
Copy link
Member

ykuijs commented Oct 28, 2022

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

When this setting is disabled, the export does not include the resource because Enabled=False is filtered out here:

if ($Results.Enable -eq $True)
{
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results
$currentDSCBlock = Get-M365DSCExportContentForResource -ResourceName $ResourceName `
-ConnectionMode $ConnectionMode `
-ModulePath $PSScriptRoot `
-Results $Results `
-Credential $Credential
$dscContent += $currentDSCBlock
Save-M365DSCPartialExport -Content $currentDSCBlock `
-FileName $Global:PartialExportFileName
}

But this can be False because of either the Get-TargetResource returned False or nothing (because Get-PnPTenantCdnEnabled threw an exception.

Question now is: Should the resource be filtered when the setting is False?

Verbose logs showing the problem

Suggested solution to the issue

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

# insert configuration here

The operating system the target node is running

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

dev

@andikrueger
Copy link
Collaborator

I would add this information to the export of the resource. This could cause errors in export/import scenarios across various "stages". I someone would have enable the setting, it would not be disabled in other cases. Disabled is the default state, isn't it?

@ykuijs
Copy link
Member Author

ykuijs commented Oct 28, 2022

I believe it is indeed.

Right now the code returns an empty string when an exception occurs:


This is the Export code to filter the resource.

Maybe it would be better to return Ensure=Absent and filter on the Ensure instead of the Enabled parameter.

@andikrueger andikrueger removed their assignment Oct 28, 2022
@andikrueger andikrueger added Enhancement New feature or request and removed Pending Information labels Oct 28, 2022
@andikrueger andikrueger self-assigned this Nov 3, 2022
NikCharlebois added a commit to NikCharlebois/Microsoft365DSC that referenced this issue Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request SharePoint Online V1.22.1026.2 Version 1.22.1026.2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants