Skip to content

feat(secrets): allow editing the model of an Azure AI Foundry key - #1722

Open
vishrutha s gowda (vishruthasgowda) wants to merge 1 commit into
microsoft:mainfrom
vishruthasgowda:feat/foundry-model-edit
Open

vishrutha s gowda (vishruthasgowda) wants to merge 1 commit into
microsoft:mainfrom
vishruthasgowda:feat/foundry-model-edit

Conversation

@vishruthasgowda

Copy link
Copy Markdown

Summary

Closes #1386

Users can currently not change the model name of an existing Azure AI Foundry
secret. They have to delete it and create a new one.

This PR lets users swap the deployment/model name on an existing Foundry key
without re-entering the endpoint or API key.

  • token-manager: PUT /api/v1/keys/:id accepts an optional model. For
    azure-ai-foundry keys it reads the stored secret, updates (or clears, when
    empty/null) the model field and writes the secret back, keeping endpoint
    and apiKey unchanged. Non-Foundry keys get a 400, unknown keys a 404, and a
    malformed stored credential a 409.
  • shared: added model?: string | null to UpdateKeyRequest.
  • portal: the key edit form on the key details page shows a
    "Deployment / Model name" field for Foundry keys. Leaving it blank keeps the
    current model, because the stored model is never sent to the browser.

Demos

N/A for now. I have not recorded a demo of the portal change; I can add a
before/after recording if reviewers want one.

Before

N/A

After

N/A

Testing

  • Added apps/token-manager/src/routes-foundry-model.test.ts (4 tests):
    swapping the model, clearing it, rejecting non-Foundry keys, and
    404 / metadata-only updates leaving the secret untouched.
  • pnpm exec vitest run apps/token-manager/src → 7 files, 71 tests passed.
  • The portal change has not been tested manually in a browser.

Documentation and compatibility

None. The change is backward compatible: model is optional, and existing
requests that omit it behave exactly as before.

Checklist

  • If Portal features changed, keep CLI capabilities in sync. (CLI not updated; happy to follow up if wanted.)
  • If Portal components changed, update their Storybook stories. (N/A, no component props changed)
  • If database changes require a migration, include up() / down() and keep it CosmosDB-compatible. (N/A)
  • If dependencies changed, update the lockfile and regenerate NOTICE. (N/A, no dependency changes)
  • Video showing the behavior before the suggested change
  • Video showing the behavior after the suggested change

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

1 participant