I have the following PowerShell script to delete tables from a storage account (referred to https://learn.microsoft.com/en-us/azure/storage/scripts/storage-blobs-container-delete-by-prefix-powershell#sample-script):
$storageAccount = Get-AzStorageAccount -ResourceGroupName "<resource-group>" -Name "<storage-account-name>"
$ctx = $storageAccount.Context
$listOfTablesToDelete = Get-AzStorageTable -Context $ctx | select Name
$listOfTablesToDelete | Remove-AzStorageTable -Context $ctx
This works fine. However, if the table has a large number of rows, it takes forever to delete. Is there a way show the status of how many rows have been deleted via script?
In my storage account, I have a couple of tables with different number of rows as below:
Table01:
Table02:
To show the status of how many rows have been deleted, I ran below script that initially delete rows and then delete tables as below:
Response:
When I checked the same in Portal, tables deleted successfully in storage account as below: