# openai.NotFoundError: Resource not found. Deployment '<deployment-name>' does not exist.

- **ID:** `llm/azure-openai-deployment-not-found`
- **Domain:** llm
- **Category:** config_error
- **Error Code:** `DeploymentNotFound`
- **Verification:** ai_generated
- **Fix Rate:** 95%

## Root Cause

Azure OpenAI endpoint URL or deployment name is misconfigured: the deployment may have been deleted, renamed, or the resource group/region in the endpoint URL does not match the actual deployment location.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| openai==1.30.0 | active | — | — |
| azure-identity==1.16.0 | active | — | — |
| azure-ai-openai==1.0.0 | active | — | — |

## Workarounds

1. **Verify the deployment name in Azure Portal: go to Azure OpenAI Studio > Deployments > copy the exact deployment name (case-sensitive). Then set `openai.Deployment('your-deployment-name')`.** (95% success)
   ```
   Verify the deployment name in Azure Portal: go to Azure OpenAI Studio > Deployments > copy the exact deployment name (case-sensitive). Then set `openai.Deployment('your-deployment-name')`.
   ```
2. **List all deployments programmatically: `from openai import AzureOpenAI; client = AzureOpenAI(api_key=key, api_version='2023-12-01-preview', azure_endpoint=endpoint); deployments = client.deployments.list(); print([d.id for d in deployments])`** (90% success)
   ```
   List all deployments programmatically: `from openai import AzureOpenAI; client = AzureOpenAI(api_key=key, api_version='2023-12-01-preview', azure_endpoint=endpoint); deployments = client.deployments.list(); print([d.id for d in deployments])`
   ```
3. **Ensure the `azure_endpoint` includes the full resource URL (e.g., `https://my-resource.openai.azure.com/`) and matches the region where the deployment was created.** (98% success)
   ```
   Ensure the `azure_endpoint` includes the full resource URL (e.g., `https://my-resource.openai.azure.com/`) and matches the region where the deployment was created.
   ```

## Dead Ends

- **** — The error is about the deployment name, not the API key; a valid key with a wrong deployment still fails. (90% fail)
- **** — The deployment is tied to a specific model; changing the model in code doesn't change the deployment's actual model. (85% fail)
- **** — The endpoint URL must match the exact resource; a wrong region or resource name will still cause NotFoundError. (95% fail)
