Audit.NET.AzureStorageBlobs 25.0.4

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

// Install Audit.NET.AzureStorageBlobs as a Cake Tool
#tool nuget:?package=Audit.NET.AzureStorageBlobs&version=25.0.4

Audit.NET.AzureStorageBlobs

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

Store the audit events in an Azure Storage Blob container in JSON format.

Install

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

PM> Install-Package Audit.NET.AzureStorageBlobs

NuGet Status NuGet Count

How it works

This library uses the Azure.Storage.Blobs API to store the Audit Events on Azure Storage Blob containers in JSON format.

Usage

Please see the Audit.NET Readme

Configuration

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

Configuration examples

Using a connection string:

Audit.Core.Configuration.Setup()
    .UseAzureStorageBlobs(config => config
        .WithConnectionString(Settings.ConnectionString)
        .ContainerName(ev => $"{DateTime.Today:yyyyMMdd}")
        .BlobName(ev => $"{ev.EventType}/{Guid.NewGuid()}.json")
        .AccessTier(AccessTier.Cool)
        .Metadata(ev => new Dictionary<string, string>() { { "user", ev.Environment.UserName } })
        .Tags(ev => new Dictionary<string, string>() { { "eventType", ev.EventType } }));

Using a shared key (SharedKeyCredential):

Audit.Core.Configuration.Setup()
    .UseAzureStorageBlobs(config => config
        .WithCredentials(_ => _
            .Url(Settings.AzureBlobServiceUrl)
            .Credential(new StorageSharedKeyCredential(Settings.AccountName", Settings.AccountKey)))
        .ContainerName(ev => $"{DateTime.Today:yyyyMMdd}")
        .BlobName(ev => $"{ev.EventType}/{Guid.NewGuid()}.json")
        .AccessTier(AccessTier.Cool)
        .Metadata(ev => new Dictionary<string, string>() { { "user", ev.Environment.UserName } }));

Using Azure Active Directory (Token Credential):

var credential = new ClientSecretCredential(
    Settings.TenantId,
    Settings.ApplicationId,
    Settings.ApplicationSecret,
    new TokenCredentialOptions() { AuthorityHost = Settings.AuthEndpoint });

Audit.Core.Configuration.Setup()
    .UseAzureStorageBlobs(config => config
        .WithCredentials(_ => _
            .Url("AzureBlobServiceUrl")
            .Credential(credential))
        .ContainerName("AuditLogs")
        .BlobName(ev => Guid.NewGuid().ToString()));
Provider Options
Authentication options

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

  • WithConnectionString: Connect using an Azure Storage connection string.
  • WithServiceUrl: Connect using a service URL (anonymous)
  • WithCredentials: Connect using a service URL and credentials (StorageSharedKeyCredential, AzureSasCredential or TokenCredential)
Container options
  • ContainerName: The container name to use as a function of the Audit Event (see the naming restrictions here).
  • BlobName: The unique blob name to use as a function of the Audit Event. The resulting name can include path information (slash separated sub-folders).
  • AccessTier: (optional) The Access Tier to use as a function of the Audit Event.
  • Metadata: (optional) Extra information to include as metadata to be associated with the blob storage resource.
  • Tags: (optional) Extra information to include as tags to be associated with the blob storage resource.
Query events

This provider implements GetEvent and GetEventAsync methods to obtain an audit event by container name and blob name:

var event = blobDataProvider.GetEvent("containerName", "blobName");
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 was computed.  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. 
.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 was computed.  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
25.0.4 338 3/24/2024
25.0.3 118 3/13/2024
25.0.2 208 3/12/2024
25.0.1 154 2/28/2024
25.0.0 440 2/16/2024
24.0.1 131 2/12/2024
24.0.0 102 2/12/2024
23.0.0 5,959 12/14/2023
22.1.0 105 12/9/2023
22.0.2 2,654 12/1/2023
22.0.1 253 11/16/2023
22.0.0 106 11/14/2023
21.1.0 622 10/9/2023
21.0.4 470 9/15/2023
21.0.3 7,244 7/9/2023
21.0.2 250 7/6/2023
21.0.1 786 5/27/2023
21.0.0 848 4/15/2023
20.2.4 580 3/27/2023
20.2.3 255 3/17/2023
20.2.2 240 3/14/2023
20.2.1 262 3/11/2023
20.2.0 8,188 3/7/2023
20.1.6 372 2/23/2023
20.1.5 270 2/9/2023
20.1.4 725 1/28/2023
20.1.3 301 12/21/2022
20.1.2 2,174 12/14/2022
20.1.1 515 12/12/2022
20.1.0 309 12/4/2022
20.0.4 338 11/30/2022
20.0.3 1,525 10/28/2022
20.0.2 413 10/26/2022
20.0.1 436 10/21/2022
20.0.0 860 10/1/2022
19.4.1 770 9/10/2022
19.4.0 449 9/2/2022
19.3.0 822 8/23/2022
19.2.2 638 8/11/2022
19.2.1 2,646 8/6/2022
19.2.0 500 7/24/2022
19.1.4 6,625 5/23/2022
19.1.3 475 5/22/2022
19.1.2 479 5/18/2022
19.1.1 1,497 4/28/2022
19.1.0 30,456 4/10/2022
19.0.7 1,123 3/13/2022
19.0.6 1,539 3/7/2022
19.0.5 997 1/28/2022
19.0.4 484 1/23/2022
19.0.3 629 12/14/2021
19.0.2 322 12/11/2021
19.0.1 818 11/20/2021
19.0.0 336 11/11/2021
19.0.0-rc.net60.2 158 9/26/2021
19.0.0-rc.net60.1 198 9/16/2021
18.1.6 886 9/26/2021
18.1.5 380 9/7/2021
18.1.4 372 9/6/2021
18.1.3 373 8/19/2021
18.1.2 462 8/8/2021
18.1.1 449 8/5/2021