Skip to content

InvokerConnectionOverrideFailed after adding Teams action to invoked flow #322

@DefinitivJakob

Description

@DefinitivJakob

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

  1. Scaffold from the code apps starter template.
  2. Follow Add flows to a code app flow with When Power Apps (V2) calls a flow trigger + Response action. Works end-to-end.
  3. Add a Microsoft Teams action to the same flow.
  4. Create a Connection Reference for Teams in the enclosing solution.
  5. 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.
  6. 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:

Image

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions