Move a Simple JavaScript Node.js AWS Lambda Function to Azure
Tags: javascript, aws, azure, serverless
Published: 2019-09-11 22:26:39

---
title: Move a Simple JavaScript Node.js AWS Lambda Function to Azure
published: true
description: This first article in a series about migrating from AWS Lambda to Azure Functions introduces a simple JavaScript function and its serverless Node.js implementation.
tags: javascript, aws, azure, serverless
canonical_url: https://medium.com/microsoftazure/moving-from-lambda-%C6%9B-to-azure-functions-b6d5ed5ca007
series: Moving from Lambda to Azure Functions
---
> This article is part of [#ServerlessSeptember](https://dev.to/azure/serverless-september-content-collection-2fhb). You'll find other helpful articles, detailed tutorials, and videos in this all-things-Serverless content collection. New articles are published every day — that's right, every day — from community members and cloud advocates in the month of September.

> Find out more about how Microsoft Azure enables your Serverless functions at [https://docs.microsoft.com/azure/azure-functions/](https://docs.microsoft.com/azure/azure-functions/?WT.mc_id=devto-blog-jeliknes).

“It’s time to migrate.”

Maybe the decision to switch cloud providers came “down from above.” Maybe the decision was yours. Perhaps your original solution was merely a spike to “kick the tires” of one cloud, and now it’s time to try another. Looking into a multi-cloud "hybrid" solution? Whatever your reasons, if you are considering moving your serverless code from AWS Lambda to [Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-overview?WT.mc_id=devto-blog-jeliknes), you’re in the right place to learn how!

![Lambda to Azure Functions](https://thepracticaldev.s3.amazonaws.com/i/mykhgxk0ronssehsq58t.jpg)

“[Moving from Lambda to Azure Functions](https://www.youtube.com/playlist?list=PL1VfiVM16kp8U5E7U2tfJdskXJg8DPPKL)” is a six-part videos series that covers what you need to know to make the transition between cloud providers. You’ll learn how to migrate your app, explore how resources in Azure relate to Amazon AWS, build a function locally, deploy it manually and learn how to push it automatically as part of a CI/CD pipeline.

# The Sample App

The sample app is simple but does more than just echo text or print, “Hello, world.” It computes whether or not a number is a prime and uses a cache to store the results to serve them quickly on subsequent calls. The AWS Lambda implementation uses JavaScript (Node.js) and Amazon DynamoDB.

![The sample function](https://thepracticaldev.s3.amazonaws.com/i/j5i3fd2dfoskgri6zzw9.jpg)

You can view the source code for the sample app and deploy the migrated code directly to Azure with a single-click in the “AWSMigration” GitHub repository.

{% github JeremyLikness/AWSMigration %}

The first video provides and overview of the sample application and shows how to test and access it from the portal and the command line.

{% youtube iflBlF9JEIY %}

In the next article, we'll explore how to create an Azure Function from scratch.

If you're familiar with AWS but new to Azure, check out this [AWS to Azure Services comparison](https://docs.microsoft.com/azure/architecture/aws-professional/services?WT.mc_id=devto-blog-jeliknes).