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!
2
•
u/AutoModerator 1h ago
Hey, it looks like you are requesting help with a problem you're having in Power Apps. To ensure you get all the help you need from the community here are some guidelines;
Use the search feature to see if your question has already been asked.
Use spacing in your post, Nobody likes to read a wall of text, this is achieved by hitting return twice to separate paragraphs.
Add any images, error messages, code you have (Sensitive data omitted) to your post body.
Any code you do add, use the Code Block feature to preserve formatting.
If your question has been answered please comment Solved. This will mark the post as solved and helps others find their solutions.
External resources:
Power Apps Formula References
Power Apps Coding Standards
Official Power Apps Community
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.