Get-AzStorageTable

In this Azure PowerShell article, we will discuss the syntax and usage of the Get-AzStorageTable Azure PowerShell command, along with several examples.

Get-AzStorageTable

Get-AzStorageTable is an excellent PowerShell command that can help you retrieve the list of available storage tables associated with the specified Storage account.

Syntax

Below is the syntax of the Get-AzStorageTable Azure PowerShell command.

Get-AzStorageTable
Get-AzStorageTable
 [[-Name] <String>]
Get-AzStorageTable
 -Prefix <String>

Examples

Let’s discuss a few examples of how to use the Get-AzStorageTable PowerShell command.

Example-1

You can execute the Azure PowerShell command below to help you retrieve the lists of available storage tables associated with the specified Storage account.

$mysARG = "Demo123"
$mysAName = "demo123b08c"
$mysAKey = (Get-AzStorageAccountKey -ResourceGroupName $mysARG -AccountName $mysAName).Value[0]
$myctx = New-AzStorageContext -StorageAccountName $mysAName -StorageAccountKey $mysAKey
Get-AzStorageTable -Context $myctx

After executing the above PowerShell command, I received the output shown below, which was not as expected.


   Table End Point: https://demo123b08c.table.core.windows.net/

Name                                 Uri                                                                            
----                                 ---                                                                            
AzureFunctionsScaleMetrics202309     https://demo123b08c.table.core.windows.net/AzureFunctionsScaleMetrics202309    
flowf433c9d06f75f95flowsubscriptions https://demo123b08c.table.core.windows.net/flowf433c9d06f75f95flowsubscriptions
flowf433c9d06f75f95jobdefinitions    https://demo123b08c.table.core.windows.net/flowf433c9d06f75f95jobdefinitions   

You can check out the same output below.

Get-AzStorageTable

Note: Make sure to pass the storage context with the Get-AzStorageTable command, or else you will get the error Get-AzStorageTable: Could not get the storage context. Please pass in a storage context or set the current storage context.

Example-2

The Azure PowerShell command below can help you retrieve a list of Azure Storage tables whose names start with the specified name or wildcard character.

$mysARG = "Demo123"
$mysAName = "demo123b08c"
$mysAKey = (Get-AzStorageAccountKey -ResourceGroupName $mysARG -AccountName $mysAName).Value[0]
$myctx = New-AzStorageContext -StorageAccountName $mysAName -StorageAccountKey $mysAKey
Get-AzStorageTable -Name flow* -Context $myctx

After executing the above PowerShell script, I received the output shown below, which was not as expected.

get-azstoragetable examples

Wrapping Up

In this Azure PowerShell article, we discuss the syntax and usage of the Get-AzStorageTable Azure PowerShell command, along with several examples. Thanks for reading this article !!!

Azure Virtual Machine

DOWNLOAD FREE AZURE VIRTUAL MACHINE PDF

Download our free 25+ page Azure Virtual Machine guide and master cloud deployment today!