You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/load-testing/tutorial-cicd-azure-pipelines.md
+28-56Lines changed: 28 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ ms.topic: tutorial
13
13
14
14
# Tutorial: Identify performance regressions with Azure Load Testing Preview and Azure Pipelines
15
15
16
-
This tutorial describes how to automate performance regression testing by using Azure Load Testing Preview and Azure Pipelines. You'll configure an Azure Pipelines continuous integration and continuous delivery (CI/CD) workflow to run a load test for a sample web application. You'll then use the test results to identify performance regressions.
16
+
This tutorial describes how to automate performance regression testing by using Azure Load Testing Preview and Azure Pipelines. You'll configure an Azure Pipelines CI/CD workflow with the [Azure Load Testing task](/azure/devops/pipelines/tasks/test/azure-load-testing?view=azure-devops) to run a load test for a sample web application. You'll then use the test results to identify performance regressions.
17
17
18
18
If you're using GitHub Actions for your CI/CD workflows, see the corresponding [GitHub Actions tutorial](./tutorial-cicd-github-actions.md).
19
19
@@ -38,7 +38,7 @@ You'll learn how to:
38
38
* An Azure DevOps organization and project. If you don't have an Azure DevOps organization, you can [create one for free](/azure/devops/pipelines/get-started/pipelines-sign-up?view=azure-devops&preserve-view=true). If you need help with getting started with Azure Pipelines, see [Create your first pipeline](/azure/devops/pipelines/create-first-pipeline?preserve-view=true&view=azure-devops&tabs=java%2Ctfs-2018-2%2Cbrowser).
39
39
* A GitHub account, where you can create a repository. If you don't have one, you can [create one for free](https://github.com/).
40
40
41
-
## Set up your repository
41
+
## Set up the sample application repository
42
42
43
43
To get started, you need a GitHub repository with the sample web application. You'll use this repository to configure an Azure Pipelines workflow to run the load test.
44
44
@@ -105,11 +105,11 @@ To access Azure resources, create a service connection in Azure DevOps and use r
105
105
106
106
## Configure the Azure Pipelines workflow to run a load test
107
107
108
-
In this section, you'll set up an Azure Pipelines workflow that triggers the load test. The sample application repository contains a pipelines definition file. The pipeline first deploys the sample web application to Azure App Service, and then invokes the load test. The pipeline uses an environment variable to pass the URL of the web application to the Apache JMeter script.
108
+
In this section, you'll set up an Azure Pipelines workflow that triggers the load test.
109
109
110
-
First, you'll install the Azure Load Testing extension from the Azure DevOps Marketplace, create a new pipeline, and then connect it to the sample application's forked repository.
110
+
The sample application repository already contains a pipelines definition file. This pipeline first deploys the sample web application to Azure App Service, and then invokes the load test by using the [Azure Load Testing task](/azure/devops/pipelines/tasks/test/azure-load-testing?view=azure-devops). The pipeline uses an environment variable to pass the URL of the web application to the Apache JMeter script.
111
111
112
-
1. Install the Azure Load Testing task extension from the Azure DevOps Marketplace.
112
+
1. Install the **Azure Load Testing** task extension from the Azure DevOps Marketplace.
113
113
114
114
:::image type="content" source="./media/tutorial-cicd-azure-pipelines/browse-marketplace.png" alt-text="Screenshot that shows how to browse the Visual Studio Marketplace for extensions.":::
115
115
@@ -127,7 +127,25 @@ First, you'll install the Azure Load Testing extension from the Azure DevOps Mar
127
127
128
128
:::image type="content" source="./media/tutorial-cicd-azure-pipelines/create-pipeline-select-repo.png" alt-text="Screenshot that shows how to select the sample application's GitHub repository.":::
129
129
130
-
The repository contains an *azure-pipeline.yml* pipeline definition file. You'll now modify this definition to connect to your Azure Load Testing service.
130
+
The repository contains an *azure-pipeline.yml* pipeline definition file. The following snippet shows how to use the [Azure Load Testing task](/azure/devops/pipelines/tasks/test/azure-load-testing?view=azure-devops) in Azure Pipelines:
131
+
132
+
```yml
133
+
- task: AzureLoadTest@1
134
+
inputs:
135
+
azureSubscription: $(serviceConnection)
136
+
loadTestConfigFile: 'SampleApp.yaml'
137
+
resourceGroup: $(loadTestResourceGroup)
138
+
loadTestResource: $(loadTestResource)
139
+
env: |
140
+
[
141
+
{
142
+
"name": "webapp",
143
+
"value": "$(webAppName).azurewebsites.net"
144
+
}
145
+
]
146
+
```
147
+
148
+
You'll now modify the pipeline to connect to your Azure Load Testing service.
131
149
132
150
1. On the **Review** tab, replace the following placeholder text in the YAML code:
133
151
@@ -286,54 +304,6 @@ In this tutorial, you'll reconfigure the sample application to accept only secur
286
304
287
305
The Azure Load Testing task securely passes the secret from the pipeline to the test engine. The secret parameter is used only while you're running the load test, and then the value is discarded from memory.
288
306
289
-
## Configure and use the Azure Load Testing task
290
-
291
-
This section describes the Azure Load Testing task for Azure Pipelines. The task is cross-platform and runs on Windows, Linux, or Mac agents.
292
-
293
-
You can use the following parameters to configure the Azure Load Testing task:
294
-
295
-
|Parameter |Description |
296
-
|---------|---------|
297
-
|`azureSubscription` | *Required*. Name of the Azure Resource Manager service connection. |
298
-
|`loadTestConfigFile` | *Required*. Path to the YAML configuration file for the load test. The path is fully qualified or relative to the default working directory. |
299
-
|`resourceGroup` | *Required*. Name of the resource group that contains the Azure Load Testing resource. |
300
-
|`loadTestResource` | *Required*. Name of an existing Azure Load Testing resource. |
301
-
|`secrets` | Array of JSON objects that consist of the name and value for each secret. The name should match the secret name used in the Apache JMeter test script. |
302
-
|`env` | Array of JSON objects that consist of the name and value for each environment variable. The name should match the variable name used in the Apache JMeter test script. |
303
-
304
-
The following YAML code snippet describes how to use the task in an Azure Pipelines CI/CD workflow:
305
-
306
-
```yaml
307
-
- task: AzureLoadTest@1
308
-
inputs:
309
-
azureSubscription: '<Azure service connection>'
310
-
loadTestConfigFile: '< YAML File path>'
311
-
loadTestResource: '<name of the load test resource>'
312
-
resourceGroup: '<name of the resource group of your load test resource>'
@@ -342,5 +312,7 @@ The following YAML code snippet describes how to use the task in an Azure Pipeli
342
312
343
313
You've now created an Azure Pipelines CI/CD workflow that uses Azure Load Testing for automatically running load tests. By using pass/fail criteria, you can set the status of the CI/CD workflow. With parameters, you can make the running of load tests configurable.
344
314
345
-
* For more information about parameterizing load tests, see [Parameterize a load test](./how-to-parameterize-load-tests.md).
346
-
* For more information about defining test pass/fail criteria, see [Define test criteria](./how-to-define-test-criteria.md).
315
+
* Learn more about the [Azure Load Testing task](/azure/devops/pipelines/tasks/test/azure-load-testing?view=azure-devops).
316
+
* Learn more about [Parameterizing a load test](./how-to-parameterize-load-tests.md).
317
+
* Learn more [Define test pass/fail criteria](./how-to-define-test-criteria.md).
318
+
* Learn more about [Configuring server-side monitoring](./how-to-monitor-server-side-metrics.md).
0 commit comments