fix(MCP): Fix ManagedServiceIdentity auth for Consumption MCP connections#9208
fix(MCP): Fix ManagedServiceIdentity auth for Consumption MCP connections#9208rllyy97 wants to merge 1 commit into
Conversation
…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
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:✅ PR Title
✅ Commit Type
✅ Risk Level
✅ What & Why
✅ Impact of Change
✅ Test Plan
|
| 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
📊 Coverage CheckThe following changed files need attention:
Please add tests for the uncovered files before merging. |
There was a problem hiding this comment.
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
managedConnectionpayload withconnectionProperties.authenticationand (when applicable) the user-assigned identity derived fromWorkflowService().getAppIdentity(). - For built-in MCP connections, updates
_buildMcpAuthenticationto 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
WorkflowServicewhere 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] |
There was a problem hiding this comment.
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?
Commit Type
Risk Level
What & Why
Fixes #9205 — MCP connections using ManagedServiceIdentity auth in Consumption SKU are missing the
identityfield in thelistMcpToolsAPI request, causing failures for user-assigned managed identity scenarios.The Consumption connector's MCP handling had two gaps compared to the Standard connector:
{ connection: { id } }withoutconnectionPropertiesor authentication info, so the backend had no identity context._buildMcpAuthenticationonly read identity fromconnectionProperties['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
listMcpToolsrequest, unblocking tool discovery.WorkflowServiceandResourceIdentityTypeare now imported in the Consumption connector service.WorkflowService().getAppIdentity()which is already available in all host environments.Test Plan
Updated
connector.spec.tswithInitWorkflowServicemock for managed MCP and_buildMcpAuthenticationMSI test blocks. All 68 tests pass (38 Consumption + 30 Standard).Contributors
Screenshots/Videos
N/A — no visual changes.