-
Notifications
You must be signed in to change notification settings - Fork 527
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
Exported PPTenantIsolationSettings invalid, cannot be converted #3179
Comments
This looks like a discrepancy between the admin ui and the PowerShell cmdLets: https://learn.microsoft.com/en-us/power-platform/admin/cross-tenant-restrictions The PowerShell cmdLets are not really documented, what values can be passed along... |
Out of curiosity, if you where to connect to Power Platform using an admin account instead of a service principal. Are you getting the same error?
If you aren't getting any error by using credentials, then it's a permission issue on your service principal. Make sure your app is registered as a Power App one by following the steps at: |
Thanks for the quick response! Yes, seems like that is the issue indeed! When I use a service principal it looks like the export works: PS C:\> Export-M365DSCConfiguration -CertificateThumbprint $Cert.Thumbprint -TenantId $T -ApplicationId $AppID -Components @("PPTenantIsolationSettings")
Exporting Microsoft 365 configuration for Components: PPTenantIsolationSettings
Authentication methods specified:
- Service Principal with Certificate Thumbprint
[1/1] Extracting [PPTenantIsolationSettings] using {CertificateThumbprint}...✅
⌛ Export took {4 seconds} But in reality it doesn't: PS C:\> Connect-M365Tenant -Workload PowerPlatforms -CertificateThumbprint $Cert.Thumbprint -ApplicationId $AppID -TenantId $T
PS C:\> Get-PowerAppTenantIsolationPolicy -TenantId $T
StatusCode : 403
StatusDescription : Forbidden
Headers : {Strict-Transport-Security, x-ms-islandgateway, x-ms-request-id, x-ms-correlation-request-id...}
Error : @{code=Forbidden; message=The service principal with id '01234567-0123-0123-0123-0123456789ab' for application
bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb does not have permission to access the path 'https://10.0.6.57:20060/providers/PowerPlatform.Governan
cccccccc-cccc-cccc-cccc-cccccccccccc.}
Message : The service principal with id '01234567-0123-0123-0123-0123456789ab' for application bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb does not have
permission to access the path 'https://10.0.6.57:20060/providers/PowerPlatform.Governance/v1/tenants/foo.onmicrosoft.com/tenant
IsolationPolicy?api-version=2020-06-01' in tenant cccccccc-cccc-cccc-cccc-cccccccccccc.
Internal : System.Net.HttpWebResponse Using credentials instead works! I hadn't registered the service principal as a "Power App". Do you happen to know if that procedure is available via non-interactive Graph API (using oauth popup as the only interactive part for example)? |
Note that I'd probably want to keep the "Bug" label for this issues, and resolve it when |
Details of the scenario you tried and the problem that is occurring
I exported a clean developer tenant with default sample data (https://developer.microsoft.com/en-us/microsoft-365/dev-program).
The configuration was exported using certificate thumbprint and default mode, without any errors:
Verbose logs showing the problem
When I try to convert it the script silently fails (see #3178). Running
$ErrorActionPreference = 'Stop' ;
gives me the error:The entry in
M365TenantConfig.ps1
do indeed haveDirection
set tounknown
:Running
Get-PowerAppTenantIsolationPolicy -TenantId $T
fails, which probably is the issue here. The failure isn't detected by export that thinks it got a valid record:Suggested solution to the issue
Threat failed export as an error instead of returning an invalid file that can't be converted.
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
.The operating system the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)
The text was updated successfully, but these errors were encountered: