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
Hello @Sen0299 ,
Thank you for your patience while we were working on this
Please check if the following response helps-
API keys can be regenerated without deleting or recreating the Azure AI Foundry resource or the deployed model endpoint. The endpoint URL remains unchanged throughout the process, and only the selected API key is replaced. Azure AI resources provide two API keys (Key 1 and Key 2) specifically to support secure key rotation with minimal or no service interruption.
If the Regenerate option is not visible, it is important to note that API key management is performed on the underlying Azure AI Services or Azure OpenAI resource that backs the Azure AI Foundry project. In many scenarios, the Azure AI Foundry portal allows viewing or copying the endpoint and existing API key, while key regeneration is managed from the associated Azure resource in the Azure portal.
Please follow the below steps to regenerate an API key
- Sign in to the Azure portal.
- Open the Azure AI Services or Azure OpenAI resource associated with the Azure AI Foundry project.
- Navigate to Resource Management > Keys and Endpoint.
- Locate Key 1 and Key 2.
- Select Regenerate for the key that needs to be rotated.
The deployment, endpoint, and model remain available throughout this process. Only the selected API key changes.
To help avoid service interruptions during key rotation, the following approach is recommended:
- Ensure applications are currently using Key 1.
- Regenerate Key 2.
- Update applications to use the newly generated Key 2.
- Verify that authentication is successful and all traffic is using the new key.
- Regenerate Key 1 after confirming the transition.
- Continue alternating between the two keys during future rotations.
Please note that once an API key is regenerated, the previous key value becomes invalid immediately. Any applications still using the old key will receive authentication failures (typically HTTP 401 Unauthorized). Rotating one key at a time helps minimize the risk of downtime.
For environments that require automated key management, API keys can also be regenerated by using:
- Azure CLI
- Azure PowerShell
- Azure Resource Manager (ARM) REST APIs
It is also worth noting that Azure AI resource API keys do not have a built-in expiration date. As a security best practice, consider:
- Using Microsoft Entra ID authentication where supported.
- Using Managed Identity for Azure-hosted applications.
- Applying Azure RBAC with least-privilege permissions.
- Storing API keys securely in Azure Key Vault.
- Implementing a regular key rotation process.
These practices help reduce reliance on long-lived shared secrets while strengthening the overall security posture.
If the Regenerate option is still not available after following the above steps, the following checks may help identify the cause:
- Confirm that the Azure portal is being used, as API key regeneration is managed on the underlying Azure AI resource rather than the model deployment page in Azure AI Foundry.
- Verify that the correct Azure AI Services or Azure OpenAI resource is selected.
- Confirm that the signed-in account has sufficient Azure RBAC permissions to view and regenerate resource keys.
- Determine whether authentication is configured to use API keys or Microsoft Entra ID, as environments using identity-based authentication may rely less on API key management.
The following references might be helpful , please check them out
- Authentication in Foundry Tools - Foundry Tools | Microsoft Learn
- Create a Foundry resource - Foundry Tools | Microsoft Learn
- az cognitiveservices account keys | Microsoft Learn
- New-AzCognitiveServicesAccountKey (Az.CognitiveServices) | Microsoft Learn
- Accounts - Regenerate Key - REST API (Azure Azure AI Services) | Microsoft Learn
- Azure Key Vault documentation | Microsoft Learn
- Azure security baseline for Microsoft Foundry | Microsoft Learn
Please let us know if the response was helpful
Thank you