Quickstart: Create and run a load test with Azure Load Testing Preview

This quickstart describes how to load test a web application with Azure Load Testing Preview from the Azure portal without prior knowledge about load testing tools. You'll first create an Azure Load Testing resource, and then create a load test by using the web application URL.

After you complete this quickstart, you'll have a resource and load test that you can use for other tutorials.

Learn more about the key concepts for Azure Load Testing.

Important

Azure Load Testing is currently in preview. For legal terms that apply to Azure features that are in beta, in preview, or otherwise not yet released into general availability, see the Supplemental Terms of Use for Microsoft Azure Previews.

Prerequisites

Create an Azure Load Testing resource

First, you'll create the top-level resource for Azure Load Testing. It provides a centralized place to view and manage test plans, test results, and related artifacts.

If you already have a Load Testing resource, skip this section and continue to Create a load test.

To create a Load Testing resource:

  1. Sign in to the Azure portal by using the credentials for your Azure subscription.

  2. Select the menu button in the upper-left corner of the portal, and then select + Create a resource.

    Screenshot that shows the button for creating a resource.

  3. Use the search bar to find Azure Load Testing.

  4. Select Azure Load Testing.

  5. On the Azure Load Testing pane, select Create.

    Screenshot that shows the Azure Load Testing pane.

  6. Provide the following information to configure your new Azure Load Testing resource:

    Field Description
    Subscription Select the Azure subscription that you want to use for this Azure Load Testing resource.
    Resource group Select an existing resource group. Or select Create new, and then enter a unique name for the new resource group.
    Name Enter a unique name to identify your Azure Load Testing resource.
    The name can't contain special characters, such as \/""[]:|<>+=;,?*@&, or whitespace. The name can't begin with an underscore (_), and it can't end with a period (.) or a dash (-). The length must be 1 to 64 characters.
    Location Select a geographic location to host your Azure Load Testing resource.
    This location also determines where the test engines are hosted and where the JMeter client requests originate from.

    Note

    Optionally, you can configure more details on the Tags tab. Tags are name/value pairs that enable you to categorize resources and view consolidated billing by applying the same tag to multiple resources and resource groups.

  7. After you're finished configuring the resource, select Review + Create.

  8. Review all the configuration settings and select Create to start the deployment of the Azure Load Testing resource.

    When the process has finished, a deployment success message appears.

  9. To view the new resource, select Go to resource.

    Screenshot that shows the deployment completion screen.

  10. Optionally, manage access to your Azure Load Testing resource.

    Azure Load Testing uses role-based access control (RBAC) to manage permissions for your resource. If you encounter this message, your account doesn't have the necessary permissions to manage tests.

    Screenshot that shows an error message in the Azure portal that you're not authorized to use the Azure Load Testing resource.

Create a load test

Azure Load Testing enables you to quickly create a load test from the Azure portal. You'll specify the web application URL and the basic load testing parameters. Azure Load Testing abstracts the complexity of creating the load test script and provisioning the compute infrastructure.

  1. Go to the Overview page of your Azure Load Testing resource.

  2. On the Get started tab, select Quick test.

    Screenshot that shows the quick test button on the resource overview page.

  3. On the Quickstart test page, enter the Test URL.

    Enter the complete URL that you would like to run the test for. For example, https://www.example.com/login.

  4. (Optional) Update the Number of virtual users to the total number of virtual users.

    The maximum allowed value is 11250. If the number of virtual users exceeds the maximum of 250 per test engine instance, Azure Load Testing provisions multiple test engines and distributes the load evenly. For example, 300 virtual users will result in 2 test engines with 150 virtual users each.

  5. (Optional) Update the Test duration and Ramp up time for the test.

  6. Select Run test to create and start the load test.

    Screenshot that shows quickstart test page.

Note

Azure Load Testing auto-generates an Apache JMeter script for your load test. You can download the JMeter script from the test run dashboard. Select Download, and then select Input file. To run the script locally, you have to provide environment variables to configure the URL and test parameters.

View the test results

Once the load test starts, you will be redirected to the test run dashboard. While the load test is running, Azure Load Testing captures both client-side metrics and server-side metrics. In this section, you'll use the dashboard to monitor the client-side metrics.

  1. On the test run dashboard, you can see the streaming client-side metrics while the test is running. By default, the data refreshes every five seconds.

    Screenshot that shows results of the load test.

  2. Optionally, change the display filters to view a specific time range, result percentile, or error type.

    Screenshot that shows the filter criteria for the results of a load test.

Modify load test parameters

You can modify the load test configuration at any time. For example, define test failure criteria or monitor server-side metrics for Azure-hosted applications.

  1. In the Azure portal, go to your Azure Load Testing resource.

  2. On the left pane, select Tests to view the list of load tests, and then select your test.

  3. Select Edit to modify the load test configuration.

The generated load test uses environment variables to specify the initial configuration:

  • domain: Domain name of the web server (for example, www.example.com). Don't include the http:// prefix.

  • protocol: HTTP or HTTPS

  • path: The path to the resource (for example, /servlets/myServlet).

  • threads_per_engine: The number of virtual users per engine instance. It is recommended to set this to maximum 250. If you need more virtual users, increase the number of test engines for the test. For more information, see how to configure for high scale.

  • duration_in_sec: Test duration in seconds

  • ramp_up_time: Ramp up time in seconds for the test to reach the total number of virtual users.

Clean up resources

Important

You can reuse the Azure Load Testing resource that you created for other Azure Load Testing tutorials and how-to articles.

If you don't plan to use any of the resources that you created, delete them so you don't incur any further charges. If you've deployed the sample application in a different resource group, you might want to repeat the following steps.

To delete resources by using the Azure portal:

  1. Select the menu button in the upper-left corner, and then select Resource groups.

  2. From the list, select the resource group that you created.

  3. Select Delete resource group. Screenshot of the selections to delete a resource group in the Azure portal.

  4. Enter the resource group name. Then select Delete.

To delete resources by using the Azure CLI, enter the following command:

az group delete --name <yourresourcegroup>

Remember, deleting the resource group deletes all of the resources within it.

Next steps

You now have an Azure Load Testing resource, which you used to load test an external website.

You can reuse this resource to learn how to identify performance bottlenecks in an Azure-hosted application by using server-side metrics.