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
+29-15Lines changed: 29 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -192,18 +192,22 @@ To grant access to your Azure Load Testing resource, assign the Load Test Contri
192
192
```
193
193
---
194
194
195
-
## Configure the Azure Pipelines workflow to run a load test
195
+
## Configure the CI/CD workflow to run a load test
196
196
197
-
In this section, you'll set up an Azure Pipelines workflow that triggers the load test. The sample application repository already contains a pipelines definition file *azure-pipeline.yml*.
197
+
You'll now create a CI/CD workflow to create and run a load test for the sample application. The sample application repository already contains a CI/CD workflow definition that first deploys the application to Azure, and then creates a load test based on JMeter test script (*SampleApp.jmx*). You'll update the sample workflow definition file to specify the Azure subscription and application details.
198
198
199
-
The Azure Pipelines workflow performs the following steps for every update to the main branch:
199
+
On the first CI/CD workflow run, it creates a new Azure Load Testing resource in your Azure subscription by using the *ARMTemplate/template.json* Azure Resource Manager (ARM) template. Learn more about ARM templates [here](/azure-resource-manager/templates/overview).
200
200
201
-
- Deploy the sample Node.js application to an Azure App Service web app.
202
-
- Create an Azure Load Testing resource using the *ARMTemplate/template.json* Azure Resource Manager (ARM) template, if the resource doesn't exist yet. Learn more about ARM templates [here](../azure-resource-manager/templates/overview.md).
203
-
- Trigger Azure Load Testing to create and run the load test, based on the Apache JMeter script and the test configuration YAML file in the repository.
204
-
- Invoke Azure Load Testing by using the [Azure Load Testing task](/azure/devops/pipelines/tasks/test/azure-load-testing) and the sample Apache JMeter script *SampleApp.jmx* and the load test configuration file *SampleApp.yaml*.
201
+
# [Azure Pipelines](#tab/pipelines)
202
+
203
+
You'll create a new Azure pipeline that is linked to your fork of the sample application repository. This repository contains the following items:
205
204
206
-
Follow these steps to configure the Azure Pipelines workflow for your environment:
205
+
- The sample application source code.
206
+
- The *azure-pipelines.yml* pipeline definition file.
207
+
- The *SampleApp.jmx* JMeter test script.
208
+
- The *SampleApp.yaml* Azure Load Testing configuration file.
209
+
210
+
To create and run the load test, the Azure Pipelines definition uses the [Azure Load Testing task](/azure/devops/pipelines/tasks/test/azure-load-testing) extension from the Azure DevOps Marketplace.
207
211
208
212
1. Install the **Azure Load Testing** task extension from the Azure DevOps Marketplace.
209
213
@@ -223,7 +227,13 @@ Follow these steps to configure the Azure Pipelines workflow for your environmen
223
227
224
228
:::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.":::
225
229
226
-
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) in Azure Pipelines:
230
+
Azure Pipelines automatically detects the *azure-pipelines.yml* pipeline definition file.
231
+
232
+
1. Notice that the pipeline definition contains the `LoadTest` stage, which has two tasks.
233
+
234
+
The first task deploys a new Azure load testing resource using the `AzureResourceManagerTemplateDeployment` task.
235
+
236
+
Next, the `AzureLoadTest` [Azure Load Testing task](/azure/devops/pipelines/tasks/test/azure-load-testing) creates and starts a load test. This task uses the `SampleApp.yaml` [load test configuration file](./reference-test-config-yaml.md), which contains the configuration parameters for the load test, such as the number of parallel test engines.
227
237
228
238
```yml
229
239
- task: AzureLoadTest@1
@@ -241,10 +251,10 @@ Follow these steps to configure the Azure Pipelines workflow for your environmen
241
251
]
242
252
```
243
253
244
-
You'll now modify the pipeline to connect to your Azure Load Testing service.
245
-
246
254
1. On the **Review** tab, replace the following placeholder text in the YAML code:
247
255
256
+
These variables are used to configure the deployment of the sample application, and to create the load test.
257
+
248
258
|Placeholder |Value |
249
259
|---------|---------|
250
260
|`<Name of your webapp>` | The name of the Azure App Service web app. |
@@ -255,16 +265,20 @@ Follow these steps to configure the Azure Pipelines workflow for your environmen
255
265
256
266
:::image type="content" source="./media/tutorial-cicd-azure-pipelines/create-pipeline-review.png" alt-text="Screenshot that shows the Azure Pipelines Review tab when you're creating a pipeline.":::
257
267
258
-
These variables are used to configure the Azure Pipelines tasks for deploying the sample application to Azure, and to connect to your Azure Load Testing resource.
259
-
260
268
1. Select **Save and run**, enter text for **Commit message**, and then select **Save and run**.
261
269
262
-
:::image type="content" source="./media/tutorial-cicd-azure-pipelines/create-pipeline-save.png" alt-text="Screenshot that shows selections for saving and running a new Azure pipeline.":::
270
+
Azure Pipelines now runs the CI/CD workflow and will deploy the sample application and create the load test.
263
271
264
-
Azure Pipelines now runs the CI/CD workflow. You can monitor the status and logs by selecting the pipeline job.
272
+
1. Select **Pipelines** in the left navigation, and then select new pipeline run from the list to monitor the status.
273
+
274
+
You can view the detailed run log by by selecting the pipeline job.
265
275
266
276
:::image type="content" source="./media/tutorial-cicd-azure-pipelines/create-pipeline-status.png" alt-text="Screenshot that shows how to view pipeline job details.":::
267
277
278
+
# [GitHub Actions](#tab/github)
279
+
280
+
---
281
+
268
282
## View load test results
269
283
270
284
To view the results of the load test in the pipeline log:
0 commit comments