Audit.NET.AzureEventHubs 30.0.2

dotnet add package Audit.NET.AzureEventHubs --version 30.0.2
                    
NuGet\Install-Package Audit.NET.AzureEventHubs -Version 30.0.2
                    
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="Audit.NET.AzureEventHubs" Version="30.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Audit.NET.AzureEventHubs" Version="30.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Audit.NET.AzureEventHubs" />
                    
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 Audit.NET.AzureEventHubs --version 30.0.2
                    
#r "nuget: Audit.NET.AzureEventHubs, 30.0.2"
                    
#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.
#addin nuget:?package=Audit.NET.AzureEventHubs&version=30.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Audit.NET.AzureEventHubs&version=30.0.2
                    
Install as a Cake Tool

Audit.NET.AzureEventHubs

Azure Event Hubs provider for Audit.NET library (An extensible framework to audit executing operations in .NET).

Send the audit events to an Azure Event Hub.

Install

NuGet Package To install the package run the following command on the Package Manager Console:

PM> Install-Package Audit.NET.AzureEventHubs

NuGet Status NuGet Count

How it works

This library uses the Azure.Messaging.EventHubs library to send the Audit Events to an Azure Event Hub.

Usage

Please see the Audit.NET Readme

Configuration

Set the static Audit.Core.Configuration.DataProvider property to an instance of AzureEventHubsDataProvider, or call the UseAzureEventHubs() methods on the fluent configuration. This should be done before any AuditScope creation, i.e. during application startup.

Audit.Core.Configuration.DataProvider = new AzureEventHubsDataProvider()
{
    ConnectionString = "..."
};

Or

Audit.Core.Configuration.DataProvider = new AzureEventHubsDataProvider(e => e
        .WithConnectionString("..."));

Or

Audit.Core.Configuration.Setup()
    .UseAzureEventHubs(e => e
        .WithConnectionString("..."));
Provider Options
Connection options

Depending on the authentication method, you can call one of the following methods:

  • WithConnectionString: Connect using an Azure Storage connection string and an optional Hub Name.
  • WithClientFactory: Connect using a custom EventHubProducerClient factory. Alternative to WithConnectionString. Useful when you want to use a custom EventHubClientOptions or if you want to use a custom TokenCredential for authentication.
Customization options
  • CustomizeEventData: Customize the EventData object before sending it to the Event Hub.
Configuration examples

Using a connection string and a hub name, with a custom message id and property:

Audit.Core.Configuration.Setup()
    .UseAzureEventHubs(config => config
        .WithConnectionString(Settings.ConnectionString, Settings.HubName)
        .CustomizeEventData((eventData, auditEvent) =>
        {
            eventData.MessageId = Guid.NewGuid().ToString();
            eventData.Properties["EventType"] = auditEvent.EventType;
        }));

Using a Client factory to create the EventHubProducerClient:

Audit.Core.Configuration.Setup()
    .UseAzureEventHubs(config => config
        .WithClientFactory(() => serviceProvider.GetService<EventHubProducerClient>()));

Using a custom EventHubProducerClient instance:

Audit.Core.Configuration.Setup()
    .UseAzureEventHubs(config => config
        .WithClient(new EventHubProducerClient(Settings.ConnectionString));
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
30.0.2 85 6/26/2025
30.0.1 138 5/29/2025
30.0.0 140 5/27/2025
29.0.1 144 5/8/2025
29.0.0 133 5/6/2025
28.0.0 142 5/5/2025
27.5.3 172 4/23/2025