If you try to create a custom deploy script in your root called deploy.sh and point to it in .deployment, it takes a few deploys before it actually gets ran. Kudu seems to use the original deploy.sh
Creating a script with a different name seems to work better on the first try.