简体   繁体   中英

How to fix error in function app publish through visual studio

I am running into problem when I try to publish the Azure function app from visual studio to Azure.

I picked a sample function from the predefined examples. It works well when I run the project locally in studio and I can invoke it thr' browser.

However, When I publish it using zip deployment through Studio, it always fails with below error:

1>------ Build started: Project: FunctionApp1, Configuration: Release Any CPU ------ 1>FunctionApp1 -> C:\Users\<>\source\repos\FunctionApp1\bin\Release.netcoreapp2.1\bin\FunctionApp1.dll 2>------ Publish started: Project: FunctionApp1, Configuration: Release Any CPU ------ 2>FunctionApp1 -> C:\Users\<>\source\repos\FunctionApp1\bin\Release.netcoreapp2.1\bin\FunctionApp1.dll 2>FunctionApp1 -> C:\Users\<>\source\repos\FunctionApp1\obj\Release.netcoreapp2.1\PubTmp\Out\ 2>Publishing C:\Users\<>\source\repos\FunctionApp1\obj\Release.netcoreapp2.1\PubTmp\FunctionApp1 - 20190430110751931.zip to https://functionapp120190430104807.scm.azurewebsites.net/api/zipdeploy ... 2> The attempt to publish the ZIP file through https://functionapp120190430104807.scm.azurewebsites.net/api/zipdeploy failed with HTTP status code RequestTimeout. ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

What can I do to resolve this? I am a beginner in Azure, so please excuse me for any obvious thing missed.

Thanks !!

Zip deployment is a feature of Azure App Service that lets you deploy your function app project to the wwwroot directory. The project is packaged as a .zip deployment file. The same APIs can be used to deploy your package to the d:\\home\\data\\SitePackages folder.

Set WEBSITE_RUN_FROM_PACKAGE to 0 and restart azure function then it will work fine.

I installed the azure-cli package with pip and the issue resolved. The issue may come from the broken azure-cli dependencies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM