0
votes

I have an azure function project with a queue trigger; the project is an azure function v2.

When I add messages to the queue that are not of type JSON, I get an exception inside the JsonSerialization.cs at the line JObject parsed = JObject.Load(jsonReader); .

The exception is: Newtonsoft.Json.JsonReaderException: 'Unexpected end when reading JSON. Path '', line 1, position 3.'

The code then proceeds into the Queue trigger normally.

When running azure function v1, I did not run into this exception.

Could someone explain why does azure function v2 force you to have queue messages that are of type JSON? And is there a way to avoid going into the JsonSerialization.cs ??

Thank you!!

1
New version is released, have a try.Jerry Liu

1 Answers

1
votes

It's a known issue and the PR has been merged, the update will be available when next version of Microsoft.Azure.WebJobs.Extensions.Storage is published by mid October. See related comment from Azure team.

For now the workaround is to ignore this first chance exception as it doesn't cause real problem. Under Except when thrown from, check Mircrosoft.Azure.WebJobs.Host.dll.

enter image description here

Update

It should be fixed since Microsoft.Azure.WebJobs.Extensions.Storage v3.0.1