Processes in Microsoft 365 for setting up Office apps, redeeming product keys, and activating licenses.
No documented header or API-version change makes this BAP app-only request equivalent to an interactive recovery; because the same registered service principal recovers other environments and this environment recovers interactively, capture the failed request details and open a Microsoft support case for an environment-specific recovery-path failure.
What can be concluded
- The service principal is generally authorized correctly. Power Platform supports service-principal authentication for environment management, and a registered management application is treated similarly to a Power Platform administrator. Registration is tenant-level; the documentation does not state that the application must also have been a Dataverse application user in every environment it manages.^1^
- The environment is recoverable. The successful admin-center recovery proves that it was still eligible for recovery and that storage capacity or the normal recovery window did not block this instance. The standard recovery window is seven days, with a 28-day exception for production environments containing Dynamics 365 applications.^2^
- The error indicates a failed directory-principal lookup, but it does not identify the principal’s role. The available Microsoft documentation does not define this BAP error contract or say whether that GUID is the caller, creator, owner, “used by” user, or another environment-associated identity. Do not infer that it is the caller merely because the operation used app-only authentication.
- Trial status and missing pre-deletion application-user membership are not documented triggers. There is no published requirement that a Trial environment, or an environment created by a particular user, needs a resolvable owner during recovery. Likewise, environment-level application-user creation is documented for connecting to Dataverse, not as a prerequisite for tenant-level deleted-environment recovery.^3^
Therefore, the observed difference between environments cannot be assigned confidently to Trial type, creator/owner state, or application-user membership from the published contract.
Collect evidence before escalation
- Record the complete response metadata from the failing BAP call:
- UTC timestamp
- Environment ID
- Tenant ID
- HTTP status and complete response body
-
x-ms-request-id, correlation ID, activity ID, or similar response headers - Token claims excluding the token itself, especially
tid,appid,oid, androles
- Compare the displayed principal ID with the token claims.
- If it equals
oid, it is the calling tenant service-principal object ID. - If it equals neither
oidnorappid, it is evidence that the backend is resolving some other identity. - The masked suffix alone is insufficient to establish a match.
- If it equals
- Search active and deleted Entra objects using the full GUID. Check users, service principals, groups, and deleted items. If it is a soft-deleted service principal, Entra PowerShell can identify and restore it:^4^
Connect-Entra -Scopes 'Application.Read.All'
Get-EntraDeletedServicePrincipal -All |
Where-Object Id -eq '<full-principal-id>'
# Restore only if the returned object is confirmed as the required identity.
Connect-Entra -Scopes 'Application.ReadWrite.All'
Restore-EntraDeletedDirectoryObject -Id '<full-principal-id>'
Restoring a directory object changes tenant identity state, so first confirm that the GUID is the intended object. Treat this as an investigative conditional step—not a documented fix for environment recovery.
- Search Entra audit records around environment creation and deletion. Historical audit data can establish whether the GUID represented the caller, creator, or another principal; a deleted object may otherwise appear only as “Identity not found.”^5^
Supported reproduction for the support case
Run the documented recovery cmdlet under the same service principal. This tests the supported PowerShell wrapper without switching to an interactive administrator:^6^
Add-PowerAppsAccount -Endpoint prod `
-TenantID $tenantId `
-ApplicationId $appId `
-ClientSecret $secret
Recover-AdminPowerAppEnvironment `
-EnvironmentName $environmentId `
-WaitUntilFinished $true `
-Verbose
The cmdlet has an optional -ApiVersion, defaulting to 2019-05-01, but Microsoft does not document changing it as a remedy for this principal-resolution error. If it fails identically, attach its verbose output to the case.
The Power Platform API /restore operation should not be pursued further: as observed, backup restoration over an existing environment is a different operation from recovering a soft-deleted environment.
Support request
Open the request while the environment remains in its recovery window and include:
- Both successful and failing deleted-environment IDs
- Confirmation that the same app-only identity succeeds for other recoveries
- Confirmation that interactive recovery succeeds for the failing Trial environment
- Full missing principal GUID
- Whether it exists as an active or deleted Entra object
- BAP request/response headers and timestamp
- PowerShell reproduction output
- Environment creation type, creator, and deletion path if available
Ask support to identify which environment metadata field supplied the unresolved principal ID and whether app-only recovery is invoking an undocumented user-resolution dependency for that environment.
References