Cannot swap App Service slots. RRS feed

  • Question

  • Good morning,

    I created 2 App Services which are Java 8 service providing simple api endpoints, they use ADD authentication, are located in East US, and for each one I created a Slot named development. I firstly deployed my code from a local repository to the "development" slot using the windows command lines, and now I want to swap from the slot source "development" to slot target "production" but I have the same error every time. 

    "Cannot swap slots for site 'my app name' because the worker process for 'development' slot could not be started."

    Any help on this? I found no useful idea, tutorial or whatever...

    If you need anything else to determine the issue, feel free to ask!

    Thank you for your help


    • Edited by LoupOll Tuesday, October 22, 2019 3:26 PM
    Tuesday, October 22, 2019 2:54 PM

All replies

  • Do you have a custom warm-up action defined for your app? If yes, the swap operation will wait for this custom warm-up to complete. You can lookup applicationinitialization field in your web.config for confirmation. 

    You might also like to give a try to swap your slots using Powershell.

    - Vaibhav Gujral

    Tuesday, October 22, 2019 5:08 PM
  • I do not have have any web.config file in my project. I closet file I could add something to warm up is the pom.xml. My App Service do not render a front-end, it is just an endpoint I use to call some other services, transform data, and then return something resumed.

    I tried using a terminal from my local repository but the same error occurred.

    I noticed my App Service is of type "App Service" while my development slot is of type "Web App" event if I created it from the Deployment Slots section, this can have any bad effect? 

    Tuesday, October 22, 2019 5:29 PM
  • Can you try using powershell ?

    $ParametersObject = @{targetSlot  = "[slot name – e.g. “production”]"}
    Invoke-AzResourceAction -ResourceGroupName [resource group name] -ResourceType Microsoft.Web/sites/slots -ResourceName [app name]/[slot name] -Action applySlotConfig -Parameters $ParametersObject -ApiVersion 2015-07-01


    Tuesday, October 22, 2019 6:01 PM
  • Hello LoupOll, 

    Thanks for reaching out to us. 

    Usually there could be multiple reasons on why the swap slot operation failed, please take a look at the suggestions outlined in the blog Most common deployment slot swap failures and see if that helps.


    Also, If you haven’t tried to swap the slot using PowerShell cmd, I would suggest you try to swap the slots using the PowerShell cmdlets and see if it works.

    Invoke-AzureRmResourceAction -ResourceGroupName $resourceGroup -ResourceType Microsoft.Web/sites/slots -ResourceName $appServiceName/development-Action slotsswap -Parameters @{targetSlot="production"}

    I hope this information helps. Please feel free to revert if you have any further questions on this. 


    Do click on "Mark as answer" if you think the post has helped you resolve your problem so it can be beneficial for other in the community.  

    Tuesday, October 22, 2019 7:57 PM
  • Hello,

    Thank you for your advices, I was in a middle of a release sorry for the late reply... 
    I tried both solution but without success, it has finally work today after new work in the code and other stuffs changed. So now it's working, but no idea why. 

    I will just accept it thought.

    Have a great day

    Friday, October 25, 2019 7:20 PM
  • Hello LoupOll, 

    I am glad to hear the issue is resolved for you. Feel free to revert back if you have any further questions. 

    Monday, October 28, 2019 2:22 PM