Azure Devops Pipeline returning: 'Failed to deploy web package to App Service. Internal Server Error (CODE: 500)'

I found the solution. It turns out the issue was not in the pipeline, but was caused by a Git connection to the app service I had previously set up in the Azure Deployment Center. Even though I disconnected/removed this Git connection, there was somehow still a residual file left over in Azure that was causing the error. I deleted the 'deployments' folder in Kudu (pictured below) and the pipeline started working as expected.

enter image description here

Getting to the above pictured view:

  • Navigate to your Azure Function project
  • Search for Advanced Tools
  • Open PowerShell