Skip to content

Commit c7a58ae

Browse files
Merge pull request #230128 from kof-f/patch-61
Adding file validator to template reference doc
2 parents 80f15df + faaf327 commit c7a58ae

File tree

1 file changed

+32
-26
lines changed

1 file changed

+32
-26
lines changed

articles/virtual-machines/linux/image-builder-json.md

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ You can use the `validate` property to validate platform images and any customiz
11721172

11731173
Azure Image Builder supports a 'Source-Validation-Only' mode that can be set using the `sourceValidationOnly` property. If the `sourceValidationOnly` property is set to true, the image specified in the `source` section will directly be validated. No separate build will be run to generate and then validate a customized image.
11741174

1175-
The `inVMValidations` property takes a list of validators that will be performed on the image. Azure Image Builder supports both PowerShell and Shell validators.
1175+
The `inVMValidations` property takes a list of validators that will be performed on the image. Azure Image Builder supports File, PowerShell and Shell validators.
11761176

11771177
The `continueDistributeOnFailure` property is responsible for whether the output image(s) will be distributed if validation fails. By default, if validation fails and this property is set to false, the output image(s) won't be distributed. If validation fails and this property is set to true, the output image(s) will still be distributed. Use this option with caution as it may result in failed images being distributed for use. In either case (true or false), the end to end image run will be reported as a failed if a validation failure. This property has no effect on whether validation succeeds or not.
11781178

@@ -1191,31 +1191,37 @@ How to use the `validate` property to validate Windows images:
11911191

11921192
```json
11931193
{
1194-
"properties": {
1195-
"validate": {
1196-
"continueDistributeOnFailure": false,
1197-
"sourceValidationOnly": false,
1198-
"inVMValidations": [
1199-
{
1200-
"type": "PowerShell",
1201-
"name": "test PowerShell validator inline",
1202-
"inline": [
1203-
"<command to run inline>"
1204-
],
1205-
"validExitCodes": <exit code>,
1206-
"runElevated": <true or false>,
1207-
"runAsSystem": <true or false>
1208-
},
1209-
{
1210-
"type": "PowerShell",
1211-
"name": "<name>",
1212-
"scriptUri": "<path to script>",
1213-
"runElevated": <true false>,
1214-
"sha256Checksum": "<sha256 checksum>"
1215-
}
1216-
]
1217-
}
1218-
}
1194+
"properties":{
1195+
"validate":{
1196+
"continueDistributeOnFailure":false,
1197+
"sourceValidationOnly":false,
1198+
"inVMValidations":[
1199+
{
1200+
"type":"File",
1201+
"destination":"string",
1202+
"sha256Checksum":"string",
1203+
"sourceUri":"string"
1204+
},
1205+
{
1206+
"type":"PowerShell",
1207+
"name":"test PowerShell validator inline",
1208+
"inline":[
1209+
"<command to run inline>"
1210+
],
1211+
"validExitCodes":"<exit code>",
1212+
"runElevated":"<true or false>",
1213+
"runAsSystem":"<true or false>"
1214+
},
1215+
{
1216+
"type":"PowerShell",
1217+
"name":"<name>",
1218+
"scriptUri":"<path to script>",
1219+
"runElevated":"<true false>",
1220+
"sha256Checksum":"<sha256 checksum>"
1221+
}
1222+
]
1223+
}
1224+
}
12191225
}
12201226
```
12211227

0 commit comments

Comments
 (0)