Static-web-apps: The content server has rejected the request with: BadRequest 147 Reason: The size of the function content was too large. The limit for this static site is 31457280 bytes.

Created on 18 Nov 2020  路  14Comments  路  Source: Azure/static-web-apps

Hi @anthonychu/@annaji-msft,
I am developing the static website that I'm building is based on the Blazor framework.
I have NuGet library that is the bits around 30Mb should be part of the "Api" part. The CI/CD fails with the following error.

The content server has rejected the request with: BadRequest 147 Reason: The size of the function content was too large. The limit for this static site is 31457280 bytes.

Is there any way to fix this, increase the space. any urgency this be done much appreciated.

Thanks in advance,
Mohammad

Functions enhancement

Most helpful comment

Yep. We will be increasing it soon. Thanks for your patience. /cc @annaji-msft

All 14 comments

Hello. I have the exact same error. Only I am brand new at this and I am only trying to run the tutorial from the static web apps documentation. My app is supper small. It has no content is just 'hello world'. But I don't know what to do to resolve.

image

Attached an image of the error. Experience tells me if we both have the same error and it is very first in the list then maybe a new bug was just introduced. Or maybe we both need to set some configuration somewhere. I have looked around but I don't know what.

@jrathgeber Your app does not have an API, however, the workflow is configured with an API location, which caused the GitHub action to treat your entire app as an Azure Function app and try to deploy it, and it is hitting the API app limit of 30MB. Please change that valve to an empty string and see if that solves the issue.

It works now. Thank you very much.

@myaesubi Can you let me know if you're still experiencing this problem and if you have more information that you can share about your app, especially the workflow file? Thanks.

Hi @anthonychu
yes. I still have the issue.
Basically, I use a NuGet package to create pdf from html file and that's above 30Mb size. I use the standard work flow that is being picked up when I create Blazor static web app in Azure portal.

I think the quota for Blazor apps should be increased, since they are sitting on the .NET side with .dll files, comparing to Angular JS or other Javascript frameworks.

Thanks,
Mohammad

Just to clarify, our limit for the frontend apps for the current free offering is 250MB. That should be plenty for your Blazor app. You are hitting the limit on the function app, which is currently at 30MB. We plan on increasing this.

If you believe your Blazor app is blocked by the 30MB limit, please share more information and we can help troubleshoot.

Hi Anthony,
you are correct. my limit size is in the API side which is Function apps.
I use DinkToPdf NuGet package which is a wrapper for multiple native libraries for each OS.
The size of those libraries each is above 40Mb.

Here is the link:

What I had to do is workaround is to put the a message to a message queue to be picked up by my pay-as-you-go Function Apps (consumption plan) and generate Pdf with that app service in meantime.

I really wish to have the function app self sufficient for generating the PDF file and eliminate the queue and queue trigger in my app service function app.

Thanks,
Mohammad

Yep. We will be increasing it soon. Thanks for your patience. /cc @annaji-msft

@jrathgeber Do you mind sharing which tutorial you were following? We want to make some updates to make it more clear that the API location should be left empty. Thanks!

Good morning. I had a look at my history and this what I found. It was 2 weeks ago now.
https://docs.microsoft.com/en-us/azure/static-web-apps/get-started-portal?tabs=react
I remember searching for static web apps on azure to find that. I also wanted to use Azure portal.
However if you click the link to the git hub repo on that page you will find it is a broken link.
Not give up I went the root of that git hub repo and fin https://github.com/staticwebdev/react-basic and was able to get going.
At the bottom of the Microsoft link there is a button for Next Step "Add API" .
I seem to remember at some stage clicking it or even on Azure portal there was an API setting and I might have enabled it.
That is it. I do plan to do the next step and enable the API!.

Thanks @jrathgeber! Just tried it and you are correct that the link (https://github.com/staticwebdev/react-basic/generate) is broken if you are not logged into GitHub. We will update the instructions in the quickstarts and tutorials so it works well whether you are logged in or not. /cc @craigshoemaker @johnpapa

Hi @anthonychu,
would you be able to advise a tentative timeline

Yep. We will be increasing it soon. Thanks for your patience. /cc @annaji-msft

@anthonychu could you be able to advise a tentative timeline please. Thanks.

Setting api_location to empty string resolves the issue for me, thanks for the excellent answer.

Closing as bring your own functions serves as a workaround to this.

Was this page helpful?
0 / 5 - 0 ratings