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/how-to-configure-load-test-cicd.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,13 @@ ms.date: 06/05/2023
11
11
12
12
# Manually configure CI/CD for load tests in GitHub Actions or Azure Pipelines
13
13
14
-
Get started with automating load tests in Azure Load Testing by adding it to a CI/CD pipeline. After running a load test in the Azure portal, you export the configuration files, and configure a CI/CD pipeline in GitHub Actions or Azure Pipelines.
14
+
You can automate a load test in Azure Load Testing by creating a CI/CD pipeline. In this article, you learn how to manually configure GitHub Actions or Azure Pipelines to invoke an existing test in Azure Load Testing. Automate a load test to continuously validate your application performance and stability under load.
15
15
16
-
After you complete this quickstart, you have a CI/CD workflow that is configured to run a load test with Azure Load Testing.
16
+
To add an existing load test to a CI/CD pipeline:
17
+
18
+
- Configure service authentication to allow GitHub Actions or Azure Pipelines to connect to your Azure load testing resource.
19
+
- Export the load test configuration files, such as the JMeter file and load test YAML configuration.
20
+
- Update the CI/CD pipeline definition to invoke Azure Load Testing.
17
21
18
22
## Prerequisites
19
23
@@ -346,6 +350,6 @@ If you don't plan to use any of the resources that you created, delete them so y
346
350
347
351
Advance to the next article to learn how to identify performance regressions by defining test fail criteria and comparing test runs.
title: 'Quickstart: Configure a CI/CD pipeline for a load test from Azure portal'
2
+
title: 'Quickstart: Automate load tests with CI/CD'
3
3
titleSuffix: Azure Load Testing
4
-
description: 'Learn how to configure a CI/CD pipeline for an existing load test in Azure Load Testing from Azure portal'
4
+
description: 'Learn how to automate an existing load test by adding it to Azure Pipelines directly from the Azure portal. Run load tests in your CI/CD pipeline to automate performance regression testing.'
5
5
services: load-testing
6
6
ms.service: load-testing
7
7
ms.topic: quickstart
@@ -11,54 +11,109 @@ ms.date: 08/05/2023
11
11
adobe-target: true
12
12
---
13
13
14
-
# Quickstart: Configure a CI/CD pipeline for an existing load test in Azure Load Testing
14
+
# Quickstart: Automate an existing load test with CI/CD
15
15
16
-
Get started with automating load tests in Azure Load Testing by adding it to a CI/CD pipeline from Azure portal. After running a load test in the Azure portal, you can configure your Azure DevOps settings to create a pipeline to run the test.
16
+
In this article, you learn how to automate an existing load test by creating a CI/CD pipeline in Azure Pipelines. Select your test in Azure Load Testing, and directly configure a pipeline in Azure DevOps that triggers your load test with every source code commit. Automate load tests with CI/CD to continuously validate your application performance and stability under load.
17
+
18
+
If you want to automate your load test with GitHub Actions, learn how to [manually configure a CI/CD pipeline for Azure Load Testing](./how-to-configure-load-test-cicd.md).
17
19
18
20
## Prerequisites
19
21
20
22
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
21
23
22
-
-An Azure Load Testing test. Create a [URL-based load test](./quickstart-create-and-run-load-test.md) or [use an existing JMeter script](./how-to-create-and-run-load-test-with-jmeter-script.md) to create a load test.
24
+
-Your Azure account needs to have the [Application Administrator](/azure/active-directory/roles/permissions-reference#application-administrator) role. See [Check access for a user to Azure resources](/azure/role-based-access-control/check-access) to verify your permissions.
23
25
24
26
- 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).
25
27
28
+
- Your Azure DevOps organization is connected to Azure Active Directory in your subscription. Learn how you can [connect your organization to Azure Active Directory](/azure/devops/organizations/accounts/connect-organization-to-azure-ad).
29
+
30
+
- A load testing resource, which contains a test. Create a [URL-based load test](./quickstart-create-and-run-load-test.md) or [use an existing JMeter script](./how-to-create-and-run-load-test-with-jmeter-script.md) to create a load test.
31
+
26
32
## Configure a CI/CD pipeline
27
33
28
34
In this section, you'll create a CI/CD pipeline in Azure Pipelines to run an existing load test. The test files like JMeter script and [test configuration YAML](/azure/load-testing/reference-test-config-yaml) will be committed to your repository.
29
35
30
36
1. In the [Azure portal](https://portal.azure.com/), go to your Azure load testing resource.
31
37
32
-
1. On the left pane, select **Tests** to view a list of tests.
38
+
1. On the left pane, select **Tests** to view the list of tests.
39
+
40
+
1. Select a test from the list by selecting the checkbox, and then select **Set up CI/CD**.
41
+
42
+
:::image type="content" source="media/how-to-set-up-cicd-pipeline-from-portal/list-of-tests.png" alt-text="Screenshot that shows the list of tests in Azure portal." lightbox="media/how-to-set-up-cicd-pipeline-from-portal/list-of-tests.png":::
43
+
44
+
1. Enter the following details for creating a CI/CD pipeline definition:
45
+
46
+
|Setting|Value|
47
+
|-|-|
48
+
|**Organization**| Select the Azure DevOps organization where you want to run the pipeline from. |
49
+
|**Project**| Select the project from the organization selected above. |
50
+
|**Repository**| Select the source code repository to store and run the Azure pipeline from. |
51
+
|**Branch**| Select the branch in the selected repository. |
52
+
|**Repository branch folder**| (Optional) Enter the repository branch folder name in which you'd like to commit. If empty, the root folder is used. |
53
+
|**Override existing files**| Check this setting. |
54
+
|**Service connection**| Select *Create new* to create a new service connection to allow Azure Pipelines to connect to the load testing resource.<br/><br/>If you already have a service connection with the *Load Test Contributor* role on the resource, choose *Select existing* and select the service connection from the dropdown list. |
55
+
56
+
:::image type="content" source="media/how-to-set-up-cicd-pipeline-from-portal/set-up-cicd-pipeline.png" alt-text="Screenshot that shows the settings to be configured to set up a CI/CD pipeline." lightbox="media/how-to-set-up-cicd-pipeline-from-portal/set-up-cicd-pipeline.png":::
57
+
58
+
> [!IMPORTANT]
59
+
> If you're getting an error creating a PAT token, or you don't see any repositories, make sure to [connect your Azure DevOps organization to Azure Active Directory (Azure AD)](/azure/devops/organizations/accounts/connect-organization-to-azure-ad). Make sure the directory in Azure DevOps matches the directory you're using for Azure Load Testing. After connecting to Azure AD, close and reopen your browser window.
60
+
61
+
1. Select **Create Pipeline** to start creating the pipeline definition.
62
+
63
+
Azure Load Testing performs the following steps to configure the CI/CD pipeline:
64
+
65
+
- Create a new service connection of type [Azure Resource Manager](/azure/devops/pipelines/library/service-endpoints#azure-resource-manager-service-connection) in the Azure DevOps project. The service principal is automatically assigned the *Load Test Contributor* role on the Azure load testing resource.
66
+
67
+
- Commit the JMeter script and test configuration YAML to the source code repository.
68
+
69
+
- Create a pipeline definition that invokes the Azure load testing resource and runs the load test.
70
+
71
+
1. When the pipeline creation finishes, you receive a notification in the Azure portal with a link to the pipeline.
72
+
73
+
1. Optionally, you can open the pipeline definition and modify the pipeline steps or change when the pipeline is triggered.
74
+
75
+
You now have a CI/CD pipeline in Azure Pipelines that invokes your load test when the pipeline is triggered. By default, the pipeline is triggered whenever you push an update to the selected branch.
76
+
77
+
:::image type="content" source="media/how-to-set-up-cicd-pipeline-from-portal/load-testing-generated-pipeline.png" alt-text="Screenshot that shows the Azure pipeline in Azure DevOps that was generated by Azure Load Testing." lightbox="media/how-to-set-up-cicd-pipeline-from-portal/load-testing-generated-pipeline.png":::
78
+
79
+
## Grant permission to service connection
80
+
81
+
When you run the CI/CD pipeline for the first time, you need to grant permission to the pipeline to access the service connection and start the load test.
82
+
83
+
1. Sign in to your Azure DevOps organization (`https://dev.azure.com/<your-organization>`), and select your project.
84
+
85
+
Replace the `<your-organization>` text placeholder with your project identifier.
86
+
87
+
1. Select **Pipelines** in the left navigation, and then select your pipeline.
33
88
34
-
1. Select your test from the list by selecting the checkbox, and then select **Set up CI/CD**.
89
+
Notice that the pipeline run status is *Pending*.
35
90
36
-
:::image type="content" source="media/how-to-set-up-cicd-pipeline-from-portal/list-of-tests.png" alt-text="Screenshot that shows the list of tests in Azure portal.":::
91
+
1. Select the pending pipeline run, and then select **View**.
37
92
38
-
1. Enter the details for configuring the pipeline. Select the Azure DevOps organization where you want to run the pipeline from.
93
+
An alert message is shown that the pipeline needs permission to access the load test resource.
39
94
40
-
1. Select the project from the organization selected above.
95
+
:::image type="content" source="media/how-to-set-up-cicd-pipeline-from-portal/azure-pipelines-need-permission.png" alt-text="Screenshot that shows the alert message that the Azure pipeline run needs permission to access a resource." lightbox="media/how-to-set-up-cicd-pipeline-from-portal/azure-pipelines-need-permission.png":::
41
96
42
-
1. Select a repository from the project selected above.
97
+
1. Select **Permit**, and then select **Permit** again in the confirmation window.
43
98
44
-
1. Select a branch fromthe repository selected above.
99
+
:::image type="content" source="media/how-to-set-up-cicd-pipeline-from-portal/azure-pipelines-grant-permission-service-connection.png" alt-text="Screenshot that shows the grant permission window in Azure Pipelines to grant access to the service connection for running a load test." lightbox="media/how-to-set-up-cicd-pipeline-from-portal/azure-pipelines-grant-permission-service-connection.png":::
45
100
46
-
1. Enter the repository branch folder name in which you'd like to commit. If not provided files will be committed to the root folder.
101
+
The CI/CD pipeline run now starts and accesses the Azure load testing resource to run the test.
47
102
48
-
1. Select Override existing file to edit existing files with the same name in the folder.
49
-
50
-
1. Select Create new, if you'd like to create a new service connection. A service connection of type [Azure Resource Manager](/azure/devops/pipelines/library/service-endpoints#azure-resource-manager-service-connection) with automatic Service Principal will be created in the project. The Service Principal will be automatically assigned *Load Test Contributor* role on the resource.
103
+
## View load test results in CI/CD
51
104
52
-
1. If you already have a service connection with *Load Test Contributor* role on the resource, select existing service connection from the dropdown.
105
+
You can view the load test summary results directly in the CI/CD output log.
53
106
54
-
:::image type="content" source="media/how-to-set-up-cicd-pipeline-from-portal/set-up-cicd-pipeline.png" alt-text="Screenshot that shows the settings to be configured to set up a CI/CD pipeline.":::
107
+
:::image type="content" source="./media/how-to-set-up-cicd-pipeline-from-portal/azure-pipelines-log-load-testing-summary.png" alt-text="Screenshot that shows the Azure Pipelines output log information, highlighting the load testing results." lightbox="./media/how-to-set-up-cicd-pipeline-from-portal/azure-pipelines-log-load-testing-summary.png":::
55
108
56
-
1. Click on Create Pipeline.
109
+
The generated CI/CD pipeline publishes the load test results as a pipeline artifact. You can download these results as a CSV file for further reporting.
57
110
58
-
The JMeter script and test configuration YAML will be committed to the repository. A pipeline will be automatically created and will be triggered whenever you push an update to the branch selected. You will get a notification with the link to th pipeline. You can click and modify the pipeline if needed.
111
+
:::image type="content" source="./media/how-to-set-up-cicd-pipeline-from-portal/azure-pipelines-artifacts-load-testing-results.png" alt-text="Screenshot that shows the artifacts page for pipeline run in Azure Pipelines, highlighting the load test results zip file." lightbox="./media/how-to-set-up-cicd-pipeline-from-portal/azure-pipelines-artifacts-load-testing-results.png":::
59
112
60
113
## Next steps
61
114
62
-
You've configured a CI/CD pipeline for an existing load test. You can view the load test results in the output logs after the test run.
115
+
You've configured a CI/CD pipeline in Azure Pipelines for an existing load test.
63
116
64
-
- Learn how to [view load test results in CI/CD pipeline](/azure/load-testing/how-to-configure-load-test-cicd#view-load-test-results).
117
+
-[Define test fail criteria](./how-to-define-test-criteria.md)
118
+
-[View performance trends over time](./how-to-compare-multiple-test-runs.md)
119
+
-[Manually configure a CI/CD pipeline for Azure Load Testing](./how-to-configure-load-test-cicd.md), if you want to add a load test to GitHub Actions or use an existing pipeline
0 commit comments