0

We are using a React web app as frontend and Azure Function as backend. The user can upload a file through our frontend. The frontend then sends the file via a REST call to an Azure Function.

I observed a strange behaviour which I can't explain: I open the web app and upload a file which is 2 MB big. I trigger the REST call via button click. Nothing happens. After ~ 2,1 minutes the call stops without a response received.

When I open the web app and upload a file which is very small (~ 120 kb). I trigger the REST call via button click. The response is 200 -ok after about 20 seconds. Then I upload the same file from before (2MB big) and trigger the rest call, I receive a response in < 30 seconds with status code 200 -ok. So in general the backend can handle the file size.

Why is this happening?

Could a possible reason be azure functions cold start?

No error is present in Azure diagnostic tools.

4
  • 1
    What response you are getting when it is fail ? Also some sample code can be more useful. Are you using dotnet core 3 or v3 function or dotnet-isolated with v3. Commented Sep 27, 2021 at 16:54
  • When I use Edge browser and do the procedure described above, I receive after ~2.1 minutes: ERR_CONNECTION_RESET. -> No status code from server Commented Sep 27, 2021 at 17:00
  • Are you behind any proxy ? If so try without that. In one of my case proxy was the issue and it was not able to handle request larger than that. Commented Sep 27, 2021 at 17:03
  • But shouldn´t the proxy then prevent the file upload in both cases mentioned above? I would expect that it fails in both cases. (without uploading small file first and with uploading small file first) I just double checked, no proxy in use. Commented Sep 27, 2021 at 17:43

1 Answer 1

0

I figured it out by myself after a lot of trial and error. I saw that one of my slots in azure app service did not have the issue. It was using another azure function slot. Then I made a diff between my working function slot and my not working function slot. There was one setting which differntiated: Settings -> Configuration -> Common Configuration -> Incoming client certificates

There are two settings you can make:

  • Client certificate mode
  • Certificate exclusion paths

Client certificate mode was set to 'Allow' on the function without the issue. Client certificate mode was set to 'Ignore' on the function with the issue.

After setting to 'Ignore' the upload of big files was working without a connection reset. For me it is unclear how this setting can affect a file upload, but it did.

The correct and secure way would be to set certificate mode to 'Required' and add allowed certificate paths.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.