Virtual Machine Run Commands - List

Lists all available run commands for a subscription in a location.

GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands?api-version=2017-03-30

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

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

location
path True
  • string

The location upon which run commands is queried.

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

api-version
query True
  • string

Client Api Version.

Responses

Name Type Description
200 OK

OK

Media Types: "application/json", "text/json"

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

VirtualMachineRunCommandList

Sample Request

GET https://management.azure.com/subscriptions/subid/providers/Microsoft.Compute/locations/SoutheastAsia/runCommands?api-version=2017-03-30

Sample Response

{
  "value": [
    {
      "$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
      "id": "EnableRemotePS",
      "osType": "Windows",
      "label": "Enable remote PowerShell",
      "description": "Configure the machine to enable remote powershell."
    },
    {
      "$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
      "id": "GetRDP",
      "osType": "Windows",
      "label": "RDP configuration",
      "description": "List detailed information for the RDP settings: port number, domain profile, etc. and optionally reset the RDP."
    },
    {
      "$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
      "id": "IPConfig",
      "osType": "Windows",
      "label": "List IP configuration",
      "description": "Shows detailed information for the IP address, subnet mask and default gateway for each adapter bound to TCP/IP."
    },
    {
      "$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
      "id": "PowerShellScript",
      "osType": "Windows",
      "label": "Executes a PowerShell script",
      "description": "Executes a custom PowerShell script with optional parameters."
    },
    {
      "$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
      "id": "CustomScriptForLinux",
      "osType": "Linux",
      "label": "Executes a Linux shell script",
      "description": "Executes a custom script with optional parameters."
    },
    {
      "$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
      "id": "ifconfig",
      "osType": "Linux",
      "label": "List network configuration",
      "description": "Get the configuration of all network interfaces."
    }
  ]
}

Definitions

OperatingSystemTypes

The Operating System type.

RunCommandDocumentBase

Describes the properties of a Run Command metadata.

RunCommandListResult

The List Virtual Machine operation response.

OperatingSystemTypes

The Operating System type.

Name Type Description
Linux
  • string
Windows
  • string

RunCommandDocumentBase

Describes the properties of a Run Command metadata.

Name Type Description
$schema
  • string

The VM run command schema.

description
  • string

The VM run command description.

id
  • string

The VM run command id.

label
  • string

The VM run command label.

osType

The Operating System type.

RunCommandListResult

The List Virtual Machine operation response.

Name Type Description
nextLink
  • string

The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands.

value

The list of virtual machine run commands.