I have 2 deployment slots in Azure Web App: production and staging. I deployed code to Staging slot and then swapped with Production slot without any problem. Now I’m trying to swap back: choose Production slot as source and Staging slot as target, but there is only Stating slot in source slots list, so cannot choose Production slot as source slot. Tried via Azure CLI and got error back ResourceNotFound
for Production slot. What can be the problem?
2
Answers
To swap the previous version to Production, you can choose Staging as source and Production as target.
The two are swapped as a result.
Let’s say you had v1 in Production and v2 in Staging.
You swapped Staging to Production.
Now v2 is in Production and v1 in Staging.
So doing the same swap again results in v1 in Production and v2 in Staging.
One thing to note is that Production is technically not a slot, it is the main App Service. That could be why you get a resource not found. Swapping with Production is actually a separate operation from swapping some slot with another slot: https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/swap-slot-with-production.
Az CLI
, the Production slot may have been deleted or it’s no longer accessible in your Web App.To check the available slots for a webapp, you can use
AzCLI
command.Output:
staging and production
slots by choosing to target as a production but vice versa is not doable for few app services as detailed in MSDoc.And below are my
deployment slots
which are available under deployments of an App service and you can check thestatus
to see if it is running.You can also check the
activity log
of your app service to find the log history of deployment slots and the relevant information of an App Service/Webapp.If still the issue persists, I suggest you create one new production slot and then deploy your code in it to avoid these conflicts.