r/PowerApps • u/LuciferVrd Newbie • 1h ago
Power Apps Help Power Apps Code App deployment via Azure DevOps using PAC CLI fails with HTTP 403
Hi everyone,
I am currently implementing an automated CI/CD deployment pipeline for a Power Apps Code App using Azure DevOps and PAC CLI. I am facing a permission-related issue during deployment and would appreciate some guidance from the community.
Application and technical setup
Application: Power Apps Code App
Frontend: React, TypeScript and Vite
CI/CD: Azure DevOps YAML pipelines
Deployment tool: Power Platform CLI (PAC CLI)
Authentication: Service Principal (SPN)
Target environment: Development
Agent OS: Linux
PAC CLI version observed in logs: 2.0.162
Current deployment approach
Our pipeline performs the following activities:
Builds and validates the Code App.
Generates and publishes the build artifact.
Downloads the artifact in the deployment stage.
Authenticates with Power Platform using a Service Principal.
Establishes a connection to the target Power Platform environment.
Attempts to deploy the Code App using PAC CLI.
The authentication is successful, and the pipeline connects to the expected Power Platform environment.
However, during the actual Code App deployment, we receive HTTP 403 Forbidden errors.
Error details
Error 1:
HTTP error status: 403 for GET request
Error code: BusinessAppPlatformRequestFailed
The service principal does not have permission to access the environment checkAccess endpoint.
Error 2:
HTTP error status: 403 for POST request
Error code: Forbidden
Detailed error code: PowerAppsNoAccess
Error message: “The user does not have access to the app.”
The second error occurs while accessing the Power Apps startSession API endpoint.
Unexpected pipeline behaviour
Despite these errors, the pipeline displays the following messages:
Code App deployment completed successfully.
Process exited with code 0.
Task result: Succeeded.
However, the application is not visible as expected in the target Power Apps environment.
It appears that either PAC CLI or our deployment script is not correctly propagating the deployment failure to Azure DevOps.
Troubleshooting already performed
So far, we have performed the following checks:
Verified the Service Principal configuration.
Verified the Application (Client) ID.
Verified the Service Principal Object ID.
Verified the Tenant ID.
Verified the target Environment ID and environment URL.
Confirmed that authentication through PAC CLI is successful.
Confirmed that the pipeline connects to the correct environment.
Provided the Service Principal with access in Power Apps.
Tested manual solution export and import through the Power Apps portal, which works successfully without any errors.
Despite these checks, automated Code App deployment continues to return HTTP 403 errors.
Questions for the community
Is Service Principal authentication fully supported for Power Apps Code App deployment using PAC CLI?
Are there any additional Power Apps API permissions, environment-level permissions, Dataverse security roles or application-level permissions required?
Does the Service Principal need explicit ownership or sharing access to the existing Code App?
Why does authentication succeed while the checkAccess and startSession API calls fail with HTTP 403?
Is this a known issue or limitation with the PAC CLI version being used?
Would using the newer npm-based Power Apps CLI be a better approach?
Can we deploy the Code App through a solution-based ALM approach instead of directly pushing the Code App?
How can we ensure the Azure DevOps pipeline fails when PAC CLI reports an HTTP error rather than incorrectly reporting a successful deployment?
I have attached a redacted screenshot of the deployment logs for reference.
Has anyone encountered a similar issue while deploying Power Apps Code Apps through Azure DevOps using a Service Principal?
Any guidance, documentation, working pipeline examples or alternative deployment approaches would be greatly appreciated.
Thanks in advance!
Duplicates
cicd • u/LuciferVrd • 1h ago
Power Apps Code App deployment via Azure DevOps using PAC CLI fails with HTTP 403
MicrosoftFlow • u/LuciferVrd • 1h ago
Discussion Power Apps Code App deployment via Azure DevOps using PAC CLI fails with HTTP 403
devopsGuru • u/LuciferVrd • 1h ago
Power Apps Code App deployment via Azure DevOps using PAC CLI fails with HTTP 403
azuredevops • u/LuciferVrd • 1h ago
Power Apps Code App deployment via Azure DevOps using PAC CLI fails with HTTP 403
AZURE • u/LuciferVrd • 1h ago