How to send a message to Azure service bus queue from a Azure mobile services script

How to send a message to Azure service bus queue from a Azure mobile services script

Problem

I am trying to make a hybrid application on Azure which uses both mobile services and a worker role. In a script (Node.js) which runs on mobile services DB, I want to send a message through service bus queue. Then my worker role will receive that message and perform some actions. But I can’t find how I should sent the message to service bus queue. BTW, this is not mentioned in “Mobile Services server script reference“. Is it possible at all or not? Thanks.

Problem courtesy of: Abouzar Nouri

Solution

This is possible. From your Mobile Services scripts, you can use the Azure module to talk to Service Bus. You can find the reference and source code for the Azure module here: https://github.com/WindowsAzure/azure-sdk-for-node. For an example of using the Azure module (in this case to talk to Blob Storage, but it’s useful code to go off of) take a look at this walkthrough: https://www.windowsazure.com/en-us/develop/mobile/tutorials/upload-images-to-storage-dotnet/.

Solution courtesy of: Chris

Discussion

Leave a Reply

Your email address will not be published. Required fields are marked *