Azure Table Utilities

Tool available on NuGet for backup of Azure Tables to a local file or to Azure Blob storage file, copying an Azure Table within the same account or to another account, deleting Azure Table information as well as restoring from a local file or Azure Blob storage file to a specified Azure Table. The backup & copy processes will dynamically query table element information. The restore process will create the table if it does not exist. The restore process does not delete existing table entries, if any, however existing entries may be overwritten if input file has the same keyed data. The delete process allows for deletion of the entire table definition (including the name) as well as for deleting all or some rows based on passed filter criteria.

Documentation generated from source code comments is available here Git Hub Docs.

A command line reference implementation of the tool is available on Git Hub and includes a DockerFile reference as well.

Is there functionality you'd like to see or do you have a question about how it works? Send a note and let me know.

Do you find this tool useful? Don't be bashful use the "Donate" button on the footer 🤑. No amount is too small.
string AzureStorageConfigConnection = "xxxxxxxxxxx";
string AzureBlobStorageConfigConnection = "xxxxxxxxxxx";
int timeoutSeconds = 30;

BackupAzureTables backup = new BackupAzureTables(AzureStorageConfigConnection, AzureBlobStorageConfigConnection);
string BlobStatus = backup.BackupTableToBlob("TableName", "BlobRootName", "LocalWorkingDirectory", CompressBool, ValidateBool, RetentionDays, timeoutSeconds);
Backup process will return a status message confirming table backed up and a count of any files aged.
Table TableName backed up as 'TableName_backup_yyyyMMddHHmmss.ext'; 3 files aged.
string AzureStorageConfigConnection = "xxxxxxxxxxx";
string AzureStorageConfigConnectionDestination = "xxxxxxxxxxx";
int timeoutSeconds = 30;

CopyAzureTables copy = new CopyAzureTables(AzureStorageConfigConnection, AzureStorageConfigConnectionDestination);
string CopyStatus = copy.CopyTableToTable("SourceTableName", "DetinationTableName", timeoutSeconds);
Copy process will return a status message indicating table copied and a count of entries.
Table 'SourceTableName' copied to table 'DetinationTableName', total records 9.
string AzureStorageConfigConnection = "xxxxxxxxxxx";
int timeoutSeconds = 30;

DeleteAzureTables delete = new DeleteAzureTables(AzureStorageConfigConnection,);
string DeleteStatus = delete.DeleteAzureTable("TableNameToDelete", timeoutSeconds);
Delete process will return a status message indicating table deleted.
Table 'TableNameToDelete' deleted.
string AzureStorageConfigConnection = "xxxxxxxxxxx";
string AzureBlobStorageConfigConnection = "xxxxxxxxxxx";
int timeoutSeconds = 30;

RestoreAzureTables restore = new RestoreAzureTables(AzureStorageConfigConnection, AzureBlobStorageConfigConnection);
string RestoreFromBlobStatus = restore.RestoreTableFromBlob("DetinationTableName", "OriginalTableName", "BlobRootName", "LocalWorkingDirectory", "Blobfilename.extension", timeoutSeconds);
Restore process will return a status message indicating table restored and a count of entries.
Restore to DetinationTableName Successful; 21 entries.
Filters can optionally be used on Backup, Copy and DeleteAzureTableRows commands to control which table rows are selected for the requested command. The code snippet below can be added to the call in the Backup Example.
Filter f1 = new Filter();
f1.Option = "Timestamp";
f1.Comparison = "GT";
f1.Value = "2020-01-01 11:44:00";
f1.Join = "";

Filter f2 = new Filter();
f2.Option = "Timestamp";
f2.Comparison = "LT";
f2.Value = "2020-06-01 00:00:00";
f2.Join = "AND";

List Filters = new List();
Filters.Add(f1);
Filters.Add(f2);

string BlobStatus = backup.BackupTableToBlob("TableName", "BlobRootName", "LocalWorkingDirectory", CompressBool, ValidateBool, RetentionDays, timeoutSeconds, Filters);
                


LinkedIn Profile Git Hub projects Nuget Packages Fuget Packages Thingverse designs Follow Us on Instagram Engage with us on Reddit
© 2017 - 2024 - The Byte Stuff, LLC
Donate via Paypal