Hello Roshan Govind,
Thanks for raising this question in Q&A forum.
I understand the urgency of accidentally deleting a deployment. The steps to restore it depend heavily on what specific type of deployment was deleted. Here are the solutions for the three most common scenarios:
1. Azure OpenAI Model Deployment (Most Likely Scenario)
If you deleted a model deployment (e.g., gpt-35-turbo or gpt-4) inside the Azure AI Foundry (formerly AI Studio) or Azure Portal:
- The Good News: Standard model deployments are "stateless." They do not store your data. Deleting the deployment simply deletes the endpoint that your code talks to.
- The Fix: You do not need to "restore" it. You simply need to recreate it.
- Go to Azure AI Foundry > Deployments.
- Click Create.
- Select the same model and version you used before.
- Crucial Step: Give it the exact same name as the deleted deployment.
- Once created, your applications using that deployment name will start working again immediately.
2. Azure OpenAI Resource (The entire service)
If you deleted the entire Azure OpenAI resource from the Azure Portal:
- Azure Cognitive Services resources have a "Soft Delete" feature enabled by default (48-hour retention).
- The Fix:
- Go to the Azure Portal.
- Search for "Azure OpenAI".
- In the top menu bar, click on "Manage Deleted Resources".
- Select your deleted resource and click Recover.
3. Azure App Service / Web App Deployment
If you deleted a deployment slot or an app in Azure App Service:
- The Fix: Check if you have Backups configured in the "Backups" blade of the App Service. If not, you will need to redeploy your code package (CI/CD pipeline or Visual Studio publish) to the service. There is no "Undo" button for App Service deletions without a configured backup.
4. Azure Kubernetes (AKS) Deployment
If you ran kubectl delete deployment ...:
- The Fix: You must re-apply your YAML configuration file (
kubectl apply -f deployment.yaml). There is no "undelete" command in Kubernetes; you simply declare the desired state again.
If you can clarify exactly which service (OpenAI, App Service, etc.) you are using, I can give you a more specific walkthrough.
If helps, approve the answer.
Best Regards,
Jerald Felix