By load testing your application you can prevent performance problems when the application is in production. Azure provides a feature to set up a performance test, which is still in preview mode. This can be either a very basic load test by testing only one URL or a multi-step test. In this blog, I want to take my time to explain what the benefits are for load testing your application, how you can set up and run a load test and how you can use Application Insights to investigate the load test results. Take a moment to read one of my previous blogs about Application Insights if you're interested.

Why should I load test my application?

There are many benefits for load testing your application. While developing your application you might think that the performance is quite ok. Also, the test or acceptance environment could be promising. The customer is satisfied with the performance, so everything seems to be ready for the final production release. After deploying to production performance problem occurs. Seems impossible, but it's not. Even when the test or acceptance environment is very well tested by the customer you can't tell what will happen when your application is exposed to an enormous load. Problems might occur that you didn't expect. Load testing your application before going to production will prevent these problems or surprises. Some developers might think it's a time-consuming operation for setting up or running a load test. This is however not the case. Actually, it's quite easy to set up. Nowadays it's even possible to set up a simple performance test in Azure, will explain this later in this blog. I'll explain how you can set up a load test on your local machine in Visual Studio and how you can do something similar in Azure. Also, I'll explain how you can use Application Insights to investigate the performance test results. I've created a demo application that I will use for a load test.

Bookstore demo site

For this blog, I've created an example site which includes two important pages that we want to test. Firstly, visitors are able to search for books on the search page. By default, all books are displayed in the overview. On the left side of the screen, the visitor can select a genre to filter on the available books. The product detail page can be opened by clicking on a book in the overview. This page shows all detail information of the book, related books with the same genre and a button to pre-order the book. The pre-order page contains a simple form where visitors needs to enter their personal information.

You might have notice that this simple demo site is based on the MVC template which can be used when creating a web application in Visual Studio. All books are stored in an XML file. Data that's entered in the pre-order form is saved in an XML file on the filesystem. Application Insights is already installed on this site. Read my blog about tracking telemetry data to learn how you can enable and configure Application Insights. The site is deployed to Azure web apps.

Below an animation of the user flow.