i trying automate query tables on various azure
storages. tables automatically generated different name every week
i looking way automatically generate list of tables available on given storage , can use foreach()
function query each table.
i've seen few bits of scripts here , there cannot effective example:
$response = invoke-webrequest -uri 'https://myaccountname.table.core.windows.net/tables/' [xml]$tables = $response.content $tablenames = $tables.feed.entry.content.properties.tablename
to fetch list of tables in storage account can use azure powershell cmdlets. there's absolutely no need via consuming rest api. cmdlet want use get-azurestoragetable
.
here's sample code:
$storageaccountname = "your storage account name" $storageaccountkey = "your storage account key" $ctx = new-azurestoragecontext -storageaccountname $storageaccountname -storageaccountkey $storageaccountkey get-azurestoragetable -context $ctx
Comments
Post a Comment