How can i store audit data in azure table storage,audit.net provides (https://github.com/thepirat000/Audit.NET#data-providers-included) sqldataprovider only can you please help me.
Thanks
How can i store audit data in azure table storage,audit.net provides (https://github.com/thepirat000/Audit.NET#data-providers-included) sqldataprovider only can you please help me.
Thanks
Now you can use the Azure Table data provider to store your audit events on azure tables. It is included from version 12.1.9 on the Audit.NET.AzureStorage package.
You can configure the columns dynamically via an anonymous object or dictionary, or implementing your own TableEntity class.
For example:
Audit.Core.Configuration.Setup()
.UseAzureTableStorage(_ => _
.ConnectionString("your cnn string")
.TableName("Events")
.EntityBuilder(e => e
.PartitionKey($"Events{ev.StartDate:yyyyMM}")
.Columns(c => c.FromObject(ev => new
{
Date = ev.StartDate,
User = ev.Environment.UserName,
...
}))));
Take a look at the README file here.
For further problems, note you can also open an issue instead of asking on SO. or ask on the Audit.NET Gitter chat
Audit.Core.Configuration.DataProvider = new AzureTableDataprovider()
{
ConnectionString = ConfigurationManager.ConnectionStrings["AuditDbConnection"].ToString(),
Schema = "dbo",
TableName = "tblbateventsauditing",
IdColumnName = "EventId",
JsonColumnName = "Data"
};