I am doing a batch insert with powershell to Azure table. using latest Az modules, not AzureRm.
$context = New-AzStorageContext $storageAccountName -StorageAccountKey $storageAccountKey
$table = (Get-AzStorageTable –Name myTable –Context $context)
foreach($item in $items){
[Microsoft.WindowsAzure.Storage.Table.TableBatchOperation]$batchOperation = New-Object -TypeName Microsoft.WindowsAzure.Storage.Table.TableBatchOperation
$entity = New-Object -TypeName Microsoft.WindowsAzure.Storage.Table.DynamicTableEntity -ArgumentList $partitionKey, $rowKey
$entity.Properties.Add("ID", $id)
$batchOperation.InsertOrReplace($entity)
}
if ($batchOperation.Count -ne 0) {
$table.CloudTable.ExecuteBatch($batchOperation)
}
But am getting error as:
Cannot find an overload for "ExecuteBatch" and the argument count: "1"
"ExecuteBatch" is this method only available in the old AzureRm module?