fix(portal): Fix agent AzureOpenAI resource IDs for conversational agents#9256
Open
lambrianmsft wants to merge 1 commit into
Open
fix(portal): Fix agent AzureOpenAI resource IDs for conversational agents#9256lambrianmsft wants to merge 1 commit into
lambrianmsft wants to merge 1 commit into
Conversation
Ensure AzureOpenAI agent connections persist account-level resource IDs while preserving MicrosoftFoundry model suffix handling. Normalize agent connection RBAC scopes before role lookup and assignment, and add focused unit coverage for serialization, scope normalization, and model type fallback behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
🤖 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
|
| Section | Status | Recommendation |
|---|---|---|
| Title | ✅ | None required |
| Commit Type | ✅ | None required |
| Risk Level | ✅ | Medium is appropriate |
| What & Why | ✅ | Optional wording polish only |
| Impact of Change | ✅ | Optional detail could be added |
| Test Plan | ✅ | Unit tests present in diff |
| Contributors | ✅ | Optional to add contributors |
| Screenshots/Videos | ✅ | Not required for this change |
This PR passes review for title/body compliance. The advised risk level is not higher than the submitter’s selection.
Last updated: Sat, 06 Jun 2026 03:43:12 GMT
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes conversational agent connection serialization so AzureOpenAI connections persist the account-level Cognitive Services resource ID (instead of incorrectly saving /models), while preserving the /models suffix for MicrosoftFoundry model connections. It also normalizes the resource scope used for RBAC role detection/assignment and adds targeted unit coverage for the updated behaviors.
Changes:
- Update agent connection serialization to only append
/modelsforagentModelType=MicrosoftFoundry, and otherwise persist an account-level resource ID. - Normalize the RBAC role-assignment scope by stripping a terminal
/modelsbefore querying/assigning roles and before invalidating role-assignment cache keys. - Add unit tests covering serialization outcomes, “no double-append” behavior, and model-type fallback logic based on resource ID shape.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| libs/logic-apps-shared/src/designer-client-services/lib/standard/index.ts | Re-exports the new normalization helper from the standard connection module. |
| libs/logic-apps-shared/src/designer-client-services/lib/standard/connection.ts | Adjusts agent connection resourceId persistence rules and introduces a normalization helper for role-assignment scope. |
| libs/logic-apps-shared/src/designer-client-services/lib/standard/tests/connection.spec.ts | Adds unit tests for AzureOpenAI vs MicrosoftFoundry serialization and normalization behavior. |
| libs/logic-apps-shared/src/designer-client-services/lib/connection.ts | Extends ConnectionCreationInfo to carry operationParameterValues needed for model-type-aware serialization. |
| libs/designer/src/lib/ui/panel/connectionsPanel/createConnection/createConnectionInternal.tsx | Passes operationParameterValues into ConnectionCreationInfo during connection creation. |
| libs/designer/src/lib/core/actions/bjsworkflow/test/connectionsAgent.spec.ts | Updates regression tests for model-type resolution using shared regexes and adds MicrosoftFoundry fallback coverage. |
| libs/designer-v2/src/lib/ui/panel/connectionsPanel/createConnection/createConnectionInternal.tsx | Same as v1: passes operationParameterValues through to connection creation. |
| libs/designer-v2/src/lib/core/actions/bjsworkflow/test/connectionsAgentV2.spec.ts | Same as v1: updates regression tests for model-type resolution + MicrosoftFoundry fallback coverage. |
| apps/Standalone/src/designer/app/AzureLogicAppsDesigner/laDesignerV2.tsx | Normalizes RBAC role-assignment scope for agent connections before role lookup/assignment and cache invalidation. |
| apps/Standalone/src/designer/app/AzureLogicAppsDesigner/laDesigner.tsx | Same as v2: normalizes RBAC role-assignment scope for agent connections. |
Comment on lines
157
to
+161
| export const foundryServiceConnectionRegex = /\/Microsoft\.CognitiveServices\/accounts\/[^/]+\/projects\/[^/]+/; | ||
| export const apimanagementRegex = /\/Microsoft\.ApiManagement\/service\/[^/]+\/apis\/[^/]+/; | ||
| export const microsoftFoundryModelsRegex = /\/models$/; | ||
| export const normalizeAgentConnectionResourceIdForRoleAssignment = (resourceId?: string): string => | ||
| resourceId?.replace(microsoftFoundryModelsRegex, '') ?? ''; |
ccastrotrejo
approved these changes
Jun 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ensure AzureOpenAI agent connections persist account-level resource IDs while preserving MicrosoftFoundry model suffix handling. Normalize agent connection RBAC scopes before role lookup and assignment, and add focused unit coverage for serialization, scope normalization, and model type fallback behavior.
Commit Type
Risk Level
What & Why
Validation errors occurred after Azure OpenAI resources were selected for the agent. Saving caused validation errors due to an incorrect UX contract. Updated the contract to align with the contract.
Impact of Change
Users should be able to create agent connections from Azure OpenAI.
Test Plan
Contributors
Screenshots/Videos