Overview
In this article, we'll delve into the process of creating an Azure Load Testing Service and generating load on an existing App Service—specifically, a Web App. Join me in exploring the steps required to set up and execute load tests effectively to validate the optimal performance and reliability of your web applications.
Whether you're a developer, a QA engineer, or an IT professional, this tutorial provides valuable insights and practical guidance to help you master the art of load testing in Azure.
Let’s get started.
Create Azure Load Test Service
Create an Azure Load Testing Service using the below steps
Basics Tab
- Name: Provide the name of the Azure Load Testing resource
- Location: Choose the Azure Data Center Region
Encryption Tab
- Encryption Type: MMK / CMK (Leave to Microsoft Managed Key – MMK).
All the Load Testing Service artifacts are encrypted using these Keys.
- Optionally provide Tags and Finally review all the inputs and create the Azure Load Testing Resource.
- Once the Azure Load Testing resource is created, we can start creating the Tests using the below options.
Azure Load Testing supports creating the below two types of tests
- Http-based Test: Http-based tests are based on Http Endpoints. You can create a Test with up to 5 endpoints as of now by passing the required HTTP verbs, Headers, Body, and other parameters that are required to invoke the HTTP endpoint.
- JMeter Script-based Test: If you already have JMeter scripts created/recorded for the Tests, you can upload them.JMX file (along with supporting files) to the Azure Load Testing Tests and can run the JMeter scripts within the Azure Load Testing resource.
Of course, you can also create a Test using Azure DevOps CI/CD Pipelines & Github Actions as well.
Azure Load Testing Pricing
Azure Load Testing resource pricing has two components
- Load Testing Resource: It costs a flat 10$ per month. The cost also includes 50 Virtual User Hours (VUH) each month (VUH explained in the below section)
- VUH: In addition to the fixed cost, depending on the consumed number of VUH, Azure charges 0.15$ for each additional VUH.
Virtual User Hours
In Azure Load Testing, VUH stands for Virtual User Hour. It's a unit of measurement used to quantify the load-testing resources consumed during a performance test. Essentially, one Virtual User Hour represents the use of one virtual user for one hour during the load test. Azure Load Testing allows users to simulate virtual users (VUs) to generate traffic and stress test web applications. The number of VUs and the duration of the test determine the total Virtual User Hours consumed. This metric helps users understand and manage the cost associated with load testing in Azure.
Below is an example of how the pricing works.
- Number of Users (VUs): 50 users
- Duration of Test: 10 minutes
Virtual User Hours (VUH) consumed = Number of Virtual Users * Duration
In this case, 50*10 = 500 minutes = 8.33 VUH approximately.
Azure charges 0.15$ per each VUH. In our case, it would cost 8.33*0.15 = $1.24 approximately.
So, for a test run for 50 Virtual Users for a duration of 10 minutes, it would cost less than 2 USD.
Create a Test
Let’s now, create a simple HTTP Test in the Azure Load Testing service as shown below.
Once you click on Create a URL-based test as shown in the above screenshot,
As shown in the above screen capture, we create a basic URL-based test (uncheck the Enable advanced settings) and the below details.
- Provide the name of the test
- Provide the URL of the Web endpoint
- Provide the number of Virtual Users the Total duration of the test and the Ramp-up time which defines the amount of time it takes to create the virtual users.
Once all the above inputs are provided, click on Review + Create to create the Test. After the test is created, the Test run will be kicked off, the Load-tested agents will be provisioned and the test run against the endpoints will be initiated below is how it looks after the Test run is completed.
Note. As we unchecked the Enable Advanced settings checked, all the other tabs except the Basics become optional.
After two minutes (the duration of the test), the Test run was executed and the Test results are shown in the above screenshot.
Summary
This article provides steps for creating an Azure Load Testing Service and creating a simple load test on existing App Services, specifically Web Apps.
Key steps covered in the article include,
- Creating an Azure Load Testing Service by specifying essential details such as name, location, and encryption settings.
- Exploring the two types of tests supported by Azure Load Testing: HTTP-based tests and JMeter Script-based tests.
- Understanding the pricing model for Azure Load Testing, including the fixed cost for the Load Testing Resource and the additional cost for Virtual User Hours (VUH).
- Explaining Virtual User Hours (VUH) as a unit of measurement for load testing resources consumed during performance tests, along with a detailed example of VUH calculation and associated pricing.
- Demonstrating the process of creating a simple HTTP-based test in the Azure Load Testing service, including specifying test parameters and reviewing test results.