Loading...

Azure Tips and Tricks - How to test application performance with Azure Load Testing

Azure Tips and Tricks - How to test application performance with Azure Load Testing

How to test application performance with Azure Load Testing

 

Application performance testing

 

When you build an application, you want it to be fast. Users should perceive it as fast and performant, even when many users are using it. And your application should continue to work without errors when it is under load. It can be difficult to know how your application behaves when it is used by many concurrent users. Azure Load Testing can help by putting your application under load and analyzing how it performs.

In this post, we'll test the performance of an existing web application with Azure Load Testing.

 

Prerequisites

If you want to follow along, you'll need the following:

 

Test and analyze the performance of a web application

 

We'll start by creating an Azure Load Testing resource from the Azure portal.

  1. Go to the Azure portal
  2. Click the Create a resource button (the plus-sign in the top left corner)
  3. Search for Load Testing, select the "Azure Load Testing" result and click Create
    1. Select a Resource Group
    2. Fill in a Name
    3. Select a Location
    4. Click Review + create and then Create

Create an Azure load testing resourceCreate an Azure load testing resource

 

Before we can create a test, we need to create an Apache JMeter script. This is a scripts that tells Azure Load Testing what to test and how to do it. JMeter scripts have the .jmx extension and look like the code here:

 

 

 

<?xml version="1.0" encoding="UTF-8"?> <jmeterTestPlan version="1.2" properties="5.0" jmeter="5.4.1"> <hashTree> <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true"> <stringProp name="TestPlan.comments"></stringProp> <boolProp name="TestPlan.functional_mode">false</boolProp> <boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp> <boolProp name="TestPlan.serialize_threadgroups">false</boolProp> <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="TestPlan.user_define_classpath"></stringProp> </TestPlan> <hashTree> <kg.apc.jmeter.threads.UltimateThreadGroup guiclass="kg.apc.jmeter.threads.UltimateThreadGroupGui" testclass="kg.apc.jmeter.threads.UltimateThreadGroup" testname="jp@gc - Ultimate Thread Group" enabled="true"> <collectionProp name="ultimatethreadgroupdata"> <collectionProp name="1400604752"> <stringProp name="1567">5</stringProp> <stringProp name="0">0</stringProp> <stringProp name="48873">30</stringProp> <stringProp name="49710">60</stringProp> <stringProp name="10">10</stringProp> </collectionProp> </collectionProp> <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> <boolProp name="LoopController.continue_forever">false</boolProp> <intProp name="LoopController.loops">-1</intProp> </elementProp> <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> </kg.apc.jmeter.threads.UltimateThreadGroup> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="homepage" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain">your-endpoint-url</stringProp> <stringProp name="HTTPSampler.port"></stringProp> <stringProp name="HTTPSampler.protocol">https</stringProp> <stringProp name="HTTPSampler.contentEncoding"></stringProp> <stringProp name="HTTPSampler.path"></stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"></stringProp> <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">60000</stringProp> </HTTPSamplerProxy> <hashTree/> </hashTree> </hashTree> </hashTree> </jmeterTestPlan>

 

 

 

This JMeter script simulates a load test of five virtual users simultaneously accessing a web endpoint. It takes less than two minutes to complete. All you need to do to make this script work for you is to replace the string your-endpoint-url with the endpoint of the web application that you want to test, like microsoft.github.io/AzureTipsAndTricks.

 

Now that we have an Apache JMeter script, we can create a test in the Azure Load Testing resource.

 

  1. Navigate to the Azure Load Testing resource in the Azure portal
  2. Select the Tests menu
  3. Click on Create new test
  4. In the Basics tab, enter a Test name
  5. Click Next: Test plan
  6. Select the JMeter script that you created and click Upload
  7. Click Next: Parameters

Upload an Apache JMeter scriptUpload an Apache JMeter script

 

  1. You can enter environment variables and secrets that can be used by the JMeter script. Let's leave this blank and click Next: Load
  2. We only need one test engine instance to run the test. You can scale this up to increase the threads that will be executed. Click Next: Test criteria
  3. Here we can create failure criteria that state when the test fails. Let's create one
    1. For Metric, select Error
    2. The Aggregate function should be Percentage
    3. Select Greater than for Condition
    4. Enter 50 for Threshold. This tells the test that it fails if more than 50 percent of requests fail
    5. Click Next: Monitoring
  4. Here, we can indicate Azure services to be monitored during the test. The application that we are testing runs in an Azure App Service Web App, so let's select that
  5. Click Next: Review + create and then Create to create the test. It will run automatically when it is created

When the test is done, it will show the results in the overview. This includes the load, response time, error percentage and throughput. You can see more details for the Azure services that were monitored by clicking on Additional insights.

 

The results of the load testThe results of the load test

Conclusion

Azure Load Testing helps you to test the responsiveness and resilience of your application when it is under load. You can integrate it into your DevOps pipeline to identify performance regressions, and you can monitor and analyze the Azure services that are under load. 

 

Create a trial account today and go and check it out!

Published on:

Learn more
Azure Developer Community Blog articles
Azure Developer Community Blog articles

Azure Developer Community Blog articles

Share post:

Related posts

Microsoft Entra ID Governance: Azure subscription required to continue using guest governance features

Starting January 30, 2026, Microsoft Entra ID Governance requires tenants to link an Azure subscription to use guest governance features. With...

23 hours ago

Azure Developer CLI (azd) – January 2026: Configuration & Performance

This post announces the January 2026 release of the Azure Developer CLI (`azd`). The post Azure Developer CLI (azd) – January 2026: Conf...

2 days ago

Azure SDK Release (January 2026)

Azure SDK releases every month. In this post, you'll find this month's highlights and release notes. The post Azure SDK Release (January 2026)...

2 days ago

Azure Cosmos DB TV Recap – From Burger to Bots – Agentic Apps with Cosmos DB and LangChain.js | Ep. 111

In Episode 111 of Azure Cosmos DB TV, host Mark Brown is joined by Yohan Lasorsa to explore how developers can build agent-powered application...

2 days ago

Accelerate Your Cosmos DB Infrastructure with GitHub Copilot CLI and Azure Cosmos DB Agent Kit

Modern infrastructure work is increasingly agent driven, but only if your AI actually understands the platform you’re deploying. This guide sh...

3 days ago

Accelerate Your Cosmos DB Infrastructure with GitHub Copilot CLI and Azure Cosmos DB Agent Kit

Modern infrastructure work is increasingly agent driven, but only if your AI actually understands the platform you’re deploying. This guide sh...

3 days ago

SharePoint: Migrate the Maps web part to Azure Maps

The SharePoint Maps web part will migrate from Bing Maps to Azure Maps starting March 2026, completing by mid-April. Key changes include renam...

4 days ago

Azure Cosmos DB TV Recap: Supercharging AI Agents with the Azure Cosmos DB MCP Toolkit (Ep. 110)

In Episode 110 of Azure Cosmos DB TV, host Mark Brown is joined by Sajeetharan Sinnathurai to explore how the Azure Cosmos DB MCP Toolkit is c...

8 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy