I'm trying to update an existing row in an Azure Table from my Azure Function but it errors with:
Functions.HttpTrigger1. Microsoft.Azure.WebJobs.Host: Error while handling parameter _binder after function returned:. Microsoft.Azure.WebJobs.Extensions.Storage: The specified entity already exists.
Some research seems to indicate that you need to specify an ETag : '*'
, but I have been unsuccessful with this (I'm probably not using it correctly). There is a C# sample here (linked from the referenced git issue). Some further research seems to indicate that the ETag
value needs to be part of the header, but I cannot confirm this, nor if its true, did I see where/how I can pass headers.
Below I'm using the 'owner' as the RowKey, wanting to update the 'val2Update' on a new trigger.
Py Code
def main(req: func.HttpRequest, functionTableStorage: func.Out[str], messageJSON) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
owner = req.params.get('owner')
val2Update = req.params.get('val')
if owner:
data = {
"PartitionKey": "message",
"RowKey": owner,
"tester" : val2Update,
"ETag": "*"
}
functionTableStorage.set(json.dumps(data))
return func.HttpResponse(f"Thanks, {owner}.")
Bindings
{
"type": "table",
"direction": "out",
"name": "functionTableStorage",
"tableName": "masterTable",
"connection": "AzureWebJobsStorage"
},