{"id":5010,"date":"2019-07-14T22:55:48","date_gmt":"2019-07-14T17:55:48","guid":{"rendered":"https:\/\/ahmadawais.com\/?p=5010"},"modified":"2020-07-06T21:41:09","modified_gmt":"2020-07-06T16:41:09","slug":"microsoft-azure-functions-javascript","status":"publish","type":"post","link":"https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/","title":{"rendered":"\u26a1 Practical Guide to Serverless Microsoft Azure Functions with JavaScript"},"content":{"rendered":"<p>As a Full Stack JavaScript developer, I am super excited about this relatively new FaaS or Functions as a Service offering that has also caught on the name of <code>Serverless<\/code> \u2014 since you don&#8217;t have to manage, update, patch, or worry about servers.<\/p>\n<p>While <a href=\"https:\/\/ahmadawais.com\/wordpress-mongodb-atlas-microsoft-azure-serverless-functions\/\">building this custom WordPress dashboard<\/a>, I wanted to make sure that each module of this dashboard lived in the form of a serverless app with multiple serverless functions. This decision was based on keeping this dashboard&#8217;s cost as economical as possible.<\/p>\n<h3 id=\"%f0%9f%91%80-three-options\">\ud83d\udc40 Three Options<a href=\"#%f0%9f%91%80-three-options\" class=\"heading-link\">#<\/a><\/h3>\n<p>There are three major cloud services providers present. That are <a href=\"https:\/\/azure.microsoft.com\/en-us\/\">Microsoft Azure<\/a>, <a href=\"https:\/\/cloud.google.com\/\">Google Cloud Platform<\/a>, and <a href=\"https:\/\/aws.amazon.com\/\">Amazon Web Services<\/a>. Each of these has serverless functions available which are called Azure functions, GCP Cloud Functions, and AWS Lambdas.<\/p>\n<h3 id=\"%f0%9f%93%98-choosing-azure\">\ud83d\udcd8 Choosing Azure<a href=\"#%f0%9f%93%98-choosing-azure\" class=\"heading-link\">#<\/a><\/h3>\n<p>Azure has one of the biggest cloud architecture and global presence. 50 Azure regions, more than any cloud provider and after testing each of these three, I found that Azure functions had the best response time in UAE (as my client&#8217;s business is based out of UAE).<\/p>\n<p>Also, the fact that we&#8217;re using Azure ML Studio, AI Cognitive Services, and Virtual Machines to host parts of this project, it made complete sense to use Azure functions for the serverless architecture.<\/p>\n<h2 id=\"getting-started-with-azure-functions\">Getting Started with Azure Functions<a href=\"#getting-started-with-azure-functions\" class=\"heading-link\">#<\/a><\/h2>\n<p>Let&#8217;s get started with Azure functions. I am going to take you through the process of creating a simple serverless Azure function, which will be triggered via HTTP requests, and inside it, we&#8217;ll process the sales information sent to us from Paddle.com.<\/p>\n<h3 id=\"%e2%9a%99-what-are-we-building\">\u2699 What are we building?!<a href=\"#%e2%9a%99-what-are-we-building\" class=\"heading-link\">#<\/a><\/h3>\n<ol>\n<li>I am building a serverless Azure function which is based on JavaScript and specifically Node.js code.<\/li>\n<li>This Azure function will get triggered by a simple <code>GET<\/code> HTTP request from our 3rd party payment solution, i.e., Paddle.com<\/li>\n<li>As soon as there&#8217;s a sale on Paddle.com, it will <a href=\"https:\/\/paddle.com\/docs\/reference-using-webhooks\">trigger a webhook<\/a> that contains info related to our sale, quantity, item, earnings, and some member-related data that WordPress sent to Paddle.<\/li>\n<li>Using WordPress REST API, I have added some custom data related to the user who purchased the product, like user&#8217;s ID in WordPress DB, which WordPress site had this sale, and such user&#8217;s meta info.<\/li>\n<li>When Azure function receives this <code>GET<\/code> request, it processes the info, takes out what I need to keep in the MongoDB Atlas Cluster and forms a JavaScript object ready to be saved in the DB.<\/li>\n<li>The azure function then connects to MongoDB Atlas instance via an npm package called <a href=\"http:\/\/mongoosejs.com\/\">mongoose<\/a>, where after connecting the database, I create a DB Model\/Schema, and then this data is saved to the MongoDB Atlas Cluster.<\/li>\n<li>After which Azure function kind of sits there waiting for next sale to happen, where my client only pays for the execution time and amount of executions for Azure functions. (<a href=\"https:\/\/azure.microsoft.com\/en-us\/pricing\/details\/functions\/\">1 million of which are free every month<\/a> \ud83d\ude2e).<\/li>\n<\/ol>\n<p>Now, this is only a high-level summary of what&#8217;s happening, there&#8217;s a lot of steps that I skipped here like authentication which is beyond the scope of this article. You should always set up authentication and verification to keep things civil and avoid any overage.<\/p>\n<p>So, let&#8217;s go ahead and build this thing.<\/p>\n<h3 id=\"step1-set-up-microsoft-azure-vscode\">Step#1: Set up Microsoft Azure &amp; VSCode<a href=\"#step1-set-up-microsoft-azure-vscode\" class=\"heading-link\">#<\/a><\/h3>\n<p>I expect you to have the <a href=\"https:\/\/azure.microsoft.com\/\">Azure<\/a> account set up on your end. You&#8217;ll need to subscribe with a credit card since we need storage for hosting the Node.js files which will be used with Azure Functions and you have to pay for storage (you&#8217;ll probably get a free $200 credit for the first month and even after that the cost is quite pretty low).<\/p>\n<p>So, go ahead and set up the following:<\/p>\n<ol>\n<li>\u2705 Setup a <a href=\"https:\/\/azure.microsoft.com\/\">Microsoft Azure<\/a> account with a credit card in billing.<\/li>\n<li>\u2705 Install <a href=\"https:\/\/code.visualstudio.com\/\">Visual Studio Code<\/a> (Psst. I&#8217;m making a <a href=\"https:\/\/ahmadawais.com\/visual-studio-code-power-user\/\">course on VSCode<\/a>).<\/li>\n<li>\u2705 Install the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-azuretools.vscode-azurefunctions\">Azure Functions extension<\/a> on your VSCode.<\/li>\n<li>\ud83d\udca1 To enable local debugging, install the <a class=\"external-link\" href=\"https:\/\/github.com\/Azure\/azure-functions-core-tools#installing\" target=\"_blank\" rel=\"noopener noreferrer\">Azure Functions Core Tools<\/a>.<\/li>\n<li>\ud83d\uddc2 Create a new directory and open it up in VSCode.<\/li>\n<\/ol>\n<p><em>In case you&#8217;re wondering which theme and font I am using, it&#8217;s \ud83e\udd84<a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ahmadawais.shades-of-purple\">Shades of Purple<\/a> \u2014 along with my <a href=\"https:\/\/VSCode.pro\/\">VSCode.pro course<\/a>. For more info see which <a href=\"https:\/\/ahmadawais.com\/uses\/\">software and hardware I use<\/a>. <\/em><\/p>\n<\/section>\n<div class=\"postcontents full\">\n<p><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ahmadawais.shades-of-purple\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4645\" src=\"https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/05\/7-VSCode-Shades-of-Puple.jpg\" alt=\"7 Vscode Shades Of Puple\" width=\"1920\" height=\"1080\" srcset=\"https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/05\/7-VSCode-Shades-of-Puple.jpg 1920w, https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/05\/7-VSCode-Shades-of-Puple-300x169.jpg 300w, https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/05\/7-VSCode-Shades-of-Puple-768x432.jpg 768w, https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/05\/7-VSCode-Shades-of-Puple-1024x576.jpg 1024w, https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/05\/7-VSCode-Shades-of-Puple-1680x945.jpg 1680w, https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/05\/7-VSCode-Shades-of-Puple-860x484.jpg 860w, https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/05\/7-VSCode-Shades-of-Puple-680x383.jpg 680w, https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/05\/7-VSCode-Shades-of-Puple-400x225.jpg 400w, https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/05\/7-VSCode-Shades-of-Puple-50x28.jpg 50w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<\/div>\n<section class=\"postcontents wrapper\">\n<h3 id=\"step2-create-a-new-function-app-project\">Step#2: Create a New Function App Project<a href=\"#step2-create-a-new-function-app-project\" class=\"heading-link\">#<\/a><\/h3>\n<p>Now let&#8217;s create a new function app project. This is really easy with VSCode. All you have to do is go-to the Azure Extension explorer present in the activity bar. From there access <code>FUNCTIONS<\/code> tab and click on the first <code>Create New Project<\/code> icon.<\/p>\n<p>This will create a demo project, with basic files required to get started and will initialize a Git repo for you. I&#8217;ll keep up with small gif based demos to make things easier for you.<\/p>\n<\/section>\n<div class=\"postcontents full\">\n<p><img decoding=\"async\" src=\"https:\/\/ddwva799xzrph.cloudfront.net\/items\/1l0g2p0Z3q1F0T120d0F\/Screen%20Recording%202018-05-21%20at%2011.41%20PM.gif\" alt=\"GIF for MongoDB Atlas, Microsoft Azure, &amp; Serverless Functions\" \/><\/p>\n<\/div>\n<section class=\"postcontents wrapper\">\n<h3 id=\"step3-create-an-http-triggered-azure-function\">Step#3: Create an HTTP-triggered Azure Function<a href=\"#step3-create-an-http-triggered-azure-function\" class=\"heading-link\">#<\/a><\/h3>\n<p>Now that we have created a function app project, let&#8217;s create an HTTP-triggered serverless Azure function. For that, go-to the Azure Extension explorer present in the activity bar. From there access <code>FUNCTIONS<\/code> tab and click on the second icon <code>Create Function<\/code>.<\/p>\n<p>For the sake of this demo, I am choosing to keep the authentication part simple so going to select anonymous access. The name of our Azure function is <code>HttpTriggerJS<\/code> so you can find a new directory created with that name inside your project. This should contain two files i.e. <code>functions.json<\/code> and <code>index.js<\/code><\/p>\n<p>\u26a1 A <em>function<\/em> is a primary concept in Azure Functions. You write code for a function in a language of your choice and save the code and configuration files in the same folder.<\/p>\n<p>\ud83d\udee0 The configuration is named <code>function.json<\/code>, which contains JSON configuration data. It defines the function bindings and other configuration settings. The runtime uses this file to determine the events to monitor and how to pass data into and return data from function execution. <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/azure-functions\/functions-reference#function-code\">Read more on this file in the official documentation here<\/a>.<\/p>\n<p>Following is an example <code>function.json<\/code> file that gets created.<\/p>\n<pre class=\"lang:json\">{\r\n\t\"disabled\": false,\r\n\t\"bindings\": [\r\n\t\t{\r\n\t\t\t\"authLevel\": \"anonymous\",\r\n\t\t\t\"type\": \"httpTrigger\",\r\n\t\t\t\"direction\": \"in\",\r\n\t\t\t\"name\": \"req\"\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"type\": \"http\",\r\n\t\t\t\"direction\": \"out\",\r\n\t\t\t\"name\": \"res\"\r\n\t\t}\r\n\t]\r\n}\r\n<\/pre>\n<p>And then, there&#8217;s an <code>index.js<\/code> file which contains a basic code that you can use to test your Azure function. It receives a parameter <code>name<\/code> and prints it back to you or shows you an error asking for this parameter.<\/p>\n<pre class=\"lang:javascript\">\/\/ FILE: index.js\r\nmodule.exports = function(context, req) {\r\n    context.log('JavaScript HTTP trigger function processed a request.');\r\n    if (req.query.name || (req.body &amp;&amp; req.body.name)) {\r\n        context.res = {\r\n            \/\/ status: 200, \/* Defaults to 200 *\/\r\n            body: \"Hello \" + (req.query.name || req.body.name)\r\n        };\r\n    } else {\r\n        context.res = {\r\n            status: 400,\r\n            body: \"Please pass a name on the query string or in the request body\"\r\n        };\r\n    }\r\n    context.done();\r\n};<\/pre>\n<\/section>\n<div class=\"postcontents full\">\n<p><img decoding=\"async\" src=\"https:\/\/ddwva799xzrph.cloudfront.net\/items\/462i2l1I0q2g3W2h380r\/Screen%20Recording%202018-05-21%20at%2011.47%20PM.gif\" alt=\"GIF for MongoDB Atlas, Microsoft Azure, &amp; Serverless Functions\" \/><\/p>\n<\/div>\n<section class=\"postcontents wrapper\">\n<h3 id=\"step4-deploy-test-your-azure-function\">Step#4: Deploy &amp; Test Your Azure Function<a href=\"#step4-deploy-test-your-azure-function\" class=\"heading-link\">#<\/a><\/h3>\n<p>Now that we have created an Azure function which can be triggered by <code>GET<\/code> HTTP request, let&#8217;s go ahead and deploy it with VSCode and test it with <a href=\"https:\/\/www.getpostman.com\/\">Postman<\/a> API Explorer.<\/p>\n<p>To deploy the function go-to the Azure Extension explorer present in the activity bar. From there access <code>FUNCTIONS<\/code> tab and click on the third icon <code>Deploy to Function App<\/code>.<\/p>\n<p>This will ask you a bunch of questions about what is the name of your app, use anything unique. I used <code>demo-wp-mdb-azure<\/code>\u2014 VSCode then use this to create a resource group, to group together your function-app related resources, it&#8217;s storage (used to save the files), and the created Azure function \u2014 finally responding us back with a public URL.<\/p>\n<p>I then went ahead to access this URL and it asked for the <code>name<\/code> param as per the code then when I sent the <code>name<\/code> param with the Postman app, it responded with <code>Hello Ahmad Awais<\/code>. \ud83d\udc4d<\/p>\n<p>VSCode also asked me to update the function extension app version to beta, and I chose yes \u2014 coz that will help me use Node.js v8 for async\/await.<\/p>\n<\/section>\n<div class=\"postcontents full\">\n<p><img decoding=\"async\" src=\"https:\/\/ddwva799xzrph.cloudfront.net\/items\/0Z292i0m2b010z3D1f2E\/Screen%20Recording%202018-05-22%20at%2012.20%20AM.gif\" alt=\"GIF for MongoDB Atlas, Microsoft Azure, &amp; Serverless Functions\" \/><\/p>\n<\/div>\n<section class=\"postcontents wrapper\">\n<h3 id=\"step5-create-package-json-and-install-mongoose\">Step#5: Create <code>package.json<\/code> and Install <a href=\"http:\/\/mongoosejs.com\/\"><code>mongoose<\/code><\/a><a href=\"#step5-create-package-json-and-install-mongoose\" class=\"heading-link\">#<\/a><\/h3>\n<p>Now that our Azure function is up and running. Let&#8217;s create a <code>package.json<\/code> file in the root of our project and install <a href=\"http:\/\/mongoosejs.com\/\"><code>mongoose<\/code><\/a>. We&#8217;ll need this to connect and save data to our MongoDB Atlas Cluster.<\/p>\n<p>Mongoose provides a straight-forward, schema-based solution to model your application data. It includes built-in typecasting, validation, query building, business logic hooks and more, out of the box. It&#8217;s pretty awesome. \ud83d\udcaf<\/p>\n<\/section>\n<div class=\"postcontents full\">\n<p><img decoding=\"async\" src=\"https:\/\/ddwva799xzrph.cloudfront.net\/items\/3y2S050O3m172T2e061U\/Screen%20Recording%202018-05-22%20at%2012.36%20AM.gif\" alt=\"GIF for MongoDB Atlas, Microsoft Azure, &amp; Serverless Functions\" \/><\/p>\n<\/div>\n<section class=\"postcontents wrapper\">\n<h3 id=\"step6-add-app-setting-for-mongodb-connection\">Step#6: Add App Setting for MongoDB Connection<a href=\"#step6-add-app-setting-for-mongodb-connection\" class=\"heading-link\">#<\/a><\/h3>\n<p>Now we are almost ready to start writing code for our application. But before doing that, we&#8217;ll need a connection string to be able to connect to our MongoDB Atlas Cluster (just like we did with MongoDB Compass). This connection string is private and you shouldn&#8217;t commit it to the git repo.<\/p>\n<p>\ud83d\udcaf This connections string belongs to the <code>local.settings.json<\/code> file in the project root. Let&#8217;s first download the settings, then add <code>MongodbAtlas<\/code> setting with our connection string (get this string from the MongoDB Atlas dashboard) and upload the app settings.<\/p>\n<p>To do this, go-to the Azure Extension explorer present in the activity bar. From there access <code>FUNCTIONS<\/code> tab and select your subscription, then your Azure function app, i.e., <code>demo-wp-mdb-azure<\/code> and then right click <code>Application Settings<\/code> to select <code>Download remote settings\u2026<\/code> to download and <code>Upload local settings\u2026<\/code> to upload the settings after adding the <code>MongodbAtlas<\/code> connection string to the settings.<\/p>\n<\/section>\n<div class=\"postcontents full\">\n<p><img decoding=\"async\" src=\"https:\/\/ddwva799xzrph.cloudfront.net\/items\/0D2X2I100v1Y0i0R0K2g\/Screen%20Recording%202018-05-22%20at%2001.19%20AM.gif\" alt=\"GIF for MongoDB Atlas, Microsoft Azure, &amp; Serverless Functions\" \/><\/p>\n<\/div>\n<section class=\"postcontents wrapper\">\n<h3 id=\"step7-update-node-version-of-azure-function\">Step#7: Update Node Version of Azure Function<a href=\"#step7-update-node-version-of-azure-function\" class=\"heading-link\">#<\/a><\/h3>\n<p>In the code, I intend to use <code>async<\/code>\/<code>await<\/code> which are not available on <code>v6.5.0<\/code> of Node.js that comes with the default version 1 of Azure functions. In the step #4, VSCode asked me to update to the runtime version of Azure function to beta and I did that. This enables support for latest Node.js versions on Azure functions.<\/p>\n<p>So, let&#8217;s just update <code>WEBSITE_NODE_DEFAULT_VERSION<\/code> app setting in our local settings and update that to the remote settings.<\/p>\n<\/section>\n<div class=\"postcontents full\">\n<p><img decoding=\"async\" src=\"https:\/\/ddwva799xzrph.cloudfront.net\/items\/1b1b3e3h1N3u0k0W3b2C\/Screen%20Recording%202018-05-22%20at%2001.44%20AM.gif\" alt=\"GIF for MongoDB Atlas, Microsoft Azure, &amp; Serverless Functions\" \/><\/p>\n<\/div>\n<section class=\"postcontents wrapper\">\n<h3 id=\"step8-create-mongodb-model-schema\">Step#8: Create MongoDB Model\/Schema<a href=\"#step8-create-mongodb-model-schema\" class=\"heading-link\">#<\/a><\/h3>\n<p>Before we save any data to our MongoDB Atlas Cluster, let&#8217;s create a <code>modelSale.js<\/code> file that will contain the model&#8217;s schema for what we intend to save in the database. It&#8217;s an extremely simple schema implementation, I suggest you read up on what you can do here with <code><a href=\"http:\/\/mongoosejs.com\/docs\/guide.html\">mongoose<\/a><\/code> and <a href=\"https:\/\/docs.mongodb.com\/manual\/data-modeling\/\">MongoDB<\/a>.<\/p>\n<p><em> This file is pretty much self-explanatory.<\/em><\/p>\n<pre class=\"lang:javascript\">\/\/ FILE: modeSchema.js\r\n\/**\r\n * Model: Sale\r\n *\/\r\nconst mongoose = require('mongoose');\r\nmongoose.Promise = global.Promise;\r\n\/\/ Sale Schema.\r\nconst saleSchema = new mongoose.Schema({\r\n    sale_gross: Number,\r\n    earnings: Number,\r\n    currency: String,\r\n    memberSince: Date,\r\n    customerEmail: String,\r\n    event_time: {\r\n        type: Date,\r\n        default: Date.now\r\n    },\r\n});\r\n\/\/ Export the model.\r\nmodule.exports = mongoose.model('Sale', saleSchema);<\/pre>\n<h3 id=\"step9-code-the-%e2%9a%a1azure-function-with-node-js\">Step#9: Code the \u26a1Azure Function with Node.js<a href=\"#step9-code-the-%e2%9a%a1azure-function-with-node-js\" class=\"heading-link\">#<\/a><\/h3>\n<p>Now let&#8217;s code our Azure function. I&#8217;m adding all the main code lives inside the <code>index.js<\/code> file for the purpose of this demo. Also going to use the <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/azure-functions\/functions-reference-node#context-object\">context object<\/a> as the first parameter, make sure you <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/azure-functions\/functions-reference-node#context-object\">read about that<\/a>. Everything else is explained in the code snippet below.<\/p>\n<p>A high-level overview of the code for this article. It does the following:<\/p>\n<ul>\n<li>\u2705 Gets the data from Paddle.com<\/li>\n<li>\u26a1 Connects to the MongoDB Atlas via connection string that we added in our Application Settings.<\/li>\n<li>\ud83d\udcd8 Uses the defined DB schema inside the <code>test<\/code> database where it creates a <code>sales<\/code> collection including documents for our sales.<\/li>\n<li>\u2699 Validates the data and creates a <code>finalData<\/code> object that gets saved in the MongoDB Atlas Cluster. Yay!!!<\/li>\n<li>\ud83e\udd45 Finally, responds to the Paddle webhook with <code>200<\/code> status code if all goes well, and does the <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/azure-functions\/functions-reference-node#context-object\"><code>context.done()<\/code><\/a> dance.<\/li>\n<\/ul>\n<p><em>Everything is pretty much explained with inline documentation.<\/em><\/p>\n<pre class=\"lang:javascript\">\/\/ FILE: index.js\r\n\/**\r\n * Azure Function: Sale.\r\n *\r\n * Gets data from Paddle.com (which in turn gets data\r\n * from WordPress) and processes the data, creates a\r\n * finalData object and saves it in MongoDB Atlas.\r\n *\r\n * @param context To pass data between function to \/ from runtime.\r\n * @param req HTTP Request sent to the Azure function by Paddle.\r\n *\/\r\nmodule.exports = async function(context, req) {\r\n    \/\/ Let's call it log.\r\n    const log = context.log;\r\n    \/\/ Log the entire request just for the demo.\r\n    log('[RAN] RequestUri=%s', req.originalUrl);\r\n    \/**\r\n     * Azure function Response.\r\n     *\r\n     * Processes the `req` request from Paddle.com\r\n     * and saves the data to MongoDB Atlas while\r\n     * responding the `res` response.\r\n     *\/\r\n    \/\/ Database interaction.\r\n    const mongoose = require('mongoose');\r\n    const DATABASE = process.env.MongodbAtlas;\r\n    \/\/ Connect to our Database and handle any bad connections\r\n    mongoose.connect(DATABASE);\r\n    mongoose.Promise = global.Promise; \/\/ Tell Mongoose to use ES6 promises\r\n    mongoose.connection.on('error', (err) =&gt; {\r\n        context.log(`ERROR\u2192 ${err.message}`);\r\n    });\r\n    \/\/ Sale Schema.\r\n    require('.\/modelSale');\r\n    const Sale = mongoose.model('Sale');\r\n    \/\/ Create a Response.\r\n    if (req.query.customFieldName) { \/\/ Simple authentication for the purpose of demo.\r\n        \/\/ Build the data we need.\r\n        const sale_gross = req.query.p_sale_gross || '0';\r\n        const earnings = JSON.parse(req.query.p_earnings)['16413'] || '0'\r\n        const currency = req.query.p_currency || 'USD';\r\n        const memberSince = req.query.memberSince || new Date();\r\n        const customerEmail = req.query.customerEmail || '';\r\n        const event_time = new Date();\r\n        log('[OUTPUT]\u2014\u2014 sale_gross: ' + sale_gross);\r\n        log('[OUTPUT]\u2014\u2014 earnings: ' + earnings);\r\n        log('[OUTPUT]\u2014\u2014 currency: ' + currency);\r\n        const finalData = {\r\n            sale_gross: sale_gross,\r\n            earnings: earnings,\r\n            currency: currency,\r\n            memberSince: memberSince,\r\n            customerEmail: customerEmail,\r\n            event_time: event_time,\r\n        }\r\n        \/\/ Save to db.\r\n        const sale = await (new Sale(finalData))\r\n            .save();\r\n        log(\"[OUTPUT]\u2014\u2014 SALE SAVED: \", sale);\r\n        \/\/ Respond with 200.\r\n        context.res = {\r\n            status: 200,\r\n            body: \"Thank You for the payment! \" + (req.query.customFieldName || req.body.customFieldName)\r\n        };\r\n    } else {\r\n        context.res = {\r\n            status: 400,\r\n            body: \"Please pass a name on the query string or in the request body\"\r\n        };\r\n    }\r\n    \/\/ Informs the runtime that your code has finished. You must call context.done, or else the runtime never knows that your function is complete, and the execution will time out.\r\n    \/\/ @link: https:\/\/docs.microsoft.com\/en-us\/azure\/azure-functions\/functions-reference-node#contextdone-method\r\n    context.done();\r\n};<\/pre>\n<h3 id=\"step10-re-deploy-the-azure-function\">Step#10: Re-Deploy The Azure Function<a href=\"#step10-re-deploy-the-azure-function\" class=\"heading-link\">#<\/a><\/h3>\n<p>Now let&#8217;s re-deploy the Azure function. For that, go-to the Azure Extension explorer present in the activity bar. From there access <code>FUNCTIONS<\/code> tab and click on the third <code>Deploy to Function App<\/code> icon.<\/p>\n<\/section>\n<div class=\"postcontents full\">\n<p><img decoding=\"async\" src=\"https:\/\/ddwva799xzrph.cloudfront.net\/items\/0k1I0r0o2Z023Y1m3z1T\/Screen%20Recording%202018-05-22%20at%2002.20%20AM.gif\" alt=\"GIF for MongoDB Atlas, Microsoft Azure, &amp; Serverless Functions\" \/>&gt;<\/p>\n<\/div>\n<section class=\"postcontents wrapper\">\n<h3 id=\"step11-test-azure-function-via-paddles-webhook\">Step#11: Test Azure Function via Paddle&#8217;s Webhook<a href=\"#step11-test-azure-function-via-paddles-webhook\" class=\"heading-link\">#<\/a><\/h3>\n<p>Looks like we&#8217;re pretty much done. All that&#8217;s left is to test our Azure function by triggering a dummy webhook via Paddle.com. Let&#8217;s do that. Also, when things do work, let&#8217;s explore how our data looks in the MongoDB Compass.<\/p>\n<\/section>\n<div class=\"postcontents full\">\n<p><img decoding=\"async\" src=\"https:\/\/ddwva799xzrph.cloudfront.net\/items\/0h090Q0c2P3C3f112h0E\/Screen%20Recording%202018-05-22%20at%2002.32%20AM.gif\" alt=\"GIF for MongoDB Atlas, Microsoft Azure, &amp; Serverless Functions\" \/><\/p>\n<\/div>\n<section class=\"postcontents wrapper\">\n<p><em>Wow, Humph!!! That was a lot. Glad it worked. \ud83c\udf89<\/em><\/p>\n<h2 id=\"%f0%9f%a4%94-so-what-just-happened\">\ud83e\udd14 So, What Just Happened?!<a href=\"#%f0%9f%a4%94-so-what-just-happened\" class=\"heading-link\">#<\/a><\/h2>\n<p>Prepare yourself for a mouthful.<\/p>\n<p>1\ufe0f\u20e3 I created a small part of the <code>Sales<\/code> module in the custom WordPress Dashboard app that I am building<\/p>\n<p>2\ufe0f\u20e3 I used MongoDB Atlas and Compass, then created Microsoft \u26a1Azure Function via Function App with <a href=\"https:\/\/VSCode.pro\/\">VSCode<\/a><\/p>\n<p>3\ufe0f\u20e3 I deployed the app with env secret as application string with the MongoDB connection string<\/p>\n<p>4\ufe0f\u20e3 I then updated the Node.js version for Azure functions<\/p>\n<p>5\ufe0f\u20e3 And then I triggered the function via a dummy webhook from Paddle.com (like it will get triggered when an actual sale will happen) to send data (from Paddle + WordPress) to our Azure function and from there to MongoDB Atlas.<\/p>\n<p>\u2705 <em>And it worked, haha! <\/em><\/p>\n<p><em>\u2014 So, yes, try out Microsoft Azure functions and share your thoughts below, over to you!<\/em><\/p>\n<hr \/>\n<h3 style=\"text-align: center;\" style=\"text-align: center;\" id=\"%f0%9f%93%ba\">\ud83d\udcfa<a href=\"#%f0%9f%93%ba\" class=\"heading-link\">#<\/a><\/h3>\n<h2 style=\"text-align: center;\" style=\"text-align: center;\" id=\"got-featured-in-azure-functions-live\">Got Featured in Azure Functions Live<a href=\"#got-featured-in-azure-functions-live\" class=\"heading-link\">#<\/a><\/h2>\n<p>Folks, I just found out that this post was featured in <a href=\"https:\/\/youtu.be\/2drWQ0CtaFA?t=845\">Azure Functions Live<\/a> by the Azure Functions Team. They said some really nice stuff about it. Check it out below.<\/p>\n<\/section>\n<div class=\"postcontents full dark\">\n<div class=\"wrapper\">\n<div class=\"wide\">\n<p><iframe loading=\"lazy\" title=\"Featured in Azure Functions Live - Oct 2018\" src=\"https:\/\/player.vimeo.com\/video\/305973906?dnt=1&amp;app_id=122963\" width=\"500\" height=\"281\" frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture; clipboard-write\"><\/iframe><\/p>\n<\/div>\n<\/div>\n<\/div>\n<section class=\"postcontents wrapper\">\n","protected":false},"excerpt":{"rendered":"<p>As a Full Stack JavaScript developer, I am super excited about this relatively new FaaS or Functions as a Service offering that has also caught on the name of Serverless \u2014 since you don&#8217;t have to manage, update, patch, or worry about servers. While building this custom WordPress dashboard, I wanted to make sure that each module of this dashboard lived in the form of a serverless app with multiple serverless functions. This decision was based on keeping this dashboard&#8217;s cost as economical as possible. \ud83d\udc40 Three Options# There are three major cloud services providers present. That are Microsoft Azure, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":5015,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"webmentions_disabled_pings":false,"webmentions_disabled":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[181],"tags":[193,216,212],"class_list":["post-5010","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-azure","tag-azure-functions","tag-microsoft-azure"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u26a1 Practical Guide to Serverless Microsoft Azure Functions with JavaScript<\/title>\n<meta name=\"description\" content=\"As a Full Stack JavaScript developer, I am super excited about this relatively new FaaS or Functions as a Service offering that has also caught on the\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u26a1 Practical Guide to Serverless Microsoft Azure Functions with JavaScript\" \/>\n<meta property=\"og:description\" content=\"As a Full Stack JavaScript developer, I am super excited about this relatively new FaaS or Functions as a Service offering that has also caught on the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"Ahmad Awais\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/AhmadAwais\" \/>\n<meta property=\"article:author\" content=\"https:\/\/facebook.com\/AhmadAwais\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-14T17:55:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-07-06T16:41:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/10\/Practical-Guide-to-Serverless-Microsoft-Azure-Functions-with-JavaScript-bg-only.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ahmad Awais\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@MrAhmadAwais\" \/>\n<meta name=\"twitter:site\" content=\"@MrAhmadAwais\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ahmad Awais\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/microsoft-azure-functions-javascript\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/microsoft-azure-functions-javascript\\\/\"},\"author\":{\"name\":\"Ahmad Awais\",\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/#\\\/schema\\\/person\\\/1d1b9504182dca2315cf039fb4ebb85b\"},\"headline\":\"\u26a1 Practical Guide to Serverless Microsoft Azure Functions with JavaScript\",\"datePublished\":\"2019-07-14T17:55:48+00:00\",\"dateModified\":\"2020-07-06T16:41:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/microsoft-azure-functions-javascript\\\/\"},\"wordCount\":2037,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/#\\\/schema\\\/person\\\/1d1b9504182dca2315cf039fb4ebb85b\"},\"image\":{\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/microsoft-azure-functions-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ahmadawais.com\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/Practical-Guide-to-Serverless-Microsoft-Azure-Functions-with-JavaScript-bg-only.jpg\",\"keywords\":[\"Azure\",\"Azure Functions\",\"Microsoft Azure\"],\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ahmadawais.com\\\/microsoft-azure-functions-javascript\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/microsoft-azure-functions-javascript\\\/\",\"url\":\"https:\\\/\\\/ahmadawais.com\\\/microsoft-azure-functions-javascript\\\/\",\"name\":\"\u26a1 Practical Guide to Serverless Microsoft Azure Functions with JavaScript\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/microsoft-azure-functions-javascript\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/microsoft-azure-functions-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ahmadawais.com\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/Practical-Guide-to-Serverless-Microsoft-Azure-Functions-with-JavaScript-bg-only.jpg\",\"datePublished\":\"2019-07-14T17:55:48+00:00\",\"dateModified\":\"2020-07-06T16:41:09+00:00\",\"description\":\"As a Full Stack JavaScript developer, I am super excited about this relatively new FaaS or Functions as a Service offering that has also caught on the\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/microsoft-azure-functions-javascript\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ahmadawais.com\\\/microsoft-azure-functions-javascript\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/microsoft-azure-functions-javascript\\\/#primaryimage\",\"url\":\"https:\\\/\\\/ahmadawais.com\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/Practical-Guide-to-Serverless-Microsoft-Azure-Functions-with-JavaScript-bg-only.jpg\",\"contentUrl\":\"https:\\\/\\\/ahmadawais.com\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/Practical-Guide-to-Serverless-Microsoft-Azure-Functions-with-JavaScript-bg-only.jpg\",\"width\":1920,\"height\":1080,\"caption\":\"Practical Guide To Serverless Microsoft Azure Functions With Javascript Bg Only\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/microsoft-azure-functions-javascript\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ahmadawais.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u26a1 Practical Guide to Serverless Microsoft Azure Functions with JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/#website\",\"url\":\"https:\\\/\\\/ahmadawais.com\\\/\",\"name\":\"Ahmad Awais\",\"description\":\"Founder &amp; CEO of CommandCode.ai f\\\/k\\\/a Langbase | Google Developers Advisory Board (gDAB) founding member\",\"publisher\":{\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/#\\\/schema\\\/person\\\/1d1b9504182dca2315cf039fb4ebb85b\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ahmadawais.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/#\\\/schema\\\/person\\\/1d1b9504182dca2315cf039fb4ebb85b\",\"name\":\"Ahmad Awais\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/Ahmad-Awais-face.jpg\",\"url\":\"https:\\\/\\\/ahmadawais.com\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/Ahmad-Awais-face.jpg\",\"contentUrl\":\"https:\\\/\\\/ahmadawais.com\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/Ahmad-Awais-face.jpg\",\"width\":2299,\"height\":1705,\"caption\":\"Ahmad Awais\"},\"logo\":{\"@id\":\"https:\\\/\\\/ahmadawais.com\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/Ahmad-Awais-face.jpg\"},\"description\":\"Founder & CEO of \u2318 Command Code coding agent with taste. Founded Langbase.com, AI cloud to build, deploy, and scale AI agents with tools & memory \u00b7 Creator of Command.new. \\\"Awais is an awesome example for developers\\\" \u2014 Satya Nadella, CEO of Microsoft. NASA Mars Ingenuity Helicopter mission code contributor 8th GitHub Stars Award recipient with 5x GitHub Stars Award (Listed as GitHub's #1 JavaScript trending developer). Google Developers Expert Web DevRel. Ex VP Eng (DevTools & DevRel) Rapid \u00b7 Google Developers Advisory Board (gDAB) founding member \u00b7 AI\\\/ML\\\/DevTools Angel Investor (Replit, Resend, Daytona, Gumroad and you?) \u276f AI\\\/ML Advisory Board San Francisco, DevNetwork. Award-winning Open Source Engineering leader authored hundreds of open-source dev-tools and software libraries used by millions of developers, including Shades of Purple code theme and corona-cli. Linux Foundation (Node.js Committee Lead), OpenAPI Business Governing Board. Taught 108K+ developers via NodeCLI.com and VSCode.pro course. 274 million views, blogging for 24 yrs. \u276f Read more about Ahmad Awais or come say hi on \ud835\udd4f @MrAhmadAwais.\",\"sameAs\":[\"https:\\\/\\\/AhmadAwais.com\\\/\",\"https:\\\/\\\/facebook.com\\\/AhmadAwais\",\"https:\\\/\\\/instagram.com\\\/MrAhmadAwais\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/MrAhmadAwais\\\/\",\"https:\\\/\\\/x.com\\\/MrAhmadAwais\",\"https:\\\/\\\/youtube.com\\\/AhmadAwais\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u26a1 Practical Guide to Serverless Microsoft Azure Functions with JavaScript","description":"As a Full Stack JavaScript developer, I am super excited about this relatively new FaaS or Functions as a Service offering that has also caught on the","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/","og_locale":"en_US","og_type":"article","og_title":"\u26a1 Practical Guide to Serverless Microsoft Azure Functions with JavaScript","og_description":"As a Full Stack JavaScript developer, I am super excited about this relatively new FaaS or Functions as a Service offering that has also caught on the","og_url":"https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/","og_site_name":"Ahmad Awais","article_publisher":"https:\/\/facebook.com\/AhmadAwais","article_author":"https:\/\/facebook.com\/AhmadAwais","article_published_time":"2019-07-14T17:55:48+00:00","article_modified_time":"2020-07-06T16:41:09+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/10\/Practical-Guide-to-Serverless-Microsoft-Azure-Functions-with-JavaScript-bg-only.jpg","type":"image\/jpeg"}],"author":"Ahmad Awais","twitter_card":"summary_large_image","twitter_creator":"@MrAhmadAwais","twitter_site":"@MrAhmadAwais","twitter_misc":{"Written by":"Ahmad Awais","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/#article","isPartOf":{"@id":"https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/"},"author":{"name":"Ahmad Awais","@id":"https:\/\/ahmadawais.com\/#\/schema\/person\/1d1b9504182dca2315cf039fb4ebb85b"},"headline":"\u26a1 Practical Guide to Serverless Microsoft Azure Functions with JavaScript","datePublished":"2019-07-14T17:55:48+00:00","dateModified":"2020-07-06T16:41:09+00:00","mainEntityOfPage":{"@id":"https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/"},"wordCount":2037,"commentCount":5,"publisher":{"@id":"https:\/\/ahmadawais.com\/#\/schema\/person\/1d1b9504182dca2315cf039fb4ebb85b"},"image":{"@id":"https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/10\/Practical-Guide-to-Serverless-Microsoft-Azure-Functions-with-JavaScript-bg-only.jpg","keywords":["Azure","Azure Functions","Microsoft Azure"],"articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/","url":"https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/","name":"\u26a1 Practical Guide to Serverless Microsoft Azure Functions with JavaScript","isPartOf":{"@id":"https:\/\/ahmadawais.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/#primaryimage"},"image":{"@id":"https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/10\/Practical-Guide-to-Serverless-Microsoft-Azure-Functions-with-JavaScript-bg-only.jpg","datePublished":"2019-07-14T17:55:48+00:00","dateModified":"2020-07-06T16:41:09+00:00","description":"As a Full Stack JavaScript developer, I am super excited about this relatively new FaaS or Functions as a Service offering that has also caught on the","breadcrumb":{"@id":"https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/#primaryimage","url":"https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/10\/Practical-Guide-to-Serverless-Microsoft-Azure-Functions-with-JavaScript-bg-only.jpg","contentUrl":"https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/10\/Practical-Guide-to-Serverless-Microsoft-Azure-Functions-with-JavaScript-bg-only.jpg","width":1920,"height":1080,"caption":"Practical Guide To Serverless Microsoft Azure Functions With Javascript Bg Only"},{"@type":"BreadcrumbList","@id":"https:\/\/ahmadawais.com\/microsoft-azure-functions-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ahmadawais.com\/"},{"@type":"ListItem","position":2,"name":"\u26a1 Practical Guide to Serverless Microsoft Azure Functions with JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/ahmadawais.com\/#website","url":"https:\/\/ahmadawais.com\/","name":"Ahmad Awais","description":"Founder &amp; CEO of CommandCode.ai f\/k\/a Langbase | Google Developers Advisory Board (gDAB) founding member","publisher":{"@id":"https:\/\/ahmadawais.com\/#\/schema\/person\/1d1b9504182dca2315cf039fb4ebb85b"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ahmadawais.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/ahmadawais.com\/#\/schema\/person\/1d1b9504182dca2315cf039fb4ebb85b","name":"Ahmad Awais","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ahmadawais.com\/wp-content\/uploads\/2020\/06\/Ahmad-Awais-face.jpg","url":"https:\/\/ahmadawais.com\/wp-content\/uploads\/2020\/06\/Ahmad-Awais-face.jpg","contentUrl":"https:\/\/ahmadawais.com\/wp-content\/uploads\/2020\/06\/Ahmad-Awais-face.jpg","width":2299,"height":1705,"caption":"Ahmad Awais"},"logo":{"@id":"https:\/\/ahmadawais.com\/wp-content\/uploads\/2020\/06\/Ahmad-Awais-face.jpg"},"description":"Founder & CEO of \u2318 Command Code coding agent with taste. Founded Langbase.com, AI cloud to build, deploy, and scale AI agents with tools & memory \u00b7 Creator of Command.new. \"Awais is an awesome example for developers\" \u2014 Satya Nadella, CEO of Microsoft. NASA Mars Ingenuity Helicopter mission code contributor 8th GitHub Stars Award recipient with 5x GitHub Stars Award (Listed as GitHub's #1 JavaScript trending developer). Google Developers Expert Web DevRel. Ex VP Eng (DevTools & DevRel) Rapid \u00b7 Google Developers Advisory Board (gDAB) founding member \u00b7 AI\/ML\/DevTools Angel Investor (Replit, Resend, Daytona, Gumroad and you?) \u276f AI\/ML Advisory Board San Francisco, DevNetwork. Award-winning Open Source Engineering leader authored hundreds of open-source dev-tools and software libraries used by millions of developers, including Shades of Purple code theme and corona-cli. Linux Foundation (Node.js Committee Lead), OpenAPI Business Governing Board. Taught 108K+ developers via NodeCLI.com and VSCode.pro course. 274 million views, blogging for 24 yrs. \u276f Read more about Ahmad Awais or come say hi on \ud835\udd4f @MrAhmadAwais.","sameAs":["https:\/\/AhmadAwais.com\/","https:\/\/facebook.com\/AhmadAwais","https:\/\/instagram.com\/MrAhmadAwais\/","https:\/\/www.linkedin.com\/in\/MrAhmadAwais\/","https:\/\/x.com\/MrAhmadAwais","https:\/\/youtube.com\/AhmadAwais"]}]}},"jetpack_featured_media_url":"https:\/\/ahmadawais.com\/wp-content\/uploads\/2018\/10\/Practical-Guide-to-Serverless-Microsoft-Azure-Functions-with-JavaScript-bg-only.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ahmadawais.com\/api\/wp\/v2\/posts\/5010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ahmadawais.com\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahmadawais.com\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahmadawais.com\/api\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ahmadawais.com\/api\/wp\/v2\/comments?post=5010"}],"version-history":[{"count":5,"href":"https:\/\/ahmadawais.com\/api\/wp\/v2\/posts\/5010\/revisions"}],"predecessor-version":[{"id":7206,"href":"https:\/\/ahmadawais.com\/api\/wp\/v2\/posts\/5010\/revisions\/7206"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ahmadawais.com\/api\/wp\/v2\/media\/5015"}],"wp:attachment":[{"href":"https:\/\/ahmadawais.com\/api\/wp\/v2\/media?parent=5010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahmadawais.com\/api\/wp\/v2\/categories?post=5010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahmadawais.com\/api\/wp\/v2\/tags?post=5010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}