Error when trying to publish an azure function from Visual Studio Error when trying to publish an azure function from Visual Studio azure azure

Error when trying to publish an azure function from Visual Studio


Can you try this

Remove WEBSITE_RUN_FROM_PACKAGE setting entirely from Azure Functions Application Settings from Azure Portal.


This is a Visual Studio timeout issue, which means that your code and some other settings are not the key to the problem. This error occurs because Visual sets a timeout limit on the release. (The file is too large or the internet speed is unstable)

If your deployment project is not too big, you can wait until the network speed is stable before trying to run it. Of course, you can also try other deployment methods to avoid this problem, such as zip deploy.


I experienced same strange problem - it was caused by error in my code -

I had #if DEBUG #else #if statement in my code, so debug on my computer worked, but publishing (with Release profile) failed.

Click on Output tab and you should see the real issue.