Function not allowing HTTP request body size more than 30MB after upgrading to .NET core 3.1
See original GitHub issueUpgraded HTTP Function app framework to .NET core 3.1 and run time version to v3, and throwing the below error if the request body size is more than 30MB.
Error: Exception while executing function: Upload Exception binding parameter ‘req’ Request body too large. Microsoft.AspNetCore.Server.IIS.BadHttpRequestException
It was allowing up to 100MB when I was using .NET core 2.1 and v2 runtime.
Investigative information
- Timestamp: 1/24/2020, 6:01:35 PM (Local time)
- Function App version (1.0 or 2.0): azurefunctions: 3.0.13107
- Invocation ID: 72f9e662-75ca-45d7-bc7f-73c72bf66ca0
- Region: South Central
Repro steps
Provide the steps required to reproduce the problem:
- Create HTTP Azure function with (Extensions,AzureKeyVault,DependencyInjection, HTTP, ActiveDirectory and SqlClient libraries)
- Use .NET Core 3.1
- Azure run time v3
- Upload request more than 30MB
Project file:
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> <AzureFunctionsVersion>v3</AzureFunctionsVersion> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.1.1" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.1" /> <PackageReference Include="Microsoft.Extensions.Http" Version="3.1.1" /> <PackageReference Include="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="5.2.6" /> <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.2" /> <PackageReference Include="System.Data.SqlClient" Version="4.8.0" /> </ItemGroup> <ItemGroup> <None Update="host.json"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> <None Update="local.settings.json"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToPublishDirectory>Never</CopyToPublishDirectory> </None> </ItemGroup> </Project>
Expected behavior
throws error
Known workarounds
downgraded to .NET core 2.1, run time version to v2 and function libraries:
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netcoreapp2.1</TargetFramework> <AzureFunctionsVersion>v2</AzureFunctionsVersion> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="2.2.0" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" /> <PackageReference Include="Microsoft.Extensions.Http" Version="2.2.0" /> <PackageReference Include="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="5.2.6" /> <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.29" /> <PackageReference Include="System.Data.SqlClient" Version="4.6.1" /> </ItemGroup> <ItemGroup> <None Update="host.json"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> <None Update="local.settings.json"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToPublishDirectory>Never</CopyToPublishDirectory> </None> </ItemGroup> </Project>
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Hey, is that issue is still open? I’m running into this when running function locally.
.Net Core 3.1, functions V~3 Microsoft.NET.Sdk.Functions 3.0.7
Hi,
for me i’ve this error aswell while trying to upload a file above 100mb in debug mode.
same configuration