I have written azure isolated table input function(.net 8) which return 500 if no matching record found. Previously in .net 6, it used to return null object. Can someone please guide to handle it in function signature ?
public static async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "partition/{partitionkey}/row/{rowkey}")] HttpRequest req,
[TableInput("LogTable", "{partitionkey}", "{rowkey}", Connection = "ConnectionString")] TableEntity tableEntity,
string partitionkey,
string rowkey)
{
// proceed with tableEntity record.
{
This code works fine if matching record (partition key + row key) found and return exact one row. But throws 500 error if no record exsists in table for the given key as “Cannot convert input parameter ‘tableEntity’ to type ‘Azure.Data.Tables.TableEntity’ from type ‘Microsoft.Azure.Functions.Worker.Grpc.Messages.GrpcModelBindingData’. Error:Azure.RequestFailedException: The specified resource does not exist.”
Amruta Patwardhan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.