Audit.NET.AzureStorageBlobs 27.2.0

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

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

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
27.2.0 0 11/23/2024
27.1.1 461 10/28/2024
27.1.0 102 10/24/2024
27.0.3 4,423 9/25/2024
27.0.2 364 9/19/2024
27.0.1 5,319 9/4/2024
27.0.0 103 9/3/2024
26.0.1 2,318 8/22/2024
26.0.0 334 7/19/2024
25.0.7 1,140 7/4/2024
25.0.6 231 6/24/2024
25.0.5 2,885 6/18/2024
25.0.4 4,154 3/24/2024
25.0.3 147 3/13/2024
25.0.2 269 3/12/2024
25.0.1 187 2/28/2024
25.0.0 618 2/16/2024
24.0.1 158 2/12/2024
24.0.0 129 2/12/2024
23.0.0 18,614 12/14/2023
22.1.0 411 12/9/2023
22.0.2 6,527 12/1/2023
22.0.1 500 11/16/2023
22.0.0 135 11/14/2023
21.1.0 644 10/9/2023
21.0.4 503 9/15/2023
21.0.3 15,721 7/9/2023
21.0.2 269 7/6/2023
21.0.1 1,114 5/27/2023
21.0.0 911 4/15/2023
20.2.4 954 3/27/2023
20.2.3 276 3/17/2023
20.2.2 267 3/14/2023
20.2.1 282 3/11/2023
20.2.0 8,212 3/7/2023
20.1.6 387 2/23/2023
20.1.5 297 2/9/2023
20.1.4 742 1/28/2023
20.1.3 315 12/21/2022
20.1.2 2,217 12/14/2022
20.1.1 620 12/12/2022
20.1.0 337 12/4/2022
20.0.4 361 11/30/2022
20.0.3 1,539 10/28/2022
20.0.2 433 10/26/2022
20.0.1 463 10/21/2022
20.0.0 3,384 10/1/2022
19.4.1 817 9/10/2022
19.4.0 471 9/2/2022
19.3.0 845 8/23/2022
19.2.2 663 8/11/2022
19.2.1 2,775 8/6/2022
19.2.0 524 7/24/2022
19.1.4 7,007 5/23/2022
19.1.3 486 5/22/2022
19.1.2 501 5/18/2022
19.1.1 1,578 4/28/2022
19.1.0 30,528 4/10/2022
19.0.7 1,194 3/13/2022
19.0.6 1,570 3/7/2022
19.0.5 1,030 1/28/2022
19.0.4 507 1/23/2022
19.0.3 677 12/14/2021
19.0.2 345 12/11/2021
19.0.1 842 11/20/2021
19.0.0 359 11/11/2021
19.0.0-rc.net60.2 170 9/26/2021
19.0.0-rc.net60.1 214 9/16/2021
18.1.6 1,212 9/26/2021
18.1.5 403 9/7/2021
18.1.4 395 9/6/2021
18.1.3 396 8/19/2021
18.1.2 487 8/8/2021
18.1.1 474 8/5/2021