Load Test Administration - Upload Test File

Upload input file for a given test Id. File size can't be more than 50 MB. Existing file with same name for the given test will be overwritten. File should be provided in the request body as application/octet-stream.

PUT https://{endpoint}/tests/{testId}/files/{fileName}?api-version=2022-11-01
PUT https://{endpoint}/tests/{testId}/files/{fileName}?api-version=2022-11-01&fileType={fileType}

URI Parameters

Name In Required Type Description
endpoint
path True

string

fileName
path True

string

Unique name for test file with file extension like : App.jmx

testId
path True

string

Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or hyphen characters.

Regex pattern: ^[a-z0-9_-]*$

api-version
query True

string

The API version to use for this operation.

fileType
query

FileType

File type

Request Body

Media Types: "application/octet-stream"

Name Type Description
body

string

The file content as application/octet-stream.

Responses

Name Type Description
201 Created

TestFileInfo

The request has succeeded and a new resource has been created as a result.

Other Status Codes

Azure.Core.Foundations.ErrorResponse

An unexpected error response.

Headers

x-ms-error-code: string

Security

Oauth2

OAuth 2.0 Flow with Microsoft Entra ID.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize

Scopes

Name Description
https://cnt-prod.loadtesting.azure.com/.default

Examples

Upload input file for a given test name.

Sample Request

PUT https://{endpoint}/tests/12345678-1234-1234-1234-123456789012/files/sample.jmx?api-version=2022-11-01&fileType=ADDITIONAL_ARTIFACTS

"application/octet-stream content"

Sample Response

{
  "url": "https://dummyurl.com/testscriptresource",
  "fileName": "sample.jmx",
  "fileType": "ADDITIONAL_ARTIFACTS",
  "expireDateTime": "2021-12-05T16:43:46.072Z",
  "validationStatus": "VALIDATION_SUCCESS"
}

Definitions

Name Description
Azure.Core.Foundations.Error

The error object.

Azure.Core.Foundations.ErrorResponse

A response containing error details.

Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.

FileStatus

File status.

FileType

Types of file supported.

TestFileInfo

Test file info.

Azure.Core.Foundations.Error

The error object.

Name Type Description
code

string

One of a server-defined set of error codes.

details

Azure.Core.Foundations.Error[]

An array of details about specific errors that led to this reported error.

innererror

Azure.Core.Foundations.InnerError

An object containing more specific information than the current object about the error.

message

string

A human-readable representation of the error.

target

string

The target of the error.

Azure.Core.Foundations.ErrorResponse

A response containing error details.

Name Type Description
error

Azure.Core.Foundations.Error

The error object.

Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.

Name Type Description
code

string

One of a server-defined set of error codes.

innererror

Azure.Core.Foundations.InnerError

Inner error.

FileStatus

File status.

Name Type Description
NOT_VALIDATED

string

File is not validated.

VALIDATION_FAILURE

string

File validation is failed.

VALIDATION_INITIATED

string

File validation is in progress.

VALIDATION_NOT_REQUIRED

string

Validation is not required.

VALIDATION_SUCCESS

string

File is validated.

FileType

Types of file supported.

Name Type Description
ADDITIONAL_ARTIFACTS

string

If the file is not among any of the other supported file types.

JMX_FILE

string

If the file is a JMX script.

USER_PROPERTIES

string

If the file is a user properties file.

TestFileInfo

Test file info.

Name Type Description
expireDateTime

string

Expiry time of the file (RFC 3339 literal format)

fileName

string

Name of the file.

fileType

FileType

File type

url

string

File URL.

validationFailureDetails

string

Validation failure error details

validationStatus

FileStatus

Validation status of the file