Sven Bergendahl
Sven Bergendahl's Notebook

Follow

Sven Bergendahl's Notebook

Follow

Create a Sample Web App for Azure Load Testing

Sven Bergendahl's photo
Sven Bergendahl
·Jan 16, 2023·

Hey there, welcome to my tutorial on deploying a sample Node.js web app with an Azure Cosmos DB as the backend for my Azure Load Testing series. In this guide, I will show you how to quickly deploy a web app on Microsoft Azure and for using it to perform a load test. By following the step-by-step instructions, you will learn how to set up a web app on Azure. Let's get started!

Disclaimer: The original GitHub Repository & Installation Instructions from Microsoft & Nikita Nallamothucan can be found here https://github.com/Azure-Samples/nodejs-appsvc-cosmosdb-bottleneck I forked the GitHub Repository and removed the artificially created bottleneck at the Azure Cosmos DB

Step 1: Log into Azure via your CLI of choice and optionally select the subscription (Subscription ID or Subscription Name) in which the web app will be located.

az login
az account set --subscription "SubscriptionName"

Step 2: Clone the source code from my GitHub Repository to your local PC/Mac for the sample application, which is a Node.js application that includes an Azure App Service and an Azure Cosmos DB database. The repository also includes a PowerShell script for deploying the sample app to your Azure subscription.

git clone https://github.com/bergsv/nodejs-appsvc-cosmosdb-nobottleneck.git

Step 3: Use the provided PowerShell script to deploy the sample web app. When you're using a Mac (like in my case), you can install PowerShell via this Tutorial https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos?view=powershell-7.3 or just install via brew install powershell

cd nodejs-appsvc-cosmosdb-bottleneck
pwsh deploymentscript.ps1

While the script is running provide a subscription id, a unique web app name, and a location (the default region is eastus) for the application when it prompts you. A resource group with the resources within will be created.

Step 4: After the deployment is finished, you can access the sample application through your browser. The URL will be given to you after the script ran.

https://opsbakery-examplewebapp.azurewebsites.net

I hope this step-by-step tutorial has given you a simple understanding of how to create a sample web app. By following the instructions, you should now be able to set up your own web app, and we're ready to load test it using the Azure Load Test Service.

 
Share this