It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Azure Web App Git Deploy - Git Push not working


I'm struggling to get GIT deploy working on an existing Azure web app. I did the complete same setup for another web app which is being used as a QA environment. The deploy to QA is an automated deploy for all commits on the master branch, and the commit to production is a manual deployment step and is the step after the QA deploy step.

I configured the deploy server (bitbucket pipelines using image microsoft/dotnet:sdk) and i'm doing these commands after the server pulled the sources to deploy:

  • git init
  • git config "Bitbucket pipeline"
  • git config ""
  • git add --all
  • git remote add azure_web https://$AZ_DEPLOY_WEB_PRD_USR:$AZ_DEPLOY_WEB_PRD_PWD@$AZ_DEPLOY_WEB_PRD_GITURL
  • git remote add azure_fct https://$AZ_DEPLOY_FCT_PRD_USR:$AZ_DEPLOY_FCT_PRD_PWD@$AZ_DEPLOY_FCT_PRD_GITURL
  • git push azure_web master
  • git push azure_fct master

The placeholders starting with $ signs are replaced by the deploy system for their real values set in a variables section.

I'm getting this exception: 

! [remote rejected] master -> master (shallow update not allowed)

I solved this by googling around and applying a fix found on a forum somewhere:

  • going to the kudu debug console
  • Navigating to d:\home\site\repository
  • And firing the command: git config --local --add receive.shallowUpdate true

Unfortunately this only changed the error message, because it changed to:

! [remote rejected] master -> master (unable to migrate objects to permanent storage)

I'm puzzled because again, I did completely the same thing for another azure webapp, of course the variables values are different but the steps and commands are the same. No complaints from kudu or git comming from the other environment. Also I doubt the shallow update exception is really what's wrong because the QA environment does not have the receive.shallowUpdate setting set.

I activated some trace logging regarding GIT and I found out that the git push command only results in a http POST of 4 bytes for the production environment, and 11165 for the QA environment. It seems git push is malfunctioning for some reason?

I was able to reproduce the same behaviour on my local pc, by replicating the commands the pipeline does during it's build setup steps and appending my own steps.

Does anyone have an idea where I should look next to get this fixed?




1 answer

0 votes
Ana_Retamal Atlassian Team Mar 28, 2018

Hi Andreas! Looks like the error you're getting is caused by Git, and not by the Pipelines. I've searched for the error "unable to migrate objects to permanent storage" and this is the explanation:

receive-pack: quarantine objects until pre-receive accepts

When a client pushes objects to us, index-pack checks the objects themselves and then installs them into place.
If we then reject the push due to a pre-receive hook, we cannot just delete the packfile; other processes may be depending on it. We have to do a normal reachability check at this point via git gc.

But such objects may hang around for weeks due to the gc.pruneExpire grace period. And worse, during that time they may be exploded from the pack into inefficient loose objects.

Instead, this patch teaches receive-pack to put the new objects into a "quarantine" temporary directory.
We make these objects available to the connectivity check and to the pre-receive hook, and then install them into place only if it is successful (and otherwise remove them as tempfiles).

Presumably when it compresses objects it puts them somewhere temporarily, then in a separate action tries to move them to their permanent location. Moving them means copying them from the temporary location to the permanent location, then either deleting them from the temporary location or leaving them to be removed by other processing, possibly at another time. 

The failure looks like a lack of permission (or disk space) to write to the remote location.

What git version are you using on the Server side? A git 2.10 would likely make that error disappear.

Hope that helps!



Thanks for your help. I found that explanation too, but don't really understand how this would be applicable. The destination store has enough space left, and should not have permission issues. The destination is an Azure Webapp using the Kudu toolset which also provides a way to connect and deploy via GIT. For testing i created an environment from scratch to be sure every setting was set to the default value.

The GIT version is


@Andreas_Dasseville Did you ever figure this out? I'm having the same issue.

I've had this issue for a few months - also only when running via pipelines (I can run the identical command fine from my machine). Annoying because I have to manually swap remotes and make the git push to Azure from my local dev machine after CI completes tests - not a great CI workflow.

Its worth adding this related link -

My very rough guess is that its linux user permission related, but since I dont think we can sudo in pipelines it would be great if someone from the pipelines team could have a look into this! @Ana_Retamal ?

If anyone finds a solution, please post it here :)

Sorry @Nicholas Major, I moved to another solution & platform. (Zip deploy to kudu using bamboo). Zip deploy will probably also work with pipelines but during the process of finding an alternative we also decided to use MSI authentication to connect to kudu which was already setup for our bamboo server.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Training & Certification

Atlassian University Live: Conquer Confluence Permisisons

Atlassian University Live   webinars provide you and your teams with the chance to strengthen your Atlassian product skills, and learn directly from Atlassian experts. Learn a systematic appr...

80 views 1 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you