Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

BitBucket Pipeline failing after Azure slot swap

Deleted user January 29, 2018

I am using a BitBucket Pipeline for the continuous integration of an Azure Web App, and for the most part, it works perfectly. I have been deploying directly into a staging slot, which I will then swap into a production slot once it's all been user tested. However, I've noticed that whenever I perform a slot swap on Azure, the next pipeline build will fail when trying to push the git repo to Azure. The error message I receive is:

bitbucket [remote rejected] master -> master "unable to migrate objects to permanent storage"

I have a feeling this is due to the Azure Web App repo becoming out of sync with the BitBucket repo, because if I perform a manual push from my local repo to the Azure repo, the pipeline starts working correctly again.

Has anyone else encountered this issue, or know of a possible solution to this? In the meantime, I'm just going to abandon swapping slots, and push it to the production slot manually, but it would be handy to know what's causing this problem! 

4 answers

0 votes
naveen.kummari April 13, 2022

Maybe instead of pushing an entire git repo to the azure app service, why not use an executable like Jar to run your app. An extra web. config is needed to instruct the app service to run the executable. and both the slots will have both files and maybe we won't have this out-of-sync problem. 

Whenever a new executable with a different name is deployed, azure stores the old jar along with new ones. We can also automatically rename the executable and change it on the web. config through pipelines, using Linux sed command and deploy both renamed executable and modified web. config. This enables the auto app restarts after deployment without manual intervention.

0 votes
Kahlil Nagi February 19, 2020

Anyone work out a solution to this? I have a similar setup but when you swap slots and push it fails.  The only way I could work out was to disconnect and reconnect again. 

0 votes
Stefan Naegeli January 18, 2019

We're having the same problem. Were you able to fix this?

0 votes
Joey Stevense May 18, 2018

Maybe you can try a force push in your deployment script.

git push  -f https://$AZURE_LOGIN:$AZURE_PASSWORD@{APP_NAME}.scm.azurewebsites.net:443/{APP_NAME}.git
Aaron Newsom January 15, 2019

tried -f on our instance, same error. FYI this occurs even on slots that aren't being swapped. And pushing locally always works.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events