Hello,
Unfortunately, we have encountered a problem when using the following PowerShell or API.
New-PowerAppDlpPolicyExemptResources -TenantId xxx -PolicyName xxx -NewDlpPolicyExemptResources $exemptResources
https://api.bap.microsoft.com/providers/PowerPlatform.Governance/v1/tenants/xxx/policies/bb8aa1cf-071e-4917-9f19-f388019ff3fe/exemptResources
Initial scenario:
We want to set a DLP for the default environment. Existing apps (approx. 200) and flows (approx. 800) should remain unaffected. The DLP should only apply to new apps and workflows.
But at a certain size of the string to be transmitted of the object "$excemptResources" there is unfortunately an internal server error.
100 resources will work, 200 resources also, but then it will fail at a certain size.

A command to submit individual apps and flows to exclude them does not exist or is not documented.
Question:
How can we achieve to exclude all resources (approx. 1000) at once from a DLP?
Power Shell Script
cls
#Init Hashtable
$exemptResources = @{
exemptResources = @()
}
#function to Ressources for excemption
function excemptResource($id,$type) {
$exemptResource = @{
id = $id
type = $type
}
$exemptResources.exemptResources += $exemptResource
}
$environment = Get-PowerAppEnvironment -Default
$flows = Get-AdminFlow -EnvironmentName $environment.EnvironmentName
$apps = Get-AdminPowerApp -EnvironmentName $environment.EnvironmentName
#iteration for all flows in this environment
foreach ($flow in $flows) {
Write-Host $flow.DisplayName
excemptResource $flow.Internal.id $flow.Internal.type
}
#iteration for all apps in this environment
foreach ($app in $apps) {
Write-Host $app.DisplayName
excemptResource $app.Internal.id $app.Internal.type
}
#add all current resources as an excemption to a dlp
New-PowerAppDlpPolicyExemptResources -TenantId xxxx -PolicyName ba3ea951-cee9-40d4-987b-ea5677d9266b -NewDlpPolicyExemptResources $exemptResources