Skip to content

Commit e1f162e

Browse files
authored
Merge pull request #113067 from WillyMoselhy/main
Added info about treatFailureAsDeploymentFailure in API 2023-03-01
2 parents dc47948 + ca6bf1f commit e1f162e

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

articles/virtual-machines/windows/run-command-managed.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ Remove-AzVMRunCommand -ResourceGroupName "myRG" -VMName "myVM" -RunCommandName "
237237
To deploy a new Run Command, execute a PUT on the VM directly and specify a unique name for the Run Command instance.
238238

239239
```rest
240-
PUT /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Compute/virtualMachines/<vmName>/runcommands/<runCommandName>?api-version=2019-12-01
240+
PUT /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Compute/virtualMachines/<vmName>/runcommands/<runCommandName>?api-version=2023-03-01
241241
```
242242

243243
```json
@@ -271,7 +271,8 @@ PUT /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers
271271
],
272272
"runAsUser": "userName",
273273
"runAsPassword": "userPassword",
274-
"timeoutInSeconds": 3600,
274+
"timeoutInSeconds": 3600,
275+
"treatFailureAsDeploymentFailure": true,
275276
"outputBlobUri": "< SAS URI of a storage append blob with read, add, create, write access>",
276277
"errorBlobUri": "< SAS URI of a storage append blob with read, add, create, write access >"
277278
}
@@ -281,28 +282,29 @@ PUT /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers
281282
### Notes
282283

283284
- You can provide an inline script, a script URI, or a built-in script [command ID](run-command.md#available-commands) as the input source. Script URI is either storage blob SAS URI with read access or public URI.
284-
- Only one type of source input is supported for one command execution.
285+
- Only one type of source input is supported for one command execution.
286+
- Starting with API version 2023-03-01, you can set the property `treatFailureAsDeploymentFailure` to **true** causing the deployment to fail when there is a failure in the script. If set to **false**, ProvisioningState would only reflect whether the run command was run or not by the extensions platform. It would not indicate whether the script failed in case of script failures.
285287
- Run Command supports writing output and error to Storage blobs using outputBlobUri and errorBlobUri parameters, which can be used to store large script outputs. Use SAS URI of a storage append blob with read, add, create, write access. The blob should be of type AppendBlob. Writing the script output or error blob would fail otherwise. The blob will be overwritten if it already exists. It will be created if it does not exist.
286288

287289

288290
### List running instances of Run Command on a VM
289291

290292
```rest
291-
GET /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Compute/virtualMachines/<vmName>/runcommands?api-version=2019-12-01
293+
GET /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Compute/virtualMachines/<vmName>/runcommands?api-version=2023-03-01
292294
```
293295

294296
### Get output details for a specific Run Command deployment
295297

296298
```rest
297-
GET /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Compute/virtualMachines/<vmName>/runcommands/<runCommandName>?$expand=instanceView&api-version=2019-12-01
299+
GET /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Compute/virtualMachines/<vmName>/runcommands/<runCommandName>?$expand=instanceView&api-version=2023-03-01
298300
```
299301

300302
### Delete a specific Run Command deployment
301303

302304
You can also delete the instance of Run Command.
303305

304306
```rest
305-
DELETE /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Compute/virtualMachines/<vmName>/runcommands/<runCommandName>?api-version=2019-12-01
307+
DELETE /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Compute/virtualMachines/<vmName>/runcommands/<runCommandName>?api-version=2023-03-01
306308
```
307309

308310
### Deploy scripts in an ordered sequence
@@ -339,7 +341,7 @@ In this example, **secondRunCommand** will execute after **firstRunCommand**.
339341
{
340342
"type":"Microsoft.Compute/virtualMachines/runCommands",
341343
"name":"[concat(parameters('vmName'),'/firstRunCommand')]",
342-
"apiVersion":"2019-12-01",
344+
"apiVersion":"2023-03-01",
343345
"location":"[parameters('location')]",
344346
"dependsOn":[
345347
"[concat('Microsoft.Compute/virtualMachines/', parameters('vmName'))]"

0 commit comments

Comments
 (0)