Skip to content

Fix Power Apps package exports in sovereign clouds#5408

Merged
gautamdsheth merged 2 commits into
devfrom
gautamdsheth-fix-gov-powerapps-audience
Jul 20, 2026
Merged

Fix Power Apps package exports in sovereign clouds#5408
gautamdsheth merged 2 commits into
devfrom
gautamdsheth-fix-gov-powerapps-audience

Conversation

@gautamdsheth

Copy link
Copy Markdown
Collaborator

Before creating a pull request, make sure that you have read the contribution file located at

https://github.com/pnp/powerShell/blob/dev/CONTRIBUTING.md

Type

  • Bug Fix
  • New Feature
  • Sample

Related Issues?

Follow-up to #5404.

What is in this Pull Request ?

Power Apps and Business Applications package endpoints in sovereign clouds require the cloud-specific Power Apps service audience. Some Power Apps and BAP callers still used the ARM token, causing government cloud calls such as Export-PnPPowerApp to fail even after the endpoint mapping fix in #5404.

This PR updates Export-PnPPowerApp to use the Power Apps service token for all BAP package calls and to pass the current Azure environment into each BAP helper call. It also switches Get-PnPPowerPlatformCustomConnector to the Power Apps request helper, aligns its admin list endpoint, and applies the same BAP token fix to ZIP package flow export/import paths while leaving ProcessSimple flow APIs on ARM.

Documentation and the current nightly changelog now list the additional Power Apps audience requirement for the affected cmdlets.

Guidance

N/A

Use the cloud-specific Power Apps service audience for Power Apps and Business Applications package endpoints that were still using the ARM token.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 20, 2026 18:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Power Apps and BAP requests to use cloud-specific Power Apps authentication in sovereign clouds.

Changes:

  • Uses Power Apps tokens for package export/import operations.
  • Updates custom connector requests and admin endpoints.
  • Documents the additional audience requirement.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ImportFlow.cs Uses Power Apps authentication for imports.
ExportFlow.cs Uses Power Apps authentication for ZIP exports.
ExportPowerApp.cs Corrects package export authentication and environment routing.
GetPowerPlatformCustomConnector.cs Corrects authentication and admin listing.
Import-PnPFlow.md Documents Power Apps permission.
Export-PnPFlow.md Documents ZIP export permission.
Export-PnPPowerApp.md Documents Power Apps permission.
Get-PnPPowerPlatformCustomConnector.md Documents Power Apps permission.
CHANGELOG.md Records the sovereign-cloud fixes.

Comment thread CHANGELOG.md
- Fixed issue with Azure functions not working properly when we also have other modules like Az which rely on .NET 10. [#5393](https://github.com/pnp/powershell/pull/5393)
- Fixed multi-geo compatibility issues with `Get-PnPGeoAdministrator` response handling, `Set-PnPMultiGeoExperience` confirmation prompts, and unsupported-version errors for `Set-PnPMultiGeoCompanyAllowedDataLocation`. [#5401](https://github.com/pnp/powershell/pull/5401)
- Fixed Power Apps cmdlets to use cloud-specific Power Apps service audiences and endpoints for government clouds. [#5404](https://github.com/pnp/powershell/pull/5404)
- Fixed `Export-PnPPowerApp`, `Get-PnPPowerPlatformCustomConnector`, `Export-PnPFlow -AsZipPackage`, and `Import-PnPFlow` to use the Power Apps service audience when calling Power Apps and Business Applications endpoints in sovereign clouds.
@gautamdsheth
gautamdsheth merged commit b219bb6 into dev Jul 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants