I tried to insert log into azure table storage, but it seems it can not append rows. Here is my powershell script below:
$requestBody = Get-Content $req -Raw | ConvertFrom-Json
$name = $requestBody.name
# GET method: each querystring parameter is its own variable
if ($req_query_name)
{
$name = $req_query_name
}
function LogToAzureTable( $log )
{
$time = Get-Date -Format O
$entity = [PSObject]@{
PartitionKey = $EXECUTION_CONTEXT_INVOCATIONID
RowKey = "PID($PID): ($time)"
LogContent = $log
}
$entity | ConvertTo-Json | Out-File $outputTable
$outputTable.done
}
Out-File -Encoding Ascii -FilePath $res -inputObject "Hello $name"
LogToAzureTable "test log 1"
LogToAzureTable "test log 201"
But the "test log 1" has never been inserted. Below is the azure table content:
