Describe the bug
After adding a Microsoft Teams action to a cloud flow invoked by a Power Apps code app, the flow fails with InvokerConnectionOverrideFailed both locally and after pac code push. The same error also breaks the flow in the Power Automate designer. The error references the raw APIM key shared_teams instead of the solution Connection Reference logical name carried by the code app.
Steps to Reproduce
- Scaffold from the code apps starter template.
- Follow Add flows to a code app flow with When Power Apps (V2) calls a flow trigger + Response action. Works end-to-end.
- Add a Microsoft Teams action to the same flow.
- Create a Connection Reference for Teams in the enclosing solution.
npx power-apps add-data-source Answers: API ID shared_teams, "Use connection reference" = Yes, Connection Reference logical name (e.g. new_sharedteams_fbd0a). CLI reports Data source added successfully.
- Run locally (pac code run) and / or pac code push, then invoke the flow from the app.
Expected behavior
Flow executes. Teams action uses the invoker's connection via the registered Connection Reference.
Actual behavior
Flow fails in all three surfaces — local run, published app, and Power Automate designer.
Screenshots or Error Messages
Local (npx power-apps run):
Flow failed: Error: Retrieve operation failure: Failed to acquire access token:
[{"errorName":"Core.ApplicationError","serializedVersion":0,
"message":"Unable to find api with id AppMagic.Services.ServiceError"}]
at _RuntimeDataClient._getAccessToken (runtimeDataClient.ts:316:13)
at _RuntimeDataClient._executeRequest (runtimeDataClient.ts:411:19)
at _RuntimeDataClient.retrieveDataAsync (runtimeDataClient.ts:279:14)
at ConnectorDataOperationExecutor.executeAsync (connectorDataOperationExecutor.ts:322:22)
at DefaultDataOperationOrchestrator.executeAsync (defaultOperationOrchestrator.ts:244:14)
After push (npx power-apps push):
{"code":"InvokerConnectionOverrideFailed",
"message":"Failed to parse invoker connections from trigger 'manual' outputs.
Exception: Could not find any valid connection for connection reference
name 'shared_teams' in APIM header."}
Opening the flow in Power Automate:
Environment information
- Framework, build tool or relevant package used: React + Vite (code apps starter template), npx power-apps CLI, pac CLI 2.2.1
- Any connection/components: Microsoft Teams (shared_teams), Logic flows (shared_logicflows)
Describe the bug
After adding a Microsoft Teams action to a cloud flow invoked by a Power Apps code app, the flow fails with InvokerConnectionOverrideFailed both locally and after pac code push. The same error also breaks the flow in the Power Automate designer. The error references the raw APIM key shared_teams instead of the solution Connection Reference logical name carried by the code app.
Steps to Reproduce
npx power-apps add-data-sourceAnswers: API ID shared_teams, "Use connection reference" = Yes, Connection Reference logical name (e.g. new_sharedteams_fbd0a). CLI reports Data source added successfully.Expected behavior
Flow executes. Teams action uses the invoker's connection via the registered Connection Reference.
Actual behavior
Flow fails in all three surfaces — local run, published app, and Power Automate designer.
Screenshots or Error Messages
Local (
npx power-apps run):After push (
npx power-apps push):Opening the flow in Power Automate:
Environment information