Error when trying to publish an azure function from Visual Studio
None of the above worked for me. So I just re-downloaded the publish profile and imported it into VS and it worked.
Weird, but just in case none of the above worked for you. May worth try.
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.
Can you try this
Remove WEBSITE_RUN_FROM_PACKAGE setting entirely from Azure Functions Application Settings from Azure Portal.