Before we work on this we need to make sure we have a paid Azure account. Azure  free account does not provide some services which we need to run, like Azure message  services and also creating a free account on Twilio for sent messages. 
 I will discuss the following topics in this article.
  	- Create mobile app.
- Create API for sent messages.
- Create table for inserting information of sent messages.
- Queue messages.
- Create web jobs, which will run your method continuously.
Now, I will discuss the above defined points for sending a message with the help of Azure API, Web jobs and Twilio.
  	- Create Mobile App
 
 We’ll start building our notification system by logging into Azure and  	creating a new Storage mobile app. The Queue capability of the Storage  	mobile app provides a basic first-in-first-out (FIFO) queue and serves as  	the backbone of our system.
 
 After logging into Azure click “+” sign at top of left corner.
 
 ![]() 
 
 When you click on “+” sign the following window will open.
 
 ![]() 
 
 Now go in recent and click on mobile app, when you will click mobile app  	then a new window will open. From here you can create a new mobile app.
 
 ![]() 
 
 Give the app name, create or select the resource group and click on create  	button after clicking on create button a new mobile app will be created.
 
 
- Create API for send messages
 
 After creating a mobile app successfully we will create an API which will use to  	send messages. Go to your created app, a new window opens with the overview of your created  	app.
 
 ![]() 
 
 Scroll down the middle window. In the mobile section there are two  	link buttons for creating an API and table.
 
 ![]() 
 
 Click on “Easy APIs” link button for creating an API. After clicking on the “Easy  	APIs” link a new section will open for creating an API. In this new section there are add buttons; click on this add button.
 
 When you click on this add button a new section “Add API will open”.
 
 ![]() 
 
 From here you can create an API and can give the permission of your API. I  	create APIs with the permission of “Allow anonymous access”.
 
 After creating an API you need to create a table for storing message information.
 
 
- Create table for inserting information of sent messages
 
 Click on “Easy tables” link button, after clicking on this button a new section  	will open. Click on add button of this new section at top. A new section will open, “Add table”. Here you can create your table and can  	give the permission.
 
 ![]() 
 
 After table is created click on created table, table section will open. In  	table section click on “Manage Schema” button at top.
 
 A schema section will open here you can add columns of your table. Add the   following columns in your table for managing information of sent messages, such as message, phone number, status, message id, version. Following columns are automatically created by Azure id, version, updateAt, deleted, createdAt.
 
 ![]() 
 
 Now your table is created which we will use for storing message information.
 
 
- Queue Messages
 
 In this section we will read how we can queue messages. For queuing messages  	go on your created app, click on “Easy APIs” link button in mobile, click on  	your added API and “API details” section in this section click on “Edit  	Script” button.
 
 ![]() 
 
 When you click on edit script button it will redirect to a new url.
 
 It will open “App Service Editor;” here you can write script for queuing your  	message in node JS. I give a small description about “Active Service Editor”.
 
 ![]() 
 
 In “WORKING FILES” section open your JS file and write the following code.
 -   
- var azure = require("azure-storage");  
-   
- module.exports = {  
-       
-     "get": function(req, res, next) {  
-         res.send('test');  
-     },  
-       
-     "post": function(req, res, next) {  
-         var accountName = [Your Account Name];  
-         var accountKey = [Your Account Key];  
-         var host = accountName + '.queue.core.windows.net';  
-           
-         var queueSvc = azure.createQueueService(accountName, accountKey, host);  
-           
-         queueSvc.createQueueIfNotExists('[Your App Name]', function(error, result, resp) {  
-             if (!error) {  
-                   
-                 var buff = new Buffer(JSON.stringify(req.body)).toString("base64");  
-                 queueSvc.createMessage('[Your App Name]', buff, function(error, result, resp) {  
-                     if (!error) {  
-                           
-                         res.send('notifications queued');  
-                     } else {  
-                         res.send(error);  
-                     }  
-                 });  
-             } else {  
-                 res.send(error);  
-             }  
-         });  
-     }  
- }  
 
 
 ![]() 
 
 For post message defined Content-Type: application/json and in body pass the  	json object like.
 
 ![]() 
 
 After clicking on send you can see your notification now queued.
 
 Now we need to define web and code for running the web jobs.
 
 
- Create web jobs which will run your method continuously for sent messages.
 
 First create a new console project in your visual studio.
 
 Install the following NuGet Packages.
- Microsoft Azure WebJobs
- Windows Azure Mobile Services
- Twilio
After successfully installing these packages add the following code in your main  	method.- publicstaticvoid Main(string[] args) {  
-       
-     var config = new Microsoft.Azure.WebJobs.JobHostConfiguration();  
-       
-     config.Queues.MaxPollingInterval = TimeSpan.FromMinutes(3);  
-       
-     JobHost host = newJobHost(config);  
-       
-     host.RunAndBlock();  
-   
- }  
- publicstaticasyncTaskSendNotifications([QueueTrigger("Your App name")] List < Notification > notifications) {  
-     try {  
-           
-         if (!object.Equals(notifications, null)) {  
-             Console.WriteLine("Processing Notifications");  
-               
-             var mobileServiceAppUrl = ConfigurationManager.AppSettings["MOBILESERVICEAPPURL"];  
-               
-             var twilioClient = newTwilioRestClient(ConfigurationManager.AppSettings["ACCOUNTSID"], ConfigurationManager.AppSettings["AUTHTOKEN"]);  
-               
-             var amsClient = newMobileServiceClient(mobileServiceAppUrl, ConfigurationManager.AppSettings["MOBILESERVICEAPPKEY"]);  
-               
-             IMobileServiceTable < Notification > notificationsTable = amsClient.GetTable < Notification > ();  
-             foreach(var notification in notifications) {  
-                   
-                 string notificationCallbackUrl = string.Format("{0}api/notificationCallback", mobileServiceAppUrl);  
-                   
-                 await notificationsTable.InsertAsync(notification);  
-   
-                 Console.WriteLine("Sending to {0}", notification.phonenumber);  
-  
-                 #  
-                 region Twilio code  
-                 for sent message  
-                   
-                 var result = twilioClient.SendMessage(  
-                     ConfigurationManager.AppSettings["FROM"],  
-                     notification.phonenumber.Trim(),  
-                     notification.message,  
-                     notificationCallbackUrl);  
-   
-                 notification.Status = result.Status;  
-                 notification.MessageSid = result.Sid;#  
-                 endregion  
-   
-                   
-                 await notificationsTable.UpdateAsync(notification);  
-             }  
-         } else {  
-             Console.WriteLine("No notification found.");  
-         }  
-     } catch (Exception ex) {  
-         Console.WriteLine("An error occured");  
-     }  
- }  
- <connectionStrings>  
-     <addname="AzureWebJobsStorage" connectionString="DefaultEndpointsProtocol=https;AccountName=Your Account Name ;AccountKey=Your Account Key" />  
- </connectionStrings>  
- In app settings add  
- <addkey="ACCOUNTSID" value="Your twilio account SID" />  
- <addkey="AUTHTOKEN" value="Twilio Token" />  
- <addkey="FROM" value="Your twilio phone number" />  
-   
- <addkey="MOBILESERVICEAPPURL" value="http://yourappname.azurewebsites.net/" />  
- <addkey="MOBILESERVICEAPPKEY" value="Your app key" />  
![]() When you click on “Publish as Azure WebJob” following window will open.
 	When you click on “Publish as Azure WebJob” following window will open. ![]() In profile click on “Microsoft Azure WebSites”. A new window will open.
 	In profile click on “Microsoft Azure WebSites”. A new window will open.![]() If you are not logging in with “Microsoft Azure WebSites” then first login, then  	form “Existing WebSites” select your app and click Ok. 	After clicking ok you will reach this window.
 	If you are not logging in with “Microsoft Azure WebSites” then first login, then  	form “Existing WebSites” select your app and click Ok. 	After clicking ok you will reach this window.![]() Click on publish, after clicking on publish your web jobs will be created. 	Run your console application, after running your console application you can see  	your job host is started.
 	Click on publish, after clicking on publish your web jobs will be created. 	Run your console application, after running your console application you can see  	your job host is started.![]() Now run post call of your Azure API from fiddler or postman. When your  	notification in queued successfully, your web jobs will run and you can see  	the result in your console application.
 	Now run post call of your Azure API from fiddler or postman. When your  	notification in queued successfully, your web jobs will run and you can see  	the result in your console application.![]() If an error occurs at the time of inserting value in table like, “An invalid  	API version was specified in the request, this request needs to specify a  	ZUMO-API-VERSION of 2.0.0. in azure” then go to your “Azure web site” and go  	your mobile app and in settings click “Application Settings”and in “App  	Setting” add following key and value. 	Key - MS_SkipVersionCheckvalue - true
If an error occurs at the time of inserting value in table like, “An invalid  	API version was specified in the request, this request needs to specify a  	ZUMO-API-VERSION of 2.0.0. in azure” then go to your “Azure web site” and go  	your mobile app and in settings click “Application Settings”and in “App  	Setting” add following key and value. 	Key - MS_SkipVersionCheckvalue - true 	Now you can check your table data.