Is there a way to configure IIS or the .NET Core application to allow larger request sizes only for this specific endpoint without impacting others?
If you deployed your ASP.NET Core app to IIS properly, the web.config was automatically generated and included under the site root as shown below;
The code of web.config is something like below:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*"
modules="AspNetCoreModuleV2"
resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet"
arguments=".\CookieSample.dll" stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 8F4EB672-B56E-4BC4-9909-A9EE199CDE1D-->
You can set the maxAllowedContentLength in the web.config above without impacting the other sites than the above site.