Audit.NET.AzureStorageBlobs
27.3.0
See the version list below for details.
dotnet add package Audit.NET.AzureStorageBlobs --version 27.3.0
NuGet\Install-Package Audit.NET.AzureStorageBlobs -Version 27.3.0
<PackageReference Include="Audit.NET.AzureStorageBlobs" Version="27.3.0" />
paket add Audit.NET.AzureStorageBlobs --version 27.3.0
#r "nuget: Audit.NET.AzureStorageBlobs, 27.3.0"
// Install Audit.NET.AzureStorageBlobs as a Cake Addin #addin nuget:?package=Audit.NET.AzureStorageBlobs&version=27.3.0 // Install Audit.NET.AzureStorageBlobs as a Cake Tool #tool nuget:?package=Audit.NET.AzureStorageBlobs&version=27.3.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
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 | Versions 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. |
-
.NETStandard 2.0
- Audit.NET (>= 27.3.0)
- Azure.Storage.Blobs (>= 12.19.1)
- System.Text.Json (>= 6.0.10)
-
net6.0
- Audit.NET (>= 27.3.0)
- Azure.Storage.Blobs (>= 12.19.1)
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.3.2 | 232 | 12/11/2024 |
27.3.1 | 73 | 12/10/2024 |
27.3.0 | 119 | 12/8/2024 |
27.2.0 | 148 | 11/23/2024 |
27.1.1 | 881 | 10/28/2024 |
27.1.0 | 112 | 10/24/2024 |
27.0.3 | 5,689 | 9/25/2024 |
27.0.2 | 376 | 9/19/2024 |
27.0.1 | 7,121 | 9/4/2024 |
27.0.0 | 109 | 9/3/2024 |
26.0.1 | 2,756 | 8/22/2024 |
26.0.0 | 369 | 7/19/2024 |
25.0.7 | 1,149 | 7/4/2024 |
25.0.6 | 245 | 6/24/2024 |
25.0.5 | 2,891 | 6/18/2024 |
25.0.4 | 4,287 | 3/24/2024 |
25.0.3 | 151 | 3/13/2024 |
25.0.2 | 273 | 3/12/2024 |
25.0.1 | 192 | 2/28/2024 |
25.0.0 | 622 | 2/16/2024 |
24.0.1 | 166 | 2/12/2024 |
24.0.0 | 137 | 2/12/2024 |
23.0.0 | 19,137 | 12/14/2023 |
22.1.0 | 427 | 12/9/2023 |
22.0.2 | 6,684 | 12/1/2023 |
22.0.1 | 531 | 11/16/2023 |
22.0.0 | 139 | 11/14/2023 |
21.1.0 | 648 | 10/9/2023 |
21.0.4 | 510 | 9/15/2023 |
21.0.3 | 16,883 | 7/9/2023 |
21.0.2 | 273 | 7/6/2023 |
21.0.1 | 1,119 | 5/27/2023 |
21.0.0 | 915 | 4/15/2023 |
20.2.4 | 1,017 | 3/27/2023 |
20.2.3 | 280 | 3/17/2023 |
20.2.2 | 271 | 3/14/2023 |
20.2.1 | 286 | 3/11/2023 |
20.2.0 | 8,216 | 3/7/2023 |
20.1.6 | 391 | 2/23/2023 |
20.1.5 | 303 | 2/9/2023 |
20.1.4 | 746 | 1/28/2023 |
20.1.3 | 319 | 12/21/2022 |
20.1.2 | 2,221 | 12/14/2022 |
20.1.1 | 624 | 12/12/2022 |
20.1.0 | 341 | 12/4/2022 |
20.0.4 | 365 | 11/30/2022 |
20.0.3 | 1,543 | 10/28/2022 |
20.0.2 | 437 | 10/26/2022 |
20.0.1 | 467 | 10/21/2022 |
20.0.0 | 3,390 | 10/1/2022 |
19.4.1 | 833 | 9/10/2022 |
19.4.0 | 475 | 9/2/2022 |
19.3.0 | 849 | 8/23/2022 |
19.2.2 | 667 | 8/11/2022 |
19.2.1 | 2,849 | 8/6/2022 |
19.2.0 | 528 | 7/24/2022 |
19.1.4 | 7,085 | 5/23/2022 |
19.1.3 | 490 | 5/22/2022 |
19.1.2 | 505 | 5/18/2022 |
19.1.1 | 1,590 | 4/28/2022 |
19.1.0 | 30,539 | 4/10/2022 |
19.0.7 | 1,199 | 3/13/2022 |
19.0.6 | 1,574 | 3/7/2022 |
19.0.5 | 1,034 | 1/28/2022 |
19.0.4 | 511 | 1/23/2022 |
19.0.3 | 681 | 12/14/2021 |
19.0.2 | 349 | 12/11/2021 |
19.0.1 | 846 | 11/20/2021 |
19.0.0 | 363 | 11/11/2021 |
19.0.0-rc.net60.2 | 174 | 9/26/2021 |
19.0.0-rc.net60.1 | 216 | 9/16/2021 |
18.1.6 | 1,258 | 9/26/2021 |
18.1.5 | 407 | 9/7/2021 |
18.1.4 | 399 | 9/6/2021 |
18.1.3 | 402 | 8/19/2021 |
18.1.2 | 491 | 8/8/2021 |
18.1.1 | 478 | 8/5/2021 |