Repository navigation
Publish the Code App with the Power Apps CLI, per Microsoft's guidance for service principals - #21
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The real service-principal publish remains untested, required app permissions are absent, and the current implementation plan is inconsistent with the new deployment path.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Migrates CI/CD Code App publishing from PAC to Microsoft’s service-principal-supported Power Apps CLI flow.
Changes:
- Adds pinned
pa app push --non-interactivedeployment. - Passes service-principal credentials directly to deployment steps.
- Updates deployment documentation and removes obsolete PAC authentication.
| File | Description |
|---|---|
README.md |
Documents one-time app sharing. |
package.json |
Pins the Power Apps CLI. |
package-lock.json |
Locks CLI dependencies. |
.github/workflows/deploy.reusable.yml |
Updates development deployment authentication. |
.github/workflows/promote-prod.yml |
Updates production deployment authentication. |
scripts/deploy/deploy-app.ps1 |
Implements noninteractive pa publishing. |
scripts/deploy/auth.ps1 |
Removes obsolete PAC authentication. |
scripts/deploy/migrate-data.ps1 |
Updates authentication commentary. |
scripts/ci/render-power-config.ps1 |
Updates publishing documentation. |
specs/003-github-actions-cicd/tasks.md |
Records the deployment migration. |
specs/003-github-actions-cicd/contracts/deploy.contract.md |
Updates the deployment contract. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+321
to
+324
| - `scripts/deploy/deploy-app.ps1` runs `pa app push --non-interactive` from `@microsoft/power-apps-cli`, pinned at 1.2.0 as a dev dependency so `npm ci` installs it with a locked integrity hash. It replaces `pac --log-to-console code push --solutionName MedTrackSolution`, the workaround from the section above. | ||
| - `deploy.reusable.yml` and `promote-prod.yml`: the "Authenticate to Power Platform" step (`pac auth create`) is removed, and the three service principal secrets are passed to "Deploy Code App" instead. | ||
| - `scripts/deploy/auth.ps1` is deleted: nothing else used the `pac auth` profile. The `PAC_CLI_SPN_SECRET` workaround it carried is no longer needed. | ||
| - The local `build` script (`pac code push` under the developer's own sign-in) is unchanged. |
microsoft/PowerAppsCodeApps#394 was closed with official guidance: a service principal needs edit access to the app itself, granted once by the app's owner, and must publish with the npm-based Power Apps CLI, not the PAC CLI. - deploy-app.ps1 runs `pa app push --non-interactive`, signed in as the service principal through PA_CLI_* environment variables; replaces `pac code push --solutionName` - @microsoft/power-apps-cli pinned at 1.2.0 as a dev dependency - deploy.reusable.yml, promote-prod.yml: drop the `pac auth create` step and pass the service principal secrets to "Deploy Code App" - remove scripts/deploy/auth.ps1, now unused - README and spec 003 docs describe the one-time app share Not yet run in the pipeline. The app must be shared with each environment's service principal before the next deploy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kippolitov
force-pushed
the
fix/code-app-push-with-pa-cli
branch
from
October 6, 2026 02:50
95af9a2 to
ef9b025
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
microsoft/PowerAppsCodeApps#394 (the HTTP 500 from
pac code pushunder a service principal) was closed on 2026-08-19 with official guidance, now documented in Publish Power Apps code apps with a service principal:pa app share;pa app push --non-interactive, using the npm-based Power Apps CLI, not the PAC CLI.This pipeline has been publishing with
pac code push --solutionName MedTrackSolution, a workaround found in that issue's comments. This change moves it to the documented path.What changes
scripts/deploy/deploy-app.ps1runspa app push --non-interactive. It signs the CLI in as the service principal through thePA_CLI_*environment variables, which it sets from the existingPP_CLIENT_ID,PP_CLIENT_SECRETandPP_TENANT_IDsecrets. No new secrets or variables.@microsoft/power-apps-cliis pinned at 1.2.0 as a dev dependency, sonpm ciinstalls it with a locked integrity hash and the script never downloads another version.deploy.reusable.yml(used bydeploy-dev) andpromote-prod.yml: the "Authenticate to Power Platform" step (pac auth create) is removed and the three secrets are passed to "Deploy Code App".scripts/deploy/auth.ps1is deleted; nothing else used thepac authprofile.npm run buildscript still usespac code pushunder the developer's own sign-in. Only the pipeline is affected.Required before merging
deploy-devruns on merge, and its "Deploy Code App" step will fail until the app is shared. As of 2026-10-05 neither service principal has a permission on its environment's app; only the owner does. The owner runs, once per environment, from a folder whosepower.config.jsonpoints at that environment's app:Testing
deploy-devrun after merging is the test. If it fails, reverting this commit restores the previous method.🤖 Generated with Claude Code