Audit.NET.AzureStorageBlobs 26.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Audit.NET.AzureStorageBlobs --version 26.0.1                
NuGet\Install-Package Audit.NET.AzureStorageBlobs -Version 26.0.1                
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="26.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Audit.NET.AzureStorageBlobs --version 26.0.1                
#r "nuget: Audit.NET.AzureStorageBlobs, 26.0.1"                
#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=26.0.1

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

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.1.1 166 10/28/2024
27.1.0 95 10/24/2024
27.0.3 2,712 9/25/2024
27.0.2 243 9/19/2024
27.0.1 4,464 9/4/2024
27.0.0 102 9/3/2024
26.0.1 1,975 8/22/2024
26.0.0 321 7/19/2024
25.0.7 1,135 7/4/2024
25.0.6 230 6/24/2024
25.0.5 2,884 6/18/2024
25.0.4 4,072 3/24/2024
25.0.3 146 3/13/2024
25.0.2 268 3/12/2024
25.0.1 185 2/28/2024
25.0.0 617 2/16/2024
24.0.1 157 2/12/2024
24.0.0 128 2/12/2024
23.0.0 18,129 12/14/2023
22.1.0 401 12/9/2023
22.0.2 6,433 12/1/2023
22.0.1 483 11/16/2023
22.0.0 134 11/14/2023
21.1.0 643 10/9/2023
21.0.4 500 9/15/2023
21.0.3 15,088 7/9/2023
21.0.2 268 7/6/2023
21.0.1 1,106 5/27/2023
21.0.0 910 4/15/2023
20.2.4 900 3/27/2023
20.2.3 275 3/17/2023
20.2.2 266 3/14/2023
20.2.1 281 3/11/2023
20.2.0 8,211 3/7/2023
20.1.6 386 2/23/2023
20.1.5 296 2/9/2023
20.1.4 740 1/28/2023
20.1.3 314 12/21/2022
20.1.2 2,214 12/14/2022
20.1.1 619 12/12/2022
20.1.0 336 12/4/2022
20.0.4 360 11/30/2022
20.0.3 1,536 10/28/2022
20.0.2 432 10/26/2022
20.0.1 462 10/21/2022
20.0.0 3,381 10/1/2022
19.4.1 814 9/10/2022
19.4.0 470 9/2/2022
19.3.0 844 8/23/2022
19.2.2 662 8/11/2022
19.2.1 2,688 8/6/2022
19.2.0 523 7/24/2022
19.1.4 6,985 5/23/2022
19.1.3 485 5/22/2022
19.1.2 500 5/18/2022
19.1.1 1,569 4/28/2022
19.1.0 30,521 4/10/2022
19.0.7 1,188 3/13/2022
19.0.6 1,569 3/7/2022
19.0.5 1,029 1/28/2022
19.0.4 504 1/23/2022
19.0.3 676 12/14/2021
19.0.2 344 12/11/2021
19.0.1 841 11/20/2021
19.0.0 356 11/11/2021
19.0.0-rc.net60.2 169 9/26/2021
19.0.0-rc.net60.1 213 9/16/2021
18.1.6 1,179 9/26/2021
18.1.5 402 9/7/2021
18.1.4 392 9/6/2021
18.1.3 395 8/19/2021
18.1.2 486 8/8/2021
18.1.1 473 8/5/2021