---
title: "Create a new test or update an existing test by providing the test Id."
method: PATCH
path: "/tests/{testId}"
tags: ["Test"]
---

# Create a new test or update an existing test by providing the test Id.

`PATCH /tests/{testId}`

Create a new test or update an existing test by providing the test Id.

## Path parameters

- `testId` string, required

## Query parameters

- `api-version` string, required

## Response `200`

The request has succeeded.

- Test — Load test model.
  - `passFailCriteria` PassFailCriteria — Pass fail criteria for a test.
    - `passFailMetrics` object — Map of id and pass fail metrics { id : pass fail metrics }.
  - `secrets` object — Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE.
  - `certificate` CertificateMetadata — Certificates metadata
    - `value` string — The value of the certificate for respective type
    - `type` 'AKV_CERT_URI' — Types of certificates supported.
    - `name` string — Name of the certificate.
  - `environmentVariables` object — Environment variables which are defined as a set of <name,value> pairs.
  - `loadTestConfiguration` LoadTestConfiguration — Configurations for the load test.
    - `engineInstances` integer — The number of engine instances to execute load test. Supported values are in range of 1-400. Required for creating a new test.
    - `splitAllCSVs` boolean — If false, Azure Load Testing copies and processes your input files unmodified across all test engine instances. If true, Azure Load Testing splits the CSV input data evenly across all engine instances. If you provide multiple CSV files, each file will be split evenly.
    - `quickStartTest` boolean — If true, optionalLoadTestConfig is required and JMX script for the load test is not required to upload.
    - `optionalLoadTestConfig` OptionalLoadTestConfiguration — Configuration for quick load test
      - `endpointUrl` string — Test URL. Provide the complete HTTP URL. For example, https://contoso-app.azurewebsites.net/login
      - `virtualUsers` integer — No of concurrent virtual users.
      - `rampUpTime` integer — Ramp up time in seconds.
      - `duration` integer — Test run duration in seconds.
  - `inputArtifacts` TestInputArtifacts — The input artifacts for the test.
    - `configFileInfo` TestFileInfo — Test file info.
      - `fileName` string, required — Name of the file.
      - `url` string, uri — File URL.
      - `fileType` 'JMX_FILE' | 'USER_PROPERTIES' | 'ADDITIONAL_ARTIFACTS' — Types of file supported.
      - `expireDateTime` string, date-time — Expiry time of the file (RFC 3339 literal format)
      - `validationStatus` 'NOT_VALIDATED' | 'VALIDATION_SUCCESS' | 'VALIDATION_FAILURE' | 'VALIDATION_INITIATED' | 'VALIDATION_NOT_REQUIRED' — File status.
      - `validationFailureDetails` string — Validation failure error details
    - `testScriptFileInfo` TestFileInfo — Test file info.
      - `fileName` string, required — Name of the file.
      - `url` string, uri — File URL.
      - `fileType` 'JMX_FILE' | 'USER_PROPERTIES' | 'ADDITIONAL_ARTIFACTS' — Types of file supported.
      - `expireDateTime` string, date-time — Expiry time of the file (RFC 3339 literal format)
      - `validationStatus` 'NOT_VALIDATED' | 'VALIDATION_SUCCESS' | 'VALIDATION_FAILURE' | 'VALIDATION_INITIATED' | 'VALIDATION_NOT_REQUIRED' — File status.
      - `validationFailureDetails` string — Validation failure error details
    - `userPropFileInfo` TestFileInfo — Test file info.
      - `fileName` string, required — Name of the file.
      - `url` string, uri — File URL.
      - `fileType` 'JMX_FILE' | 'USER_PROPERTIES' | 'ADDITIONAL_ARTIFACTS' — Types of file supported.
      - `expireDateTime` string, date-time — Expiry time of the file (RFC 3339 literal format)
      - `validationStatus` 'NOT_VALIDATED' | 'VALIDATION_SUCCESS' | 'VALIDATION_FAILURE' | 'VALIDATION_INITIATED' | 'VALIDATION_NOT_REQUIRED' — File status.
      - `validationFailureDetails` string — Validation failure error details
    - `inputArtifactsZipFileInfo` TestFileInfo — Test file info.
      - `fileName` string, required — Name of the file.
      - `url` string, uri — File URL.
      - `fileType` 'JMX_FILE' | 'USER_PROPERTIES' | 'ADDITIONAL_ARTIFACTS' — Types of file supported.
      - `expireDateTime` string, date-time — Expiry time of the file (RFC 3339 literal format)
      - `validationStatus` 'NOT_VALIDATED' | 'VALIDATION_SUCCESS' | 'VALIDATION_FAILURE' | 'VALIDATION_INITIATED' | 'VALIDATION_NOT_REQUIRED' — File status.
      - `validationFailureDetails` string — Validation failure error details
    - `additionalFileInfo` TestFileInfo[] — Additional supported files for the test run
      - `fileName` string, required — Name of the file.
      - `url` string, uri — File URL.
      - `fileType` 'JMX_FILE' | 'USER_PROPERTIES' | 'ADDITIONAL_ARTIFACTS' — Types of file supported.
      - `expireDateTime` string, date-time — Expiry time of the file (RFC 3339 literal format)
      - `validationStatus` 'NOT_VALIDATED' | 'VALIDATION_SUCCESS' | 'VALIDATION_FAILURE' | 'VALIDATION_INITIATED' | 'VALIDATION_NOT_REQUIRED' — File status.
      - `validationFailureDetails` string — Validation failure error details
  - `testId` string, required — Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, underscore or hyphen characters.
  - `description` string — The test description.
  - `displayName` string — Display name of a test.
  - `subnetId` string — Subnet ID on which the load test instances should run.
  - `keyvaultReferenceIdentityType` string — Type of the managed identity referencing the Key vault.
  - `keyvaultReferenceIdentityId` string — Resource Id of the managed identity referencing the Key vault.
  - `createdDateTime` string, date-time — The creation datetime(RFC 3339 literal format).
  - `createdBy` string — The user that created.
  - `lastModifiedDateTime` string, date-time — The last Modified datetime(RFC 3339 literal format).
  - `lastModifiedBy` string — The user that last modified.

## Other responses

- `201` — The request has succeeded and a new resource has been created as a result.
- `default` — An unexpected error response.

---

[API](https://skmtc.dev/azure/apis/loadtestservice-loadtesting.md) · [All operations](https://skmtc.dev/azure/apis/loadtestservice-loadtesting/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/loadtestservice-loadtesting/revisions/e991fe514f8b/schema)
