Azure Arc Machine Run Commands API

The MachineRunCommands API from Azure Arc — 2 operation(s) for machineruncommands.

GitHub OpenAPI

Operations 4

GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands Machine run commands list #
GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} Machine run commands get #
PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} Machine run commands create or update #
DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} Machine run commands delete #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/microsoft-azure-arc:microsoft-azure-arc-machineruncommands-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

microsoft-azure-arc-machineruncommands-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: HybridComputeManagementClient Machine Run Commands API
  version: '2026-09-01'
  description: Azure Arc API reference for managing connected machines, machine extensions, run commands, gateways, licenses, license profiles, private link scopes, and related HybridCompute resources.
  x-typespec-generated:
  - emitter: '@azure-tools/typespec-autorest'
servers:
- url: https://management.azure.com
security:
- azure_auth:
  - user_impersonation
tags:
- name: MachineRunCommands
paths:
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands
  : get:
      operationId: MachineRunCommands_List
      tags:
      - MachineRunCommands
      description: The operation to get all the run commands of a non-Azure machine.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: machineName
        in: path
        description: The name of the hybrid machine.
        required: true
        schema:
          type: string
          maxLength: 54
          minLength: 1
          pattern: ^[a-zA-Z0-9-_\.]{1,54}$
      - name: $expand
        in: query
        description: The expand expression to apply on the operation.
        required: false
        schema:
          type: string
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MachineRunCommandsListResult'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-ms-pageable:
        nextLinkName: nextLink
      summary: Machine run commands list
      x-summary-source: derived
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}
  : get:
      operationId: MachineRunCommands_Get
      tags:
      - MachineRunCommands
      description: The operation to get a run command.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: machineName
        in: path
        description: The name of the hybrid machine.
        required: true
        schema:
          type: string
          maxLength: 54
          minLength: 1
          pattern: ^[a-zA-Z0-9-_\.]{1,54}$
      - name: runCommandName
        in: path
        description: The name of the run command.
        required: true
        schema:
          type: string
          pattern: '[a-zA-Z0-9-_\.]+'
      responses:
        '200':
          description: Azure operation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MachineRunCommand'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      summary: Machine run commands get
      x-summary-source: derived
    put:
      operationId: MachineRunCommands_CreateOrUpdate
      tags:
      - MachineRunCommands
      description: The operation to create or update a run command.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: machineName
        in: path
        description: The name of the hybrid machine.
        required: true
        schema:
          type: string
          maxLength: 54
          minLength: 1
          pattern: ^[a-zA-Z0-9-_\.]{1,54}$
      - name: runCommandName
        in: path
        description: The name of the run command.
        required: true
        schema:
          type: string
          pattern: '[a-zA-Z0-9-_\.]+'
      responses:
        '200':
          description: Resource 'MachineRunCommand' update operation succeeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MachineRunCommand'
        '201':
          description: Resource 'MachineRunCommand' create operation succeeded
          headers:
            Azure-AsyncOperation:
              description: A link to the status monitor
              schema:
                type: string
                format: uri
            Location:
              description: The Location header contains the URL where the status of the long running operation can be checked.
              schema:
                type: string
            Retry-After:
              description: The Retry-After header can indicate how long the client should wait before polling the operation status.
              schema:
                type: integer
                format: int32
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MachineRunCommand'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-ms-long-running-operation-options:
        final-state-via: azure-async-operation
        final-state-schema: '#/definitions/MachineRunCommand'
      x-ms-long-running-operation: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MachineRunCommand'
        description: Parameters supplied to the Create Run Command.
        required: true
      summary: Machine run commands create or update
      x-summary-source: derived
    delete:
      operationId: MachineRunCommands_Delete
      tags:
      - MachineRunCommands
      description: The operation to delete a run command.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: machineName
        in: path
        description: The name of the hybrid machine.
        required: true
        schema:
          type: string
          maxLength: 54
          minLength: 1
          pattern: ^[a-zA-Z0-9-_\.]{1,54}$
      - name: runCommandName
        in: path
        description: The name of the run command.
        required: true
        schema:
          type: string
          pattern: '[a-zA-Z0-9-_\.]+'
      responses:
        '202':
          description: Resource deletion accepted.
          headers:
            Azure-AsyncOperation:
              description: A link to the status monitor
              schema:
                type: string
                format: uri
            Location:
              description: The Location header contains the URL where the status of the long running operation can be checked.
              schema:
                type: string
            Retry-After:
              description: The Retry-After header can indicate how long the client should wait before polling the operation status.
              schema:
                type: integer
                format: int32
        '204':
          description: Resource does not exist.
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-ms-long-running-operation-options:
        final-state-via: location
      x-ms-long-running-operation: true
      summary: Machine run commands delete
      x-summary-source: derived
components:
  schemas:
    ErrorResponse:
      type: object
      title: Error response
      description: Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
          description: The error object.
    RunCommandManagedIdentity:
      type: object
      description: Contains clientId or objectId (use only one, not both) of a user-assigned managed identity that has access to storage blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of system-assigned identity. Make sure the Azure storage blob exists in case of scriptUri, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment with scriptUri blob and 'Storage Blob Data Contributor' for Append blobs(outputBlobUri, errorBlobUri). In case of user assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged.
      properties:
        clientId:
          type: string
          description: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.
        objectId:
          type: string
          description: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.
    ExtensionsStatusLevelTypes:
      type: string
      description: The level code.
      enum:
      - Info
      - Warning
      - Error
      x-ms-enum:
        name: ExtensionsStatusLevelTypes
        modelAsString: false
        values:
        - name: Info
          value: Info
          description: Info
        - name: Warning
          value: Warning
          description: Warning
        - name: Error
          value: Error
          description: Error
    MachineRunCommandScriptSource:
      type: object
      description: Describes the script sources for run command. Use only one of script, scriptUri, commandId.
      properties:
        script:
          type: string
          description: Specifies the script content to be executed on the machine.
        scriptUri:
          type: string
          description: Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.
        commandId:
          type: string
          description: Specifies the commandId of predefined built-in script.
        scriptUriManagedIdentity:
          $ref: '#/components/schemas/RunCommandManagedIdentity'
          description: User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged.
    RunCommandInputParameter:
      type: object
      description: Describes the properties of a run command parameter.
      properties:
        name:
          type: string
          description: The run command parameter name.
        value:
          type: string
          description: The run command parameter value.
      required:
      - name
      - value
    MachineRunCommandProperties:
      type: object
      description: Describes the properties of a run command.
      properties:
        source:
          $ref: '#/components/schemas/MachineRunCommandScriptSource'
          description: The source of the run command script.
        parameters:
          type: array
          description: The parameters used by the script.
          items:
            $ref: '#/components/schemas/RunCommandInputParameter'
          x-ms-identifiers:
          - name
        protectedParameters:
          type: array
          description: The parameters used by the script.
          items:
            $ref: '#/components/schemas/RunCommandInputParameter'
          x-ms-identifiers:
          - name
        asyncExecution:
          type: boolean
          description: Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.
          default: false
        runAsUser:
          type: string
          description: Specifies the user account on the machine when executing the run command.
        runAsPassword:
          type: string
          format: password
          description: Specifies the user account password on the machine when executing the run command.
          x-ms-secret: true
        timeoutInSeconds:
          type: integer
          format: int32
          description: The timeout in seconds to execute the run command.
        outputBlobUri:
          type: string
          description: Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter.
        errorBlobUri:
          type: string
          description: Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.
        outputBlobManagedIdentity:
          $ref: '#/components/schemas/RunCommandManagedIdentity'
          description: User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged
        errorBlobManagedIdentity:
          $ref: '#/components/schemas/RunCommandManagedIdentity'
          description: User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged
        provisioningState:
          type: string
          description: The provisioning state, which only appears in the response.
          readOnly: true
        instanceView:
          $ref: '#/components/schemas/MachineRunCommandInstanceView'
          description: The machine run command instance view.
          readOnly: true
    ExecutionState:
      type: string
      description: Script execution status.
      enum:
      - Unknown
      - Pending
      - Running
      - Failed
      - Succeeded
      - TimedOut
      - Canceled
      x-ms-enum:
        name: ExecutionState
        modelAsString: true
        values:
        - name: Unknown
          value: Unknown
          description: Unknown
        - name: Pending
          value: Pending
          description: Pending
        - name: Running
          value: Running
          description: Running
        - name: Failed
          value: Failed
          description: Failed
        - name: Succeeded
          value: Succeeded
          description: Succeeded
        - name: TimedOut
          value: TimedOut
          description: TimedOut
        - name: Canceled
          value: Canceled
          description: Canceled
    MachineRunCommandsListResult:
      type: object
      description: Paged collection of MachineRunCommand items
      properties:
        value:
          type: array
          description: The MachineRunCommand items on this page
          items:
            $ref: '#/components/schemas/MachineRunCommand'
        nextLink:
          type: string
          format: uri
          description: The link to the next page of items
      required:
      - value
    MachineRunCommand:
      type: object
      description: Describes a Run Command
      properties:
        properties:
          $ref: '#/components/schemas/MachineRunCommandProperties'
          description: Describes Run Command Properties
          x-ms-client-flatten: true
      allOf:
      - $ref: '#/components/schemas/TrackedResource'
    ExtensionsResourceStatus:
      type: object
      description: Instance view status.
      properties:
        code:
          type: string
          description: The status code.
        level:
          $ref: '#/components/schemas/ExtensionsStatusLevelTypes'
          description: The level code.
        displayStatus:
          type: string
          description: The short localizable label for the status.
        message:
          type: string
          description: The detailed status message, including for alerts and error messages.
        time:
          type: string
          format: date-time
          description: The time of the status.
    MachineRunCommandInstanceView:
      type: object
      description: The instance view of a machine run command.
      properties:
        executionState:
          $ref: '#/components/schemas/ExecutionState'
          description: Script execution status.
        executionMessage:
          type: string
          description: Communicate script configuration errors or execution messages.
        exitCode:
          type: integer
          format: int32
          description: Exit code returned from script execution.
        output:
          type: string
          description: Script output stream.
        error:
          type: string
          description: Script error stream.
        startTime:
          type: string
          format: date-time
          description: Script start time.
        endTime:
          type: string
          format: date-time
          description: Script end time.
        statuses:
          type: array
          description: The  status information.
          items:
            $ref: '#/components/schemas/ExtensionsResourceStatus'
          x-ms-identifiers: []
    ErrorDetail:
      type: object
      description: The error detail.
      properties:
        code:
          type: string
          description: The error code.
          readOnly: true
        message:
          type: string
          description: The error message.
          readOnly: true
        target:
          type: string
          description: The error target.
          readOnly: true
        details:
          type: array
          description: The error details.
          items:
            $ref: '#/components/schemas/ErrorDetail'
          readOnly: true
          x-ms-identifiers:
          - message
          - target
        additionalInfo:
          type: array
          description: The error additional info.
          items:
            $ref: '#/components/schemas/ErrorAdditionalInfo'
          readOnly: true
          x-ms-identifiers: []
    TrackedResource:
      type: object
      title: Tracked Resource
      description: The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
      properties:
        tags:
          type: object
          description: Resource tags.
          additionalProperties:
            type: string
          x-ms-mutability:
          - read
          - create
          - update
        location:
          type: string
          description: The geo-location where the resource lives
          x-ms-mutability:
          - read
          - create
      required:
      - location
      allOf:
      - $ref: '#/components/schemas/Resource'
  parameters:
    ResourceGroupNameParameter:
      name: resourceGroupName
      in: path
      description: The name of the resource group. The name is case insensitive.
      required: true
      x-ms-parameter-location: method
      schema:
        type: string
        maxLength: 90
        minLength: 1
    SubscriptionIdParameter:
      name: subscriptionId
      in: path
      description: The ID of the target subscription. The value must be an UUID.
      required: true
      schema:
        type: string
        format: uuid
    ApiVersionParameter:
      name: api-version
      in: query
      description: The API version to use for this operation.
      required: true
      schema:
        type: string
        minLength: 1
  securitySchemes:
    azure_auth:
      type: oauth2
      flows:
        implicit:
          scopes:
            user_impersonation: impersonate your user account
          authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
      description: Azure Active Directory OAuth2 Flow.