I have two applications. The first one is a service written in C++ that produces messages to an Azure queue and a function app written in C# that consumes those messages. I write to the queue with Azure SDK
void send_to_queue (const string & message_body, const string & queue_name, const ::azure::storage::cloud_storage_account & storage_account){
::azure::storage::cloud_queue_client queue_client = storage_account_.create_cloud_queue_client();
::azure::storage::cloud_queue queue = queue_client.get_queue_reference(queue_name);
::azure::storage::cloud_queue_message message(message_body);
queue.add_message(message);
}
Now, the function app is default created by the VS Code's Azure plugin:
public static class MessageConsumer
{
[FunctionName("MessageConsumer")]
public static void Run([QueueTrigger("my-queue-name", Connection = "my_STORAGE")] string message, ILogger log)
{
// Code here
}
}
The function app crashes with the following error:
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 refuse to believe that the only option for me is to base64 encode the message_body in c++ using, say, boost. Is there a workaround here?