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 Explorer 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!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: