Azure deployment failed

"You don't have permission to access the app and redeploy with local git failed"

·

2 min read

Azure deployment failed

Issue description

I pulled from my development branch and resolved the conflicts and the app was running fine on my local server. So I deployed it using local git to my Azure app server. However, the update was not effective after successfully deploying it. Then I clear my cached files and cookies and reloaded the website, I got the error message "You don't have permission to access the app".

Then I tried to redeploy my app to fix the issue but the server had already the latest code. I modified my code to create a new commit in order to push it to the remote master. But the deployment failed. I reverted it and do a commit and it failed again. However, both codes were pushed to the server.

Advice from Azure

For the error message, it's suggested to enable the diagnostic logs so we can gather more information on what may be causing the issue. docs.microsoft.com/en-us/azure/app-service/..

For the local git redeploy, we should use push --force to override the active commit on the remote branch. Although this method will fix the issue I had, we must make sure we are only overriding what we want to, otherwise, this will cause confusion since the Azure server is a shared git and it may confuse your team members if the public git history is modified. git-tower.com/learn/git/faq/git-force-push#...