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

Exporting Power Platform configuration with application authentication fails #5852

Closed
KuotingChiu opened this issue Feb 27, 2025 · 1 comment

Comments

@KuotingChiu
Copy link

Description of the issue

Exporting Power Platform configuration with application certificate thumbpriint authentication fails while testing the native command such as get-dlppolicy works with the application identity.

Microsoft 365 DSC Version

1.25.219.2

Which workloads are affected

Power Platform

The DSC configuration

Exporting Power Platform configuration with application certificate thumbpriint authentication fails 

The following fails
Export-M365DSCConfiguration -Path $Path -FileName $FileName  -ApplicationId $ApplicationId -CertificateThumbprint $CertificateThumbprint -TenantId $TenantId -Components  PPAdminDLPPolicy

While the following works

Add-PowerAppsAccount -Endpoint prod -TenantID $tenantId -ApplicationId $applicationId -CertificateThumbprint $CertificateThumbprint -Verbose
Get-DlpPolicy

Verbose logs showing the problem

[2025/02/26 05:04:45]
{InvalidOperation}
System.Net.WebException: The remote server returned an error: (403) Forbidden.
   at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
   at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
"Error during Export:"
at Invoke-M365DSCPowerPlatformRESTWebRequest, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.219.2\Modules\WorkloadHelpers\M365DSCPowerPlatformRESTHelper.psm1: line 31
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.219.2\DSCResources\MSFT_PPAdminDLPPolicy\MSFT_PPAdminDLPPolicy.psm1: line 435
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.219.2\Modules\M365DSCReverse.psm1: line 689
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.219.2\Modules\M365DSCUtil.psm1: line 1491
at <ScriptBlock>, <No file>: line 1
TenantId: hfsgdev.onmicrosoft.com



[2025/02/26 05:04:45]
{InvalidOperation}
System.Net.WebException: The remote server returned an error: (403) Forbidden.
   at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
   at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
"Error during Export:"
at Invoke-M365DSCPowerPlatformRESTWebRequest, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.219.2\Modules\WorkloadHelpers\M365DSCPowerPlatformRESTHelper.psm1: line 31
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.219.2\DSCResources\MSFT_PPDLPPolicyConnectorConfigurations\MSFT_PPDLPPolicyConnectorConfigurations.psm1: line 414
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.219.2\Modules\M365DSCReverse.psm1: line 689
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.219.2\Modules\M365DSCUtil.psm1: line 1491
at <ScriptBlock>, <No file>: line 1
TenantId: hfsgdev.onmicrosoft.com



[2025/02/26 05:05:46]
{InvalidOperation}
System.Net.WebException: The remote server returned an error: (403) Forbidden.
   at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
   at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
"Error during Export:"
at Invoke-M365DSCPowerPlatformRESTWebRequest, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.219.2\Modules\WorkloadHelpers\M365DSCPowerPlatformRESTHelper.psm1: line 31
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.219.2\DSCResources\MSFT_PPPowerAppPolicyUrlPatterns\MSFT_PPPowerAppPolicyUrlPatterns.psm1: line 402
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.219.2\Modules\M365DSCReverse.psm1: line 689
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.219.2\Modules\M365DSCUtil.psm1: line 1491
at <ScriptBlock>, <No file>: line 1
TenantId: hfsgdev.onmicrosoft.com

Environment Information + PowerShell Version

OsName               : Microsoft Windows 11 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 22621.1.amd64fre.ni_release.220506-1250
OsLanguage           : en-US
OsMuiLanguages       : {en-US}



PS C:\Users\GC89140>
PS C:\Users\GC89140> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.22621.4391
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.4391
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
@KuotingChiu
Copy link
Author

Today's newly release DSC module 1.25.226.1 seems to address the issue. Thank you!

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