Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug] pa app add flow binds to a non-portable connection — flow bindings aren't restored when the Code App is redeployed to a new environment

未关闭
#461 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript

调研方向

从 pa app add flow 的入口点开始,将其连接处理与 pa app add data-source 进行比较,尤其关注 --connection-ref 和 --solution-id。然后跟踪 pa app push 对 flow connectionReferences 的处理,以及文档化的 pa app list-flows 身份验证路径。完成的标准是:将解决方案导入另一个环境后,流绑定能够恢复;或者在无法解析绑定时,push 会明确发出警告或失败。

由索引模型根据 Issue 内容生成。

描述

bug

Describe the bug

Unlike pa app add data-source, which supports --connection-ref <name> --solution-id <id> to bind through a solution-portable Connection
Reference, pa app add flow has no equivalent option. It always creates a
raw, environment-specific connection for the flow. As a result, a Code
App's Power Automate flow bindings are not portable across environments
the way its other data sources are — moving/redeploying the Dataverse
solution and Code App to a new environment does not restore them, and
pa app push doesn't warn that anything is missing.

Steps to Reproduce

  1. Initialize a Code App in a Dev environment, add a flow with
    pa app add flow --flow-id <dev-flow-id>, and pa app push.
  2. Export the Dataverse solution (tables, the flow, its own connection
    references) from Dev and import it into a new environment (UAT/Prod),
    either natively or via Power Platform Pipelines. Reconnect the
    solution's own connection references as prompted.
  3. Push the Code App to the new environment — either interactively, or
    non-interactively as a service principal (pa app push --non-interactive) — reusing the same committed power.config.json.
    The push reports success.
  4. Open the Code App in the new environment's maker portal and check the
    Flows tab.

Expected behavior

Either the flow binding is restored automatically (e.g. resolved by the
flow's portable workflowIdUnique against the new environment), or the
push fails / warns clearly that the flow connection couldn't be resolved
in the target environment.

Actual behavior

The push succeeds silently. The app's Flows tab reads "There are no flows
used in this app," because the committed power.config.json's
connectionReferences for the flow still reference the source
environment's (Dev's) connection, which doesn't exist in the target
environment.

The only documented fix
(https://learn.microsoft.com/en-us/power-apps/developer/code-apps/how-to/add-flows)
is to rerun pa app add flow --flow-id <id> once per flow, interactively,
authenticated against each target environment, and keep a separate
power.config.<env>.json per environment.

We also confirmed this step can't be moved into CI/CD: the
service-principal doc
(https://learn.microsoft.com/en-us/power-apps/developer/code-apps/how-to/use-service-principal)
only documents SP auth for pa app push, never for pa app add flow /
pa app list-flows; the add-flows page phrases the access requirement as
"the person who runs pa app add flow must have access to the flow
and its underlying connections," which reads as user-account-only.

Screenshots or Error Messages

N/A — no error is raised; the maker portal's Flows tab is simply empty in
the target environment after a successful push.

Environment information

  • Framework, build tool or relevant package used: React + TypeScript +
    Vite, @microsoft/power-apps-cli (pa) v1.x
  • Any connection/components: Power Automate solution-aware instant flows
    (Power Apps trigger) via the shared_logicflows connector; also
    Microsoft Dataverse and SharePoint Online data sources (unaffected,
    since those use portable Connection References)

Additional context

This is the one manual, human-in-the-loop step left in an otherwise fully
automated multi-environment CI/CD pipeline (Build → Dev → UAT → Prod via
Azure Pipelines with service-principal auth). Two possible fixes:

  1. Add --connection-ref/--solution-id support to pa app add flow,
    mirroring pa app add data-source, so the flow binding can be made
    solution-portable.
  2. Support (and document) running pa app add flow /
    pa app list-flows under service-principal authentication
    (PA_CLI_USE_SP_AUTH), so this step can be automated in a pipeline
    instead of requiring an interactive maker login per environment.

Happy to share our power.config.<env>.json setup and pipeline YAML
(Azure DevOps) if useful for reproduction.

主要语言
TypeScript
星标
504
派生
145
平均合并
4 小时 3 分钟
30 天内合并 PR
1

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/PowerAppsCodeApps 的其他 Issue

查看 microsoft/PowerAppsCodeApps 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。