Virtual Machine Scale Set VM Run Commands - Get
The operation to get the VMSS VM run command.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}?api-version=2021-11-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}?$expand={$expand}&api-version=2021-11-01
Name | In | Required | Type | Description |
---|---|---|---|---|
instance
|
path | True |
string |
The instance ID of the virtual machine. |
resource
|
path | True |
string |
The name of the resource group. |
run
|
path | True |
string |
The name of the virtual machine run command. |
subscription
|
path | True |
string |
Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
vm
|
path | True |
string |
The name of the VM scale set. |
api-version
|
query | True |
string |
Client Api Version. |
$expand
|
query |
string |
The expand expression to apply on the operation. |
Name | Type | Description |
---|---|---|
200 OK |
OK Media Types: "application/json", "text/json" |
|
Other Status Codes |
Error response describing why the operation failed. Media Types: "application/json", "text/json" |
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Sample request
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/runCommands/myRunCommand?api-version=2021-11-01
Sample response
{
"name": "myRunCommand",
"type": "Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands",
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/runCommands/myRunCommand",
"location": "westus",
"tags": {
"tag1": "value1",
"tag2": "value2"
},
"properties": {
"source": {
"script": "Write-Host Hello World!"
},
"parameters": [
{
"name": "param1",
"value": "value1"
},
{
"name": "param2",
"value": "value2"
}
],
"asyncExecution": false,
"runAsUser": "user1",
"timeoutInSeconds": 3600,
"provisioningState": "Succeeded"
}
}
Name | Description |
---|---|
Api |
Api error. |
Api |
Api error base. |
Cloud |
An error response from the Compute service. |
Execution |
Script execution status. |
Inner |
Inner error details. |
Instance |
Instance view status. |
Run |
Describes the properties of a run command parameter. |
Status |
The level code. |
Virtual |
Describes a Virtual Machine run command. |
Virtual |
The instance view of a virtual machine run command. |
Virtual |
Describes the script sources for run command. |
Api error.
Name | Type | Description |
---|---|---|
code |
string |
The error code. |
details |
The Api error details |
|
innererror |
The Api inner error |
|
message |
string |
The error message. |
target |
string |
The target of the particular error. |
Api error base.
Name | Type | Description |
---|---|---|
code |
string |
The error code. |
message |
string |
The error message. |
target |
string |
The target of the particular error. |
An error response from the Compute service.
Name | Type | Description |
---|---|---|
error |
Api error. |
Script execution status.
Value | Description |
---|---|
Canceled | |
Failed | |
Pending | |
Running | |
Succeeded | |
TimedOut | |
Unknown |
Inner error details.
Name | Type | Description |
---|---|---|
errordetail |
string |
The internal error message or exception dump. |
exceptiontype |
string |
The exception type. |
Instance view status.
Name | Type | Description |
---|---|---|
code |
string |
The status code. |
displayStatus |
string |
The short localizable label for the status. |
level |
The level code. |
|
message |
string |
The detailed status message, including for alerts and error messages. |
time |
string |
The time of the status. |
Describes the properties of a run command parameter.
Name | Type | Description |
---|---|---|
name |
string |
The run command parameter name. |
value |
string |
The run command parameter value. |
The level code.
Value | Description |
---|---|
Error | |
Info | |
Warning |
Describes a Virtual Machine run command.
Name | Type | Default value | Description |
---|---|---|---|
id |
string |
Resource Id |
|
location |
string |
Resource location |
|
name |
string |
Resource name |
|
properties.asyncExecution |
boolean |
False |
Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. |
properties.errorBlobUri |
string |
Specifies the Azure storage blob where script error stream will be uploaded. |
|
properties.instanceView |
The virtual machine run command instance view. |
||
properties.outputBlobUri |
string |
Specifies the Azure storage blob where script output stream will be uploaded. |
|
properties.parameters |
The parameters used by the script. |
||
properties.protectedParameters |
The parameters used by the script. |
||
properties.provisioningState |
string |
The provisioning state, which only appears in the response. |
|
properties.runAsPassword |
string |
Specifies the user account password on the VM when executing the run command. |
|
properties.runAsUser |
string |
Specifies the user account on the VM when executing the run command. |
|
properties.source |
The source of the run command script. |
||
properties.timeoutInSeconds |
integer |
The timeout in seconds to execute the run command. |
|
tags |
object |
Resource tags |
|
type |
string |
Resource type |
The instance view of a virtual machine run command.
Name | Type | Description |
---|---|---|
endTime |
string |
Script end time. |
error |
string |
Script error stream. |
executionMessage |
string |
Communicate script configuration errors or execution messages. |
executionState |
Script execution status. |
|
exitCode |
integer |
Exit code returned from script execution. |
output |
string |
Script output stream. |
startTime |
string |
Script start time. |
statuses |
The resource status information. |
Describes the script sources for run command.
Name | Type | Description |
---|---|---|
commandId |
string |
Specifies a commandId of predefined built-in script. |
script |
string |
Specifies the script content to be executed on the VM. |
scriptUri |
string |
Specifies the script download location. |