Test Job - Create

Create a test job of the runbook.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob?api-version=2023-11-01

URI Parameters

Name In Required Type Description
automationAccountName
path True

string

The name of the automation account.

resourceGroupName
path True

string

Name of an Azure Resource group.

Regex pattern: ^[-\w\._]+$

runbookName
path True

string

The parameters supplied to the create test job operation.

Regex pattern: ^[a-zA-Z][a-zA-Z-_0-9]*$

subscriptionId
path True

string

Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

api-version
query True

string

Client Api Version.

Request Body

Name Type Description
parameters

object

Gets or sets the parameters of the test job.

runOn

string

Gets or sets the runOn which specifies the group name where the job is to be executed.

Responses

Name Type Description
201 Created

TestJob

Created

Other Status Codes

ErrorResponse

Automation error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

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

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Create test job

Sample Request

PUT https://management.azure.com/subscriptions/51766542-3ed7-4a72-a187-0c8ab644ddab/resourceGroups/mygroup/providers/Microsoft.Automation/automationAccounts/ContoseAutomationAccount/runbooks/Get-AzureVMTutorial/draft/testJob?api-version=2023-11-01

{
  "parameters": {
    "key01": "value01",
    "key02": "value02"
  },
  "runOn": ""
}

Sample Response

{
  "creationTime": "2018-02-09T05:51:59.82+00:00",
  "status": "New",
  "statusDetails": "None",
  "startTime": null,
  "endTime": null,
  "lastModifiedTime": "2018-02-09T05:51:59.82+00:00",
  "lastStatusModifiedTime": "2018-02-09T05:51:59.82+00:00",
  "exception": null,
  "parameters": {},
  "runOn": null,
  "logActivityTrace": null
}

Definitions

Name Description
ErrorResponse

Error response of an operation failure

TestJob

Definition of the test job.

TestJobCreateParameters

The parameters supplied to the create test job operation.

ErrorResponse

Error response of an operation failure

Name Type Description
code

string

Error code

message

string

Error message indicating why the operation failed.

TestJob

Definition of the test job.

Name Type Description
creationTime

string

Gets or sets the creation time of the test job.

endTime

string

Gets or sets the end time of the test job.

exception

string

Gets or sets the exception of the test job.

lastModifiedTime

string

Gets or sets the last modified time of the test job.

lastStatusModifiedTime

string

Gets or sets the last status modified time of the test job.

logActivityTrace

integer

The activity-level tracing options of the runbook.

parameters

object

Gets or sets the parameters of the test job.

runOn

string

Gets or sets the runOn which specifies the group name where the job is to be executed.

startTime

string

Gets or sets the start time of the test job.

status

string

Gets or sets the status of the test job.

statusDetails

string

Gets or sets the status details of the test job.

TestJobCreateParameters

The parameters supplied to the create test job operation.

Name Type Description
parameters

object

Gets or sets the parameters of the test job.

runOn

string

Gets or sets the runOn which specifies the group name where the job is to be executed.