Backup Azure Table Storage - Quick PowerShell Script

Hi,

So I recently had to make some changes and wanted to ensure I could roll back, in the event of any issues.

Azure Storage is great at replication and availability but it doesn’t offer point in time restore, should you accidentally make some changes and want to roll back. So I wrote a quick little powershell script which uses AzCopy and the Table Storage Rest API to find all the tables in an account and then pull down a JSON file of their contents, tagged with the current time.

It uses a SAS token to limit the permissions the script has, only needing list & read, to minimize the risk if the script has an issue.

TableBackupPic

The only requirement for the script is AzCopy, an MS utility which it uses to pull down the content of each table.

(Here is a quick overview of SASTokens in Azure Storage, the Microsoft Storage Explore r offers a nice right click option to generate them - make sure you give the SASToken Permissions to access the Table Service, Read and List)

Hope it’s useful!