Skip to content

fix(MCP): Fix ManagedServiceIdentity auth for Consumption MCP connections#9208

Open
rllyy97 wants to merge 1 commit into
mainfrom
rileyevans/fix/consumption-mcp-identity
Open

fix(MCP): Fix ManagedServiceIdentity auth for Consumption MCP connections#9208
rllyy97 wants to merge 1 commit into
mainfrom
rileyevans/fix/consumption-mcp-identity

Conversation

@rllyy97
Copy link
Copy Markdown
Contributor

@rllyy97 rllyy97 commented May 22, 2026

Commit Type

  • feature - New functionality
  • fix - Bug fix
  • refactor - Code restructuring without behavior change
  • perf - Performance improvement
  • docs - Documentation update
  • test - Test-related changes
  • chore - Maintenance/tooling

Risk Level

  • Low - Minor changes, limited scope
  • Medium - Moderate changes, some user impact
  • High - Major changes, significant user/system impact

What & Why

Fixes #9205 — MCP connections using ManagedServiceIdentity auth in Consumption SKU are missing the identity field in the listMcpTools API request, causing failures for user-assigned managed identity scenarios.

The Consumption connector's MCP handling had two gaps compared to the Standard connector:

  1. Managed MCP path sent a bare { connection: { id } } without connectionProperties or authentication info, so the backend had no identity context.
  2. Built-in MCP _buildMcpAuthentication only read identity from connectionProperties['identity'] (which is never populated by the MCP manifest), with no fallback to the workflow's managed identity configuration.

This PR aligns Consumption with Standard by calling WorkflowService().getAppIdentity() to derive the user-assigned identity resource ID in both paths.

Impact of Change

  • Users: Consumption workflows using MCP connectors with user-assigned managed identity will now correctly send identity in the listMcpTools request, unblocking tool discovery.
  • Developers: No API changes. WorkflowService and ResourceIdentityType are now imported in the Consumption connector service.
  • System: No architectural changes. Adds a synchronous call to WorkflowService().getAppIdentity() which is already available in all host environments.

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in:

Updated connector.spec.ts with InitWorkflowService mock for managed MCP and _buildMcpAuthentication MSI test blocks. All 68 tests pass (38 Consumption + 30 Standard).

Contributors

Screenshots/Videos

N/A — no visual changes.

…9205)

Align Consumption connector with Standard for MCP connections:

- Managed MCP path: build connectionProperties with MSI auth and user-assigned identity from WorkflowService().getAppIdentity()

- Built-in MCP _buildMcpAuthentication: add WorkflowService fallback for identity when not in parameterValues

- Remove debug console.log statements

- Update tests with WorkflowService mock initialization
Copilot AI review requested due to automatic review settings May 22, 2026 02:34
@github-actions
Copy link
Copy Markdown
Contributor

🤖 AI PR Validation Report

PR Review Results

Thank you for your submission! Here's detailed feedback on your PR title and body compliance:

PR Title

  • Current: fix(MCP): Fix ManagedServiceIdentity auth for Consumption MCP connections
  • Issue: None — the title is specific, descriptive, and clearly communicates the scope and intent.
  • Recommendation: No change needed.

Commit Type

  • Properly selected (fix).
  • Only one commit type is checked, which is correct.

Risk Level

  • The selected risk level (Medium) is reasonable for a targeted auth-path fix with user impact.
  • Advised risk is medium, which matches the submitter’s selection.

What & Why

  • Current: Clearly explains the bug, root cause, and why the change is needed.
  • Issue: None blocking. This is a strong summary.
  • Recommendation: Optional: shorten slightly if you want a more concise PR body, but it is already acceptable.

Impact of Change

  • The impact section is specific and aligned with the code change.
  • Recommendation:
    • Users: Good as written.
    • Developers: Good as written.
    • System: Good as written.

Test Plan

  • Unit tests were added/updated in the diff, which satisfies the test-plan requirement.
  • No E2E tests are required because unit tests are present.
  • The manual testing checkbox being unchecked is fine.

⚠️ Contributors

  • Current: Blank.
  • Issue: Not required, but it would be helpful to acknowledge any PMs/designers/engineers who contributed context or review input.
  • Recommendation: Add contributors if anyone materially helped with the fix; otherwise this can stay blank.

Screenshots/Videos

  • Assessment: N/A — no visual changes.
  • Recommendation: None needed.

Summary Table

Section Status Recommendation
Title No change needed
Commit Type No change needed
Risk Level No change needed
What & Why No change needed
Impact of Change No change needed
Test Plan Unit tests in diff satisfy the test plan
Contributors ⚠️ Optional: add contributors if applicable
Screenshots/Videos No visual changes, N/A is fine

This PR passes review for title/body compliance. The advised risk level matches the submitted risk level.


Last updated: Fri, 22 May 2026 02:35:48 GMT

@github-actions
Copy link
Copy Markdown
Contributor

📊 Coverage Check

The following changed files need attention:

⚠️ libs/logic-apps-shared/src/designer-client-services/lib/consumption/connector.ts - 70% covered (needs improvement)

Please add tests for the uncovered files before merging.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Consumption SKU MCP tool discovery failures when using ManagedServiceIdentity authentication by ensuring the listMcpTools request includes the appropriate identity (especially for user-assigned managed identities), aligning Consumption behavior more closely with the Standard connector path.

Changes:

  • For managed MCP connections, enriches the managedConnection payload with connectionProperties.authentication and (when applicable) the user-assigned identity derived from WorkflowService().getAppIdentity().
  • For built-in MCP connections, updates _buildMcpAuthentication to fall back to the workflow app’s managed identity configuration when the identity isn’t present in connection parameter values.
  • Updates Consumption connector unit tests to initialize WorkflowService where needed.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
libs/logic-apps-shared/src/designer-client-services/lib/consumption/connector.ts Adds workflow-identity-derived MSI identity into listMcpTools payloads for both managed and built-in MCP paths.
libs/logic-apps-shared/src/designer-client-services/lib/consumption/tests/connector.spec.ts Initializes WorkflowService in tests and updates expectations for the managed MCP payload shape.

const identity = WorkflowService().getAppIdentity?.();
const userIdentity =
equals(identity?.type, ResourceIdentityType.USER_ASSIGNED) && identity?.userAssignedIdentities
? Object.keys(identity.userAssignedIdentities)[0]
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.

If the workflow will have multiple user managed identities, this will select the first one by default, irrespective of what user selected. Should we change this to selected user choice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

user managed identity didn't send part of the list mcp tool API in new designer

3 participants