A few months back I started using Azure Tables as a quick, cheap, and simple database for a project at work. I was recently re-factoring my main Powershell script which spits data out into an Azure Table for later PowerBI reporting. Thankfully, even though it was close to midnight, my years of “ops management brain” kicked in before I pushed the “go” button on my refactored script. Thankfully it dawned on me I should be testing my updated script on a copy of my table vs. the only copy of the data I had.
Being late and me being tired, it didn’t occur to me to just try Azure Storage Explorer, which allows you to easily copy a table from one storage account to another. Instead, I turned to Powershell. What I came up with is a simple Powershell Function that creates a new empty table, reads the contents of your source table to an array and then pushes that array back into the new empty table. Using Powershell 7 batch processing, it works pretty quickly… granted my table only has like 2,000 rows. With that said, these Powershell snippets require Powershell 7, click here for install instructions.