https://github.com/steadybit/failure-azure-functions-net
https://github.com/steadybit/failure-azure-functions-net
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/steadybit/failure-azure-functions-net
- Owner: steadybit
- License: mit
- Created: 2025-07-08T13:10:19.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-09-10T13:26:16.000Z (10 months ago)
- Last Synced: 2025-09-10T17:42:17.522Z (10 months ago)
- Language: C#
- Size: 70.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Steadybit .NET Middleware for Azure Functions
## Description
Steadybit .NET Middleware for Azure Functions injects the faults during Azure Function execution.
It utilizes Azure App Configuration for managing the injection parameters.
## Prerequisites
- .NET 8+
- Azure Functions use Isolated Worker model
- No usage of ASP.NET abstractions in Azure Functions (required for status code injection)
## Setup
To use Steadybit .NET Middleware for Azure Functions the following NuGet package is required:
```
dotnet add package Steadybit.FaultInjection
```
### Azure Functions
In ```Program.cs``` add the following configuration:
```
builder.Configuration.AddAzureAppConfiguration(options =>
{
options
.Connect(new Uri(endpoint), new DefaultAzureCredential())
.ConfigureSteadybitFaultInjection();
});
builder.Services.AddSteadybitFailureServices();
builder.UseMiddleware();
```
### ASP.NET
In ```Program.cs``` add the following configuration:
```
builder.Configuration.AddAzureAppConfiguration(options =>
{
options
.Connect(new Uri(endpoint), new DefaultAzureCredential())
.ConfigureSteadybitFaultInjection();
});
builder.Services.AddSteadybitFailureServices();
builder.Services.AddAzureAppConfiguration();
var app = builder.Build();
app.UseAzureAppConfiguration();
app.UseMiddleware();
```
The middleware requires ```App Configuration Data Reader``` role to read the configuration entries from the Azure App Configuration.
## Example
Check out the example in the ```SteadybitHttpTrigger``` folder inside of this repository.