Skip to content

Commit 50388bf

Browse files
authored
Merge pull request #178567 from ju-shim/run-113
Run Command v2 emergency updates
2 parents 910b403 + a6db1ed commit 50388bf

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ The *updated* managed Run Command uses the same VM agent channel to execute scri
3333
- Passing secrets (parameters, passwords) in a secure manner
3434

3535

36+
## Register for preview
37+
38+
You must register your subscription in order to use managed Run Command during public preview. Go to [set up preview features in Azure subscription](../../azure-resource-manager/management/preview-features.md) for registration instructions and use the feature name `RunCommandPreview`.
39+
3640
## Azure CLI
3741

3842
The following examples use [az vm run-command](/cli/azure/vm/run-command) to run shell script on an Azure Linux VM.
@@ -41,7 +45,7 @@ The following examples use [az vm run-command](/cli/azure/vm/run-command) to run
4145
This command will deliver the script to the VM, execute it, and return the captured output.
4246

4347
```azurecli-interactive
44-
az vm run-command set --name "myRunCommand" --vm-name "myVM" --resource-group "myRG" --script "echo Hello World!"
48+
az vm run-command create --name "myRunCommand" --vm-name "myVM" --resource-group "myRG" --script "echo Hello World!"
4549
```
4650

4751
### List all deployed RunCommand resources on a VM
@@ -72,7 +76,7 @@ az vm run-command delete --name "myRunCommand" --vm-name "myVM" --resource-group
7276
This command will deliver the script to the VM, execute it, and return the captured output.
7377

7478
```powershell-interactive
75-
Set-AzVMRunCommand -ResourceGroupName "myRG" -VMName "myVM" -Name "myRunCommand" – Script "echo Hello World!"
79+
Set-AzVMRunCommand -ResourceGroupName "myRG" -VMName "myVM" -Name "RunCommandName" – Script "echo Hello World!"
7680
```
7781

7882
### List all deployed RunCommand resources on a VM
@@ -86,14 +90,14 @@ Get-AzVMRunCommand AzVMRunCommand -ResourceGroupName "myRG" -VMName "myVM"
8690
This command will retrieve current execution progress, including latest output, start/end time, exit code, and terminal state of the execution.
8791

8892
```powershell-interactive
89-
Get-AzVMRunCommand AzVMRunCommand -ResourceGroupName "myRG" -VMName "myVM" -Name "myRunCommand" -Status
93+
Get-AzVMRunCommand AzVMRunCommand -ResourceGroupName "myRG" -VMName "myVM" -Name "RunCommandName" -Status
9094
```
9195

9296
### Delete RunCommand resource from the VM
9397
Remove the RunCommand resource previously deployed on the VM. If the script execution is still in progress, execution will be terminated.
9498

9599
```powershell-interactive
96-
Remove-AzVMRunCommand AzVMRunCommand -ResourceGroupName "myRG" -VMName "myVM" -Name "myRunCommand"
100+
Remove-AzVMRunCommand AzVMRunCommand -ResourceGroupName "myRG" -VMName "myVM" -Name "RunCommandName"
97101
```
98102

99103

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ The *updated* managed Run Command uses the same VM agent channel to execute scri
3333
- Passing secrets (parameters, passwords) in a secure manner
3434

3535

36+
## Register for preview
37+
38+
You must register your subscription in order to use managed Run Command during public preview. Go to [set up preview features in Azure subscription](../../azure-resource-manager/management/preview-features.md) for registration instructions and use the feature name `RunCommandPreview`.
39+
3640
## Azure CLI
3741

3842
The following examples use [az vm run-command](/cli/azure/vm/run-command) to run shell script on an Azure Windows VM.
@@ -41,7 +45,7 @@ The following examples use [az vm run-command](/cli/azure/vm/run-command) to run
4145
This command will deliver the script to the VM, execute it, and return the captured output.
4246

4347
```azurecli-interactive
44-
az vm run-command set --name "myRunCommand" --vm-name "myVM" --resource-group "myRG" --script "Write-Host Hello World!"
48+
az vm run-command create --name "myRunCommand" --vm-name "myVM" --resource-group "myRG" --script "Write-Host Hello World!"
4549
```
4650

4751
### List all deployed RunCommand resources on a VM
@@ -72,7 +76,7 @@ az vm run-command delete --name "myRunCommand" --vm-name "myVM" --resource-group
7276
This command will deliver the script to the VM, execute it, and return the captured output.
7377

7478
```powershell-interactive
75-
Set-AzVMRunCommand -ResourceGroupName "myRG" -VMName "myVM" -Name "myRunCommand" – Script "Write-Host Hello World!"
79+
Set-AzVMRunCommand -ResourceGroupName "myRG" -VMName "myVM" -Name "RunCommandName" – Script "Write-Host Hello World!"
7680
```
7781

7882
### List all deployed RunCommand resources on a VM
@@ -86,14 +90,14 @@ Get-AzVMRunCommand AzVMRunCommand -ResourceGroupName "myRG" -VMName "myVM"
8690
This command will retrieve current execution progress, including latest output, start/end time, exit code, and terminal state of the execution.
8791

8892
```powershell-interactive
89-
Get-AzVMRunCommand AzVMRunCommand -ResourceGroupName "myRG" -VMName "myVM" -Name "myRunCommand" -Status
93+
Get-AzVMRunCommand AzVMRunCommand -ResourceGroupName "myRG" -VMName "myVM" -Name "RunCommandName" -Status
9094
```
9195

9296
### Delete RunCommand resource from the VM
9397
Remove the RunCommand resource previously deployed on the VM. If the script execution is still in progress, execution will be terminated.
9498

9599
```powershell-interactive
96-
Remove-AzVMRunCommand AzVMRunCommand -ResourceGroupName "myRG" -VMName "myVM" -Name "myRunCommand"
100+
Remove-AzVMRunCommand AzVMRunCommand -ResourceGroupName "myRG" -VMName "myVM" -Name "RunCommandName"
97101
```
98102

99103

0 commit comments

Comments
 (0)