ThrottlingTroll.AzureFunctions 9.0.0-beta1

This is a prerelease version of ThrottlingTroll.AzureFunctions.
dotnet add package ThrottlingTroll.AzureFunctions --version 9.0.0-beta1
                    
NuGet\Install-Package ThrottlingTroll.AzureFunctions -Version 9.0.0-beta1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ThrottlingTroll.AzureFunctions" Version="9.0.0-beta1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ThrottlingTroll.AzureFunctions" Version="9.0.0-beta1" />
                    
Directory.Packages.props
<PackageReference Include="ThrottlingTroll.AzureFunctions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ThrottlingTroll.AzureFunctions --version 9.0.0-beta1
                    
#r "nuget: ThrottlingTroll.AzureFunctions, 9.0.0-beta1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ThrottlingTroll.AzureFunctions@9.0.0-beta1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ThrottlingTroll.AzureFunctions&version=9.0.0-beta1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=ThrottlingTroll.AzureFunctions&version=9.0.0-beta1&prerelease
                    
Install as a Cake Tool

ThrottlingTroll.AzureFunctions

Rate limiting/throttling middleware for Azure Functions.

Install from NuGet:

dotnet add package ThrottlingTroll.AzureFunctions

IMPORTANT: if in your project you are using ASP.NET Core Integration, then you need to install and use ThrottlingTroll.AzureFunctionsAspNet package instead.

How to use (.NET Isolated)

Make sure you call one or another form of .UseThrottlingTroll() method at startup:

var builder = new HostBuilder();

// .....

builder.ConfigureFunctionsWorkerDefaults((hostBuilderContext, workerAppBuilder) => {

    workerAppBuilder.UseThrottlingTroll();

    // .....
});

All different ways of configuring, all other features and more code snippets are documented in our Wiki.

How to use (.NET InProc)

  1. Use .AddThrottlingTroll() method to add ThrottlingTroll to your DI container at startup:
[assembly: WebJobsStartup(typeof(ThrottlingTrollSampleInProcFunction.Startup.Startup))]
namespace ThrottlingTrollSampleInProcFunction.Startup
{
    public class Startup : IWebJobsStartup
    {
        public void Configure(IWebJobsBuilder builder)
        {
            builder.Services.AddThrottlingTroll(options =>
            {
                // In InProc Functions config sections loaded from host.json have the "AzureFunctionsJobHost:" prefix in their names
                options.ConfigSectionName = "AzureFunctionsJobHost:ThrottlingTrollIngress";

                // .....
            });
        }
    }
}
  1. Add InProc-specific implementation of IHttpRequestProxy to your project.

  2. Wrap your Functions with .WithThrottlingTroll() method, like this:

public class MyFunctions
{
    private readonly IThrottlingTroll _thtr;

    public Functions(IThrottlingTroll thtr)
    {
        this._thtr = thtr;
    }

    [FunctionName("MyFunc")]
    public Task<IActionResult> MyFunc([HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequest req)
        => this._thtr.WithThrottlingTroll(new InProcHttpRequestProxy(req),
            async ctx =>
            {
                // Your code goes here ...

                return (IActionResult)new OkObjectResult("OK");
            },
            async ctx =>
            {
                return (IActionResult)new StatusCodeResult((int)HttpStatusCode.TooManyRequests);
            });
}

Samples

Sample Azure Functions projects (both InProc and Isolated) are located in this separate repo.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on ThrottlingTroll.AzureFunctions:

Repository Stars
JitHubApp/JitHubV2
GitHub WinUI Client
Version Downloads Last Updated
9.0.0-beta1 0 12/21/2025
8.0.0 3,589 7/1/2025
8.0.0-beta3 177 6/30/2025
8.0.0-beta2 173 6/29/2025
8.0.0-beta1 131 6/28/2025
7.3.0 17,335 10/14/2024
7.2.0 2,722 8/31/2024
7.2.0-beta1 183 8/31/2024
7.1.2 3,115 6/12/2024
7.1.1 459 6/3/2024
7.1.0 215 6/1/2024
7.1.0-beta1 156 6/1/2024
7.0.0 530 5/15/2024
7.0.0-beta2 153 5/10/2024
7.0.0-beta1 154 5/5/2024
6.1.2 961 4/5/2024
6.1.1 1,434 1/28/2024
6.1.0 196 1/28/2024
6.0.0 825 12/4/2023
6.0.0-beta6 234 11/26/2023
6.0.0-beta5 170 11/26/2023
6.0.0-beta4 177 11/26/2023
6.0.0-beta3 164 11/26/2023
6.0.0-beta2 153 11/26/2023
6.0.0-beta1 136 11/25/2023
5.0.0 4,418 11/2/2023
4.0.5 1,108 8/27/2023
4.0.4 374 7/22/2023
4.0.2 252 7/22/2023
4.0.1 271 7/22/2023
4.0.0 259 7/22/2023
3.0.4 648 5/17/2023
3.0.3 261 5/15/2023
3.0.2 264 5/14/2023
3.0.1 266 5/14/2023
3.0.0 251 5/13/2023
2.0.1 418 4/1/2023