Hello System Administrator,
Welcome to Microsoft Q&A and Thank you for reaching out.
This behavior is expected and due to a security configuration change, not a service outage or SDK issue.
What is happening
Your Azure OpenAI resource now has API key authentication disabled, which is why requests using apiKey are failing with:
AuthenticationTypeDisabled – Key based authentication is disabled for this resource
When this setting is disabled, all API key–based requests are rejected, even if the key itself is valid. This commonly happens when the resource is configured to use Microsoft Entra ID (Azure AD) authentication only, which is now the recommended and more secure approach.
Why you can’t re-enable API keys
If the “API key authentication is disabled” toggle cannot be turned back on in Azure AI Foundry or the Azure portal, it usually means one of the following applies:
An Azure Policy enforces keyless (Entra ID–only) authentication
The resource was created or migrated with AAD-only authentication enforced
You don’t have Owner-level permissions to override the policy
In these cases, the portal intentionally prevents re-enabling API keys.
Recommended fix: switch to keyless (Entra ID) authentication
Since key-based auth is disabled, you should update your application to use Microsoft Entra ID authentication.
Steps:
Assign the appropriate role (for example, Cognitive Services OpenAI User) to your identity on the Azure OpenAI resource.
Use an Azure Identity credential (Managed Identity or Service Principal).
Authenticate using the scope:
https://cognitiveservices.azure.com/.default
JavaScript example:
const { DefaultAzureCredential } = require("@azure/identity");
const { OpenAIClient } = require("@azure/openai");
const endpoint = "https://<your-resource-name>.cognitiveservices.azure.com/";
const credential = new DefaultAzureCredential();
const client = new OpenAIClient(endpoint, credential);
This approach works both locally (via Azure CLI login or service principal) and in Azure-hosted environments (via Managed Identity).
Also check
Ensure your user or managed identity has access to the Azure OpenAI resource.
Make sure you are using the correct Azure OpenAI endpoint.
If you must use API keys, check whether a subscription-level policy is enforcing keyless authentication (this requires Owner access to change or exempt).
Please refer this Use Azure OpenAI without keys
I Hope this helps. Do let me know if you have any further queries.
Thank you!