Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Function - Publishing Failed - RequestTimeout

I have a basic Azure Function app. When I try to publish the app, I receive an error that says "error : The attempt to publish the ZIP file through https://... failed with HTTP status code RequestTimeout.".

This app is a .NET Standard app. I followed the instructions here. The difference is, my app has an Event Hub Trigger instead of the Http Trigger shown in the documentation. I don't understand why i'm getting a Timeout during deployment. I also don't know how to get past this.

What am I doing wrong?

Update

Here are the logs.

1>------ Build started: Project: MyProject.Functions, Configuration: Release Any CPU ------
1>MyProject.Functions -> C:\MyProject\MyProject.Functions\bin\Release\netcoreapp2.1\bin\MyProject.Functions.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
  Publish Started
  MyProject.Functions -> C:\MyProject\MyProject.Functions\bin\Release\netcoreapp2.1\bin\MyProject.Functions.dll
  MyProject.Functions -> C:\MyProject\MyProject.Functions\obj\Release\netcoreapp2.1\PubTmp\Out\
  Publishing C:\MyProject\MyProject.Functions\obj\Release\netcoreapp2.1\PubTmp\MyProject.Functions - 20181101105531356.zip to https://my-project.scm.azurewebsites.net/api/zipdeploy...
C:\Users\me\.nuget\packages\microsoft.net.sdk.functions\1.0.23\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Publish.ZipDeploy.targets(42,5): error : The attempt to publish the ZIP file through https://my-project.scm.azurewebsites.net/api/zipdeploy failed with HTTP status code RequestTimeout. [C:\MyProject\MyProject.Functions\MyProject.Functions.csproj]
like image 994
Some User Avatar asked Nov 01 '18 15:11

Some User


5 Answers

I got the same issue when using Visual Studio. Very frustrating. But then I just used the zip file that VS created and used

az functionapp deployment source config-zip -g <resource_group> -n \
<app_name> --src <zip_file_path>

to publish.

You can find more options in https://docs.microsoft.com/en-us/azure/azure-functions/deployment-zip-push

like image 89
gajo357 Avatar answered Sep 25 '22 19:09

gajo357


I faced this recently and spent 2 complete days trying to fix it. Tried most of the solutions suggested here and on other posts.

What finally worked for me is removing my Publish settings and creating a new one by uploading a brand new .PublishSettings file.

How to get .PublishSettings file?

On Azure Portal, on your Function App, click on "Get Publish Profile" Azure Portal

And will automatically start downloading it.

How to Upload Publish Profile?

When trying to Publish the project from Visual Studio, click on New -> Select "Import Profile" Import Profile

And Browse your .PublishSettings file.

Then, just select this new profile (if it's not selected already), and click on Publish button as you would usually do.

like image 29
Rodrigo.A92 Avatar answered Oct 16 '22 22:10

Rodrigo.A92


According to this: https://github.com/projectkudu/kudu/wiki/Deploying-from-a-zip-file

you should be able to pass ?isAsync=true to the zipdeploy url (so it would be: 'https://my-project.scm.azurewebsites.net/api/zipdeploy?isAsync=true'

This requests resolves faster without a timeout and then you can grab the location header from the response, which you can poll to see the status of your deployment.

like image 3
MaximD Avatar answered Oct 16 '22 22:10

MaximD


In my case this error was because of the version of packages in my .csproj file. After updating them there was not error and the publish was successful.

like image 3
Ritik Avatar answered Oct 16 '22 21:10

Ritik


In my case, it was an issue with two things:

1] Visual Studio and Azure are flaky. Timeouts in a working scenario are still somewhat regular, on a bad day happening about 50-75% of the time for me. This is with an 80mb function app, not super big and I have gigabit Internet.

2] Someone deleted the file share for the storage. I had to fix WEBSITE_CONTENTAZUREFILECONNECTIONSTRING to point to the right storage connection string, and I had to update WEBSITE_CONTENTSHARE to point to a valid file share name, which I had to create in the storage resource group matching WEBSITE_CONTENTAZUREFILECONNECTIONSTRING connection string.

If you are using a development and production function slot, I would suggest to make WEBSITE_CONTENTAZUREFILECONNECTIONSTRING and WEBSITE_CONTENTSHARE deployment slot settings, that way you can link to a production and development storage environment. This is especially handy if you are using tables or blob storage and don't want to have to prefix or suffix all your table names or keys. In my opinion these two settings should be slots by default.

Once I did these changes I could publish, still dealing with the intermittent timeouts.

The error messaging with Azure function publishing is bad to non-existant, with any kind of configuration or resource errors simply causing a timeout error.

like image 1
jjxtra Avatar answered Oct 16 '22 22:10

jjxtra