Thursday, May 2, 2024

Permission error when running "Power Platform Backup Environment" in Azure DevOps

 When we run action "Power Platform Backup Environment" in Azure Devops with an App Registration account, we get the error "Principal with id '...' for application *** does not have permission to access the path 'https://10.0.1.21:20414/providers/Microsoft.BusinessAppPlatform/environments/.../backups?api-version=2020-08-01' in tenant ...". This means this account is missing the permission to run the backup. However we cannot setup the permission for it in Power Platform Admin Center for Microsoft 365 Admin Center. You can setup this permission by using powershell with the guideline in this link: https://learn.microsoft.com/en-us/power-platform/admin/powershell-create-service-principal#registering-an-admin-management-application


$appId = "CLIENT_ID_FROM_AZURE_APP"

# Login interactively with a tenant administrator for Power Platform
Add-PowerAppsAccount -Endpoint prod -TenantID $tenantId 

# Register a new application, this gives the SPN / client application same permissions as a tenant admin
New-PowerAppManagementApp -ApplicationId $appId

 After that, the action can run successfully.

No comments:

Post a Comment

Permission error when running "Power Platform Backup Environment" in Azure DevOps

 When we run action "Power Platform Backup Environment" in Azure Devops with an App Registration account, we get the error "P...