Audit.NET.AzureStorageBlobs
27.0.2
See the version list below for details.
dotnet add package Audit.NET.AzureStorageBlobs --version 27.0.2
NuGet\Install-Package Audit.NET.AzureStorageBlobs -Version 27.0.2
<PackageReference Include="Audit.NET.AzureStorageBlobs" Version="27.0.2" />
paket add Audit.NET.AzureStorageBlobs --version 27.0.2
#r "nuget: Audit.NET.AzureStorageBlobs, 27.0.2"
// Install Audit.NET.AzureStorageBlobs as a Cake Addin #addin nuget:?package=Audit.NET.AzureStorageBlobs&version=27.0.2 // Install Audit.NET.AzureStorageBlobs as a Cake Tool #tool nuget:?package=Audit.NET.AzureStorageBlobs&version=27.0.2
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.0.2)
- Azure.Storage.Blobs (>= 12.19.1)
- System.Text.Json (>= 6.0.9)
-
net6.0
- Audit.NET (>= 27.0.2)
- 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 | 276 | 12/11/2024 |
27.3.1 | 76 | 12/10/2024 |
27.3.0 | 124 | 12/8/2024 |
27.2.0 | 150 | 11/23/2024 |
27.1.1 | 890 | 10/28/2024 |
27.1.0 | 115 | 10/24/2024 |
27.0.3 | 5,768 | 9/25/2024 |
27.0.2 | 376 | 9/19/2024 |
27.0.1 | 7,207 | 9/4/2024 |
27.0.0 | 109 | 9/3/2024 |
26.0.1 | 2,802 | 8/22/2024 |
26.0.0 | 372 | 7/19/2024 |
25.0.7 | 1,149 | 7/4/2024 |
25.0.6 | 245 | 6/24/2024 |
25.0.5 | 2,893 | 6/18/2024 |
25.0.4 | 4,291 | 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,318 | 12/14/2023 |
22.1.0 | 427 | 12/9/2023 |
22.0.2 | 6,753 | 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,992 | 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,035 | 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 | 343 | 12/4/2022 |
20.0.4 | 367 | 11/30/2022 |
20.0.3 | 1,545 | 10/28/2022 |
20.0.2 | 439 | 10/26/2022 |
20.0.1 | 469 | 10/21/2022 |
20.0.0 | 3,392 | 10/1/2022 |
19.4.1 | 837 | 9/10/2022 |
19.4.0 | 477 | 9/2/2022 |
19.3.0 | 851 | 8/23/2022 |
19.2.2 | 669 | 8/11/2022 |
19.2.1 | 2,861 | 8/6/2022 |
19.2.0 | 530 | 7/24/2022 |
19.1.4 | 7,089 | 5/23/2022 |
19.1.3 | 492 | 5/22/2022 |
19.1.2 | 507 | 5/18/2022 |
19.1.1 | 1,592 | 4/28/2022 |
19.1.0 | 30,541 | 4/10/2022 |
19.0.7 | 1,201 | 3/13/2022 |
19.0.6 | 1,576 | 3/7/2022 |
19.0.5 | 1,036 | 1/28/2022 |
19.0.4 | 513 | 1/23/2022 |
19.0.3 | 683 | 12/14/2021 |
19.0.2 | 351 | 12/11/2021 |
19.0.1 | 848 | 11/20/2021 |
19.0.0 | 365 | 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,260 | 9/26/2021 |
18.1.5 | 409 | 9/7/2021 |
18.1.4 | 401 | 9/6/2021 |
18.1.3 | 404 | 8/19/2021 |
18.1.2 | 493 | 8/8/2021 |
18.1.1 | 480 | 8/5/2021 |