I use Azure Functions with Queue triggers in my backend and up to this point, I'd been using the Microsoft.WindowsAzure.Storage
package to handle all Azure Storage operations i.e. queues, blobs, etc. With this package, I'd simply send a MyQueueRequest
object to my queue and everything worked fine.
Because the Microsoft.WindowsAzure.Storage
package has been deprecated, I swithched to Azure.Storage.Queue
and my Azure Function started throwing the following error:
Microsoft.Azure.WebJobs.Host: Exception binding parameter 'message'. System.Private.CoreLib: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
I've found this article that suggests that the new library requires JSON
objects to be encoded in Base64
(https://briancaos.wordpress.com/2020/10/16/sending-json-with-net-core-queueclient-sendmessageasync/).
Up to this point, I actually never even serialized my MyQueueRequest
object to JSON
. The model binder took care of that for me automatically.
Does this mean, going forward, before sending the message to my queue, I need to first serialize MyQueueRequest
object and then Base64
encode it and then reverse the process in my Azure Functions?