4
votes

Here is the architecture of the application:

  • Web API written in ASP.NET Core.
  • Dockerfile builds the Web application using microsoft/dotnet:2.1-sdk and executes the API using microsoft/dotnet:aspnetcore-rumtime. The app is compiled and placed into /app.
  • The command executed to start the API is: ENTRYPOINT ["dotnet", "/app/WebAPI.dll"]
  • This API is deployed to an Azure Container Registry (Docker registry).
  • An Azure App Service is used to host the API. The App Service is configured to pull the given container from the ACR.
  • The API runs exactly as expected.

The problem is that we need to accept post body sizes larger than the 28.6MB limit imposed by IIS and Kestrel. We have tried the approaches at this URL with no success: https://www.talkingdotnet.com/how-to-increase-file-upload-size-asp-net-core/

  • Adding a Web.config file to the project does not help since it is not picked up by the ASP.NET Core runtime running in the container. (within the container only Kestrel is running)
  • Adding the [RequestSizeLimit] attribute does not solve the problem because I believe the actual limitation is occurring at the Azure level.
    • If I understand correctly, Dockerized ASP.NET Core apps running on Kestrel inside containers are reverse-proxied from an Azure IIS server. Thus the 28.6MB limitation likely exists at the IIS server.
  • Setting the size limit in UesKestrel also has no effect.
  • When we tried to implement the "middleware" solution we find that Features is not a property of the context object as given in the code on the page.

We need to know how to increase the maximum post size. It is OK if this is at the entire App Service Plan level. Since we are running containers though, we don't know where we could place a Web.config file with the appropriate setting.

1
have you solved the problem?Shaddix
Unfortuantely, no. We migrated to Azure Linux VMs running Docker Swarm. The cost is honestly not too different and gives us full control over the stack. We lose some of the nice Azure scripting capability, but we made up for it with Docker Compose and CI tooling. I'm guessing this is either a limit by design, or it's on Microsoft's "planned" features.fdmillion

1 Answers

0
votes

If you use Kubernetes on Azure, instead of Azure App Service, you can upload over 100MB without any issues. https://azure.microsoft.com/en-us/services/kubernetes-service/