Get-AzTableRow

Get-AzTableRow is a PowerShell command that can help you retrieve the rows from an Azure Storage table. In this article, I will walk you through the syntax and usage of the Get-AzTableRow cmdlet with a real-time example.

Get-AzTableRow

Below is the syntax of the Get-AzTableRow PowerShell command.

Syntax

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

Example-1: List all Azure Storage tables using the Name parameter.

Let us execute the SQL script below that will retrieve the rows from an Azure Storage table named “AzureWebJobsHostLogs202008“.

Get-AzTableRow

After executing the above script, I got the expected output, as shown below.

get-aztablerow custom filter

After executing the above script, fix the error Get-AzTableRow not recognized if you get this issue.

Example 2: List Azure Storage tables using a prefix as the table name.

We can also use -Prefix “test” instead of Name parameter as shown below. This query gets us the lists of storage accounts that are prefixed with “test” under the Azureusanew storage account.

$mystorageacntName = "azureusanew" 
$mystorageacntKey = "JlBMGRx9VHaeYOhmON62FKP9jIFbSOE5m1kNnxc/0ep5fMKeV8gAzY/GmGei7PmLYLYkHrXMXMfE+AStRiCfuw==" 
$cntx = New-AzStorageContext $mystorageacntName -StorageAccountKey $mystorageacntKey
$mycloudTable = (Get-AzStorageTable -Prefix "test" –Context $cntx).CloudTable
Get-AzTableRow -Table $mycloudTable

Example 3: List Azure Storage tables using a wildcard character

We can execute the below query to get the details of Azure storage tables where the name starts with test under a specified storage account named azureusanew.

$mystorageacntName = "azureusanew" 
$mystorageacntKey = "JlBMGRx9VHaeYOhmON62FKP9jIFbSOE5m1kNnxc/0ep5fMKeV8gAzY/GmGei7PmLYLYkHrXMXMfE+AStRiCfuw==" 
$cntx = New-AzStorageContext $mystorageacntName -StorageAccountKey $mystorageacntKey
$mycloudTable = (Get-AzStorageTable -Name test* –Context $cntx).CloudTable
Get-AzTableRow -Table $mycloudTable

Example 4: List all the Azure Storage tables without using any condition.

We can execute the below query to get the lists of all the Azure storage tables under a specified storage account. Below query gets us the lists of all the storage tables from the azureusanew storage account.

$mystorageacntName = "azureusanew" 
$mystorageacntKey = "JlBMGRx9VHaeYOhmON62FKP9jIFbSOE5m1kNnxc/0ep5fMKeV8gAzY/GmGei7PmLYLYkHrXMXMfE+AStRiCfuw==" 
$cntx = New-AzStorageContext $mystorageacntName -StorageAccountKey $mystorageacntKey
$mycloudTable = (Get-AzStorageTable –Context $cntx).CloudTable
Get-AzTableRow -Table $mycloudTable

Conclusion

In this article, we discussed the syntax and usage of the Get-AzTableRow PowerShell command with certain examples.

You may also like following the articles below.

Azure Virtual Machine

DOWNLOAD FREE AZURE VIRTUAL MACHINE PDF

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