fix(MCP): Fix ManagedServiceIdentity auth for MCP connections#9208
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
✅ Contributors
✅ Screenshots/Videos
Summary Table
This PR passes review for title and body compliance.Last updated: Tue, 26 May 2026 16:42:58 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. |
…nections - Update designer-v2 dynamicdata.ts to extract identity from connectionReference - Update designer-v2 queries/connector.ts to accept and pass identity parameter - Update ConnectorService interface to accept optional identity parameter - Update consumption/standard connector implementations to use passed identity for MCP connections - When identity is provided, use it instead of picking first identity from WorkflowService - This ensures user-selected managed identity is correctly threaded through all MCP calls
…ctor When no identity is explicitly threaded from the connection reference, fall back to WorkflowService().getAppIdentity() to resolve user-assigned identity. This preserves backward compatibility for callers that don't pass identity (e.g., designer-v1).
Commit Type
Risk Level
What & Why
Completes fix for #9205 — MCP connections using ManagedServiceIdentity auth in Consumption SKU. This PR adds identity threading to ensure the user-selected managed identity is correctly passed through all dynamic values requests.
Original Issue (#9205): Consumption MCP connections were missing the
identityfield in thelistMcpToolsAPI request, causing failures for user-assigned managed identity scenarios.This PR Adds: Identity threading through the dynamic values pipeline to ensure consistency with Standard SKU:
getListDynamicValuesextracts the selected identity fromconnectionReference.connectionProperties.authentication.identityqueries/connector.tsto theConnectorServicelayerWorkflowServiceImpact of Change
listMcpToolsand dynamic values requests, ensuring consistent tool discovery and parameters.identityparameter ingetListDynamicValuesTest Plan
Updated connector tests with
InitWorkflowServicemock for managed identity scenarios. All existing tests pass:connector.spec.ts: 68 tests pass (38 Consumption + 30 Standard)dynamicdata.spec.ts(designer-v2): 8 tests passdynamicdata.spec.ts(designer-v1): 8 tests passContributors
Screenshots/Videos
N/A — no visual changes.