Skip to content

feat(portal): allow editing Azure AI Foundry model - #1411

Open
Vv (dcaiwei) wants to merge 2 commits into
microsoft:mainfrom
dcaiwei:candidate/scope-1386
Open

Vv (dcaiwei) wants to merge 2 commits into
microsoft:mainfrom
dcaiwei:candidate/scope-1386

Conversation

@dcaiwei

Copy link
Copy Markdown

Summary

  • expose only the non-secret Azure AI Foundry model name on key detail responses
  • allow users to update or clear the model while preserving the endpoint and API key
  • mark validation pending and revalidate the deployment after a model change
  • add focused frontend/backend tests, a synthetic Storybook demo, and documentation

Fixes #1386

Demo

Azure AI Foundry model edited from gpt-4.1 to gpt-4.1-mini with synthetic data, followed by background validation.

9.22.mp4

Testing

  • pnpm exec vitest run packages/shared/src/token-manager/types.test.ts apps/token-manager/src/foundry-model.test.ts apps/portal/src/pages/TokenDetail.test.ts — passed (14 tests)
  • pnpm --filter shared build — passed
  • pnpm --filter telemetry build — passed
  • pnpm --filter token-manager build — passed
  • pnpm --filter portal lint — passed
  • pnpm headers:check — passed
  • git diff --check — passed

Documentation and compatibility

Updated docs/architecture/token-manager.md.

The API changes are additive and backward-compatible. No database migration or dependency change is required.

Checklist

  • CLI parity considered — key administration has no corresponding CLI surface today.
  • Added a Storybook story for the updated Portal interaction.
  • No database migration is required.
  • No dependency or notice changes are required.

AI assistance was used while preparing this change. The implementation and test results were reviewed locally before submission.

@dcaiwei

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Unresolved backend consistency, validation, and data-safety issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 High severity · 1 Medium severity

Open (3)
What changed in this PR

Enables editing Azure AI Foundry model names while preserving credentials and triggering revalidation.

Changes:

  • Adds backend model projection, updates, and validation handling.
  • Adds Portal editing UI, tests, and Storybook demo.
  • Updates shared types and documentation.
File Reviewed change
packages/​shared/​src/​token-manager/​types.ts Extends shared key and update request types.
docs/​architecture/​token-manager.md Documents model editing and validation behavior.
apps/​token-manager/​src/​routes.ts Handles model updates and background validation.
apps/​token-manager/​src/​foundry-model.ts Projects and updates Foundry model data.
apps/​token-manager/​src/​foundry-model.test.ts Tests Foundry model helpers.
apps/​portal/​src/​types.ts Adds frontend model types.
apps/​portal/​src/​pages/​TokenDetail.tsx Adds model editing controls and polling behavior.
apps/​portal/​src/​pages/​TokenDetail.test.ts Tests update request construction.
apps/​portal/​src/​pages/​TokenDetail.stories.tsx Adds a synthetic editing demo.
apps/​portal/​src/​pages/​token-detail-utils.ts Builds normalized update requests.
apps/​portal/​src/​lib/​api.ts Documents the expanded update API.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +242 to +246
const updatedFoundrySecret = await updateFoundryModelSecret(
token,
body.model,
store
);
.then(async (validation) => {
const now = new Date();
await collection.updateOne(
{ _id: result._id },
Comment on lines +17 to +20
const parsed = parseAzureAiFoundrySecret(
await store.getSecret(token.secretName)
);
return parsed?.model ? { ...token, model: parsed.model } : token;

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow editing Azure AI Foundry model

2 participants