I have query on Azure AI Foundry deployed model key and end point.

Sen0299 120 Reputation points
2026-07-03T08:39:56.7566667+00:00

Hi, How can i regenerate the Key for an deployed GPT4.1mini model ? Is there any way to specify the expiry date ?

The purpose, if i want to rotate the key often for security reasons ?

Foundry Models
Foundry Models

A catalog of AI models in Microsoft Foundry that you can discover, compare, and deploy using Azure’s built‑in tools for evaluation, fine‑tuning, and inference

0 comments No comments

Answer accepted by question author

AI answer

2026-07-03T08:40:15.45+00:00

For a deployed GPT‑4.1‑mini model in Azure AI Foundry, the “key and endpoint” used by applications are the API keys of the underlying Azure AI / Azure OpenAI resource, not per‑model keys. Key rotation is done at the resource level.

To regenerate (rotate) the API keys:

  1. Go to the Azure portal and open the Azure AI / Azure OpenAI resource that backs the Foundry project.
  2. Select the Keys and Endpoint blade.
  3. There are two keys (Key 1 and Key 2). Use the following rotation pattern:
    • Ensure all applications are currently using only one key (for example, Key 1).
    • Select Regenerate Key 2.
    • Update all applications to use the new Key 2.
    • Once all traffic uses Key 2, select Regenerate Key 1.
    • Optionally switch applications back to Key 1 and repeat this pattern on a schedule.

This lets keys be rotated frequently for security without downtime.

Regarding key expiry:

  • The built‑in API keys for Azure AI / Azure OpenAI resources do not support setting an explicit expiry date.
  • To achieve time‑bound access, use process controls (e.g., scheduled rotation as above) or front the resource with your own access layer (for example, a service that issues short‑lived tokens) rather than relying on built‑in key expiry.

For customer‑managed encryption keys (CMK) in Key Vault (different from API keys):

  • CMKs can have rotation policies and expiry configured in Azure Key Vault.
  • When a CMK is rotated, the Azure OpenAI resource must be updated to use the new key URI; rotation does not re‑encrypt existing data.

References:

AI-generated content may be incorrect. Read our transparency notes for more information.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Newest

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.