AZ-401: Load Tests in Continuous Integration and Delivery
Turn an existing Azure Load Testing test into a controlled continuous integration and continuous delivery (CI/CD) signal by versioning its reviewed inputs, invoking it through an authorized workflow, waiting for completion and evaluating explicit failure criteria. Correlate the actual load run with the source revision and pipeline result before allowing the intended downstream work. A queued run, an exported report or a successful authentication step alone is insufficient.
This procedure uses an existing owner-approved nonproduction JMeter test and Azure Load Testing resource. It provides an Azure Pipelines task path and a bounded GitHub Actions alternative. Complete AZ-401: Tests Published Results and Enforced Quality Gates and AZ-401: Agents and Runners with Appropriate Trust and Connectivity first. The examples describe expected configuration and observations; no pipeline, load test, credential change or cloud operation was executed here.
Agree the permitted load before configuring automation
Identify the application owner and the person authorized to stop the exercise. Record the exact nonproduction target, permitted operations, request mix, concurrency, duration, engine instances, repetition limit and test window. Inspect the existing script and input data against that agreement. A familiar test name does not establish that its current target or workload is safe.
Preserve the selected test configuration, scripts, data and workflow baseline before editing. Use synthetic inputs and owner-approved test accounts. Exclude operations that could send real messages, charge customers or modify production records. Resolve ambiguous targets or shared dependencies before running anything.
Set a spending allowance and an operational stop procedure. Bound the script's workload and the number of automatic invocations as well as the duration of one run. Repeated commits or overlapping runs can multiply load and charges. Auto-stop helps with sustained errors; it does not impose a guaranteed monetary ceiling or identify every unsafe application effect.
For the initial validation, prefer an owner-controlled invocation and a supervised window. Enable the reviewed automatic event only after the controlled cases have been evaluated. This is a recommended rollout sequence, not a product requirement to use an existing pipeline.
Verify the resource, identity and execution prerequisites
Use the existing Azure Load Testing resource and test approved above, a repository for its inputs, and permission to create or modify the selected workflow. An existing pipeline is optional. Keep its identity, source checkout and execution host explicit.
For Azure Pipelines, verify an existing Azure Resource Manager service connection authorized for this pipeline and the resource-scoped Load Test Contributor role for its actual identity. Have the responsible administrator install the Azure Load Testing marketplace extension for the selected organization, or use the documented installation request. Avoid copying a blanket grant to every pipeline merely because a documentation example shows it.
AzureLoadTest@1 requires Azure PowerShell on its agent even though the task's requirements table lists no demands. Verify the selected host's installed tools, connectivity and capacity. A registered agent or a satisfied demand does not prove that this software or resource access works. The pipeline agent invokes the service; it is distinct from the test engines that generate the load.
For GitHub Actions, retain an already validated checkout and Azure authentication arrangement with the required resource access. Review the actual workflow and job token permissions and permitted events. Azure resource authorization and repository-token permissions are different controls. Do not create a credential or broaden access to make this example runnable.
Choose execution hosts for their real trust and connectivity boundaries. For self-hosted runners, confirm available matching labels/groups and adequate resources. Linux and Docker are additional requirements when using container actions or service containers, not a universal requirement for every load-testing arrangement. Keep untrusted changes away from privileged execution; automatic secret redaction is not guaranteed.
Export the selected test inputs into the workflow repository
In the Azure portal, open the approved Azure Load Testing resource, select Tests, then the intended test. On the selected run, open its ellipsis menu and choose Download input file. Extract the archive and inspect its configuration, JMeter script and required data or properties files before adding them to source control.
For this example, place the reviewed files under load-tests/ and retain the exported configuration as load-tests/config.yaml. Preserve its actual test identity and script references. Check relative paths after extraction; a configuration that names a missing script cannot produce the intended evidence. Confirm that neither the archive nor the proposed commit contains credentials, personal data or an unexpected target.
Use the repository consumed by the workflow. Record its exact revision together with the selected resource and test. If an older run supplied the export, compare it with the owner-approved current test before treating the archive as authoritative. Exporting inputs captures configuration; it does not prove that those inputs have passed a load run.
The portal quickstart also offers creation of an Azure pipeline for an existing test. The manual integration path used here makes the reviewed inputs and existing authorized connection explicit. Assess generated files and proposed replacements before accepting an automated setup; preserve unrelated definitions and shared connections.
Define performance failure and error-stop conditions separately
Edit the exported test configuration using YAML (YAML Ain’t Markup Language). Choose a supported client metric, aggregation, comparison and threshold from the criteria reference. Base the threshold on the owner's performance requirement and workload, not on a documentation number.
For illustration only, these settings fail a run when average response time exceeds 500 milliseconds or failed requests exceed 1 percent. The owner must approve or replace both numbers before execution. Merge the settings into the reviewed exported file; this fragment does not replace its test identity, script and workload configuration.
failureCriteria:
- avg(response_time_ms) > 500
- percentage(error) > 1
autoStop:
errorPercentage: 90
timeWindow: 60
The failure comparisons describe unacceptable outcomes: any true criterion makes the test fail. A passing average does not establish an acceptable tail response time. If the requirement concerns a percentile or a particular request, select a supported metric/aggregation and match the actual JMeter sampler name. Omitting the request name applies the criterion to aggregate requests. Keep sensitive data out of those names.
autoStop is a separate sustained-error protection. Its timeWindow is in seconds; the documented default watches for at least 90 percent errors over 60 seconds. Review the actual selected settings and do not disable this protection as a workaround for a failing target. A performance failure, an auto-stopped run and a successful run are different observations.
Azure Pipelines and GitHub Actions do not support configuring server-metric failure criteria through this integration. Do not add a server-resource criterion to this client configuration and assume it will enforce a gate. Return such a requirement to the responsible test owner for its separately supported setup.
Add the Azure Pipelines load task
In the selected Azure DevOps project, open Pipelines, choose the owned definition and Edit, or choose Create Pipeline when an authorized new definition is appropriate. Retain the reviewed event controls and make the exported files available in the selected checkout before the load task.
Insert the following task in the authorized agent job. Replace each owner-labelled value with the actual approved service connection and resource names; these are placeholders, not credentials or a runnable resource selection.
- task: AzureLoadTest@1
displayName: Run bounded performance validation
inputs:
azureSubscription: OWNER_APPROVED_CONNECTION
loadTestConfigFile: load-tests/config.yaml
resourceGroup: OWNER_SELECTED_RESOURCE_GROUP
loadTestResource: OWNER_SELECTED_LOAD_RESOURCE
waitForCompletion: true
outputVariableName: ALTOutputVar
The configuration path must resolve against the actual checkout/default working directory or be fully qualified. Confirm the service connection's identity and authorized pipeline use before saving. The task reference describes JMeter execution; do not infer that every available test engine has the same task contract.
Keep waitForCompletion: true for this blocking quality signal. The task succeeds only when execution finishes successfully and its test criteria pass. Its configured output variable, ALTOutputVar by default, carries the run identifier for correlation; the presence of an identifier is not a verdict. Retain failure propagation to the intended downstream work instead of masking the load step's result.
The load task is AzureLoadTest@1. PublishTestResults@2 is a separate test-result publisher and does not make the load task major version 2. Do not feed an arbitrary load-result file to that publisher with a guessed format. Preserve the existing format-aware testing and publication arrangement described in AZ-401: Tests Published Results and Enforced Quality Gates.
Save the reviewed definition and record its revision. For the supervised initial invocation, verify the selected source, resource and bounded configuration before authorizing the run. Once the controlled cases below meet the acceptance record, configure the intended limited source-change trigger. A manual invocation proves neither automatic triggering nor admission of the correct later revision.
Use the bounded GitHub Actions alternative
In the owned repository, edit the authorized workflow or create one through its existing review process. Place this documented load-testing step after the separately validated repository checkout and Azure authentication steps:
- name: Run bounded performance validation
uses: azure/load-testing@v1
with:
loadTestConfigFile: load-tests/config.yaml
loadTestResource: OWNER_SELECTED_LOAD_RESOURCE
resourceGroup: OWNER_SELECTED_RESOURCE_GROUP
Resolve the same reviewed resource names and input files. Verify that the selected action waits for the run and that its result controls the required dependent work. A configuration that proceeds without completion cannot provide the blocking signal defined at the start of this procedure.
Validate the actual checkout, login and reporting action references for the selected environment. The integration article's older auxiliary examples do not establish universal current helper versions. Keep authentication setup and token scope in their existing approved configuration; this bounded step supplies neither a new login recipe nor deployment authorization.
After owner review, verify the actual event and workflow revision as well as the load result. A successful Azure Pipelines run is not evidence that the GitHub workflow ran, and an Actions job that authenticated successfully is not evidence that the load step completed.
Accept results through run-bound evidence
Collect the workflow run, source revision, exported configuration, actual resource/test and load-run identifier together. Inspect execution status and each criterion in the CI/CD logs and corresponding Azure Load Testing result. Distinguish a genuine performance regression from an unavailable script, authentication failure, unsupported host or unreachable target.
Where the approved reporting step publishes results, inspect the actual output directory and any comma-separated values (CSV) artifact for the same run. The documented integration uses a loadTest result directory; verify its existence and contents rather than accepting an artifact caption. Retain logs and failure evidence when reporting fails. An optional artifact cannot replace successful completion and criteria evaluation.
Use controlled cases such as these during the authorized nonproduction exercise. They are expected observations, not results obtained here.
| Controlled case | Evidence required before interpreting it |
|---|---|
| Reviewed bounded run | Correct target, input revision, completed execution and actual status of every criterion |
| Owner-approved deliberately stricter criterion | A criterion fails under the same safe load and intended downstream work is blocked; a setup failure does not satisfy this case |
| Missing configuration file in an owned test change | The actual setup failure is visible and cannot be reported as a passing performance test |
| Sustained erroneous requests within the permitted fixture | Actual stop/status evidence is distinguished from a clean performance pass; do not create unsafe load merely to test stopping |
| Result artifact missing or publication fails | Execution/criteria evidence is preserved, the reporting gap is visible and the agreed completeness rule determines acceptance |
Agree the completeness rule before running: for example, require a correlated completed run and all required criterion outcomes, plus any reporting evidence the owner made mandatory. A skipped load step or a missing outcome is unresolved, even when another job is green. Quality evidence also remains separate from the resource owner's authority to deploy.
Restore owned changes and retain the decision record
Restore the temporary workflow edits, demonstration criterion changes and input-file changes through the reviewed path. Close or disable only the exercise's owned automatic invocation when it is no longer required, so repeated commits cannot keep generating unplanned load.
Keep the existing test, resource, service connections, runner registrations and unrelated workflows intact. Retire any separately authorized temporary asset only after its owner confirms its consumers and evidence-retention needs. Deleting a shared resource is not routine cleanup for this integration.
The handoff should identify what actually ran, which workload and thresholds it used, the observed cost/stop limitations, the exact result and any missing evidence. Preserve unsuccessful observations and the original baseline. Investigate later failures using AZ-401: Diagnosing Pipeline Failures Duration and Flaky Tests, rather than increasing load or permissions to obtain a green caption.
Authoritative Sources
- Manually configure CI/CD for Azure Load Testing — existing-test export, authorized workflow integration, extension, task/action and result paths.
- AzureLoadTest@1 task reference — exact inputs, JMeter scope, waiting, run identifier and Azure PowerShell requirement.
- Define fail criteria for load tests — supported client criteria, request matching, unsupported server-metric CI configuration and separate auto-stop behavior.
- Automate an existing load test with CI/CD — the portal pipeline-creation alternative and result inspection.
- Azure Pipelines agents — execution hosts, software and agent identity boundaries.
- Self-hosted runners reference — routing, available capacity, connectivity and conditional container requirements.
- Workflow syntax for GitHub Actions — workflow events, job dependencies and token permissions.
- PublishTestResults@2 task reference — separate format-aware publication and explicit failure controls.
- Secure use reference — untrusted execution, minimum permissions and limits of secret redaction.

