1

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?

Vahagn
  • 386
  • 2
  • 21
  • Could you please provide a sample of your message? – Jim Xu Aug 19 '20 at 00:48
  • `{"Key1":"Value1", "Key2","Value2"}` – Vahagn Aug 19 '20 at 07:31
  • I got the same exception when I moved from v11 to v12 [version](https://learn.microsoft.com/en-us/azure/storage/queues/storage-quickstart-queues-dotnet) of storage client library. And the only thing so far that worked was base64. – CrnaStena Sep 14 '20 at 18:50

0 Answers0