Microsoft Azure virtual machine API

The virtual machine API from Microsoft Azure, for virtual machine.

GitHub OpenAPI
Business capability
IT Infrastructure Management BC-600.50

Operations 7

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines List virtual machines in a lab · Microsoft Azure Get All Virtual Machines For A Lab #
Ask an LLM
“Which student VMs exist in my Lab Services lab?”
“Can I filter a lab's virtual machine list?”
Tell an agent
List all virtual machines in lab {labName}.
List lab virtual machines matching {filter}.
GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName} Get a lab virtual machine · Microsoft Azure Get A Lab Virtual Machine #
Ask an LLM
“What state is a particular lab VM in and who is it assigned to?”
“How do I see the properties of one lab virtual machine?”
Tell an agent
Get virtual machine {virtualMachineName} in lab {labName}.
Show the state of lab VM {virtualMachineName}.
POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/start Start a lab virtual machine · Microsoft Azure Start A Lab Virtual Machine #
Ask an LLM
“How do I turn on a lab VM for a student?”
“Can an instructor start one lab virtual machine through the API?”
Tell an agent
Start virtual machine {virtualMachineName} in lab {labName}.
Power on lab VM {virtualMachineName}.
POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/stop Stop a lab virtual machine · Microsoft Azure Stop A Lab Virtual Machine #
Ask an LLM
“How do I shut down a single lab VM that was left running?”
“Can I stop one lab virtual machine to save quota hours?”
Tell an agent
Stop virtual machine {virtualMachineName} in lab {labName}.
Shut down lab VM {virtualMachineName}.
POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/reimage Reimage a lab virtual machine · Microsoft Azure Re Image A Lab Virtual Machine #
Ask an LLM
“How do I reset a broken lab VM back to the template image?”
“Does reimaging a lab VM delete it and rebuild from the latest published snapshot?”
Tell an agent destructive · confirm first
Reimage virtual machine {virtualMachineName} in lab {labName}.
Rebuild lab VM {virtualMachineName} from the published template.
POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/redeploy Redeploy a lab VM to a new compute node · Microsoft Azure Redeploy A Lab Virtual Machine To A Different Compute Node For… #
Ask an LLM
“A student can't connect to their lab VM - can I move it to another host?”
“What does redeploying a lab virtual machine do for connectivity problems?”
Tell an agent
Redeploy virtual machine {virtualMachineName} in lab {labName}.
Move lab VM {virtualMachineName} to a different compute node.
POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/resetPassword Reset a lab virtual machine password · Microsoft Azure Reset A Lab Virtual Machine Password #
Ask an LLM
“How do I reset the login password on one lab VM?”
“Can I set a new username and password for a lab virtual machine?”
Tell an agent
Reset the password on VM {virtualMachineName} in lab {labName}.
Set lab VM {virtualMachineName} login to {username} with password {password}.

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:microsoft-azure-virtual-machine-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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

microsoft-azure-virtual-machine-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 2021-11-15-preview
  title: Microsoft Azure LabServicesClient Virtual Machine API
  description: REST API for managing Azure Lab Services virtual machines.
servers:
- url: https://management.azure.com
tags:
- name: virtual machine
paths:
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines
  : parameters:
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter
    - $ref: Labs.json#/parameters/LabNameParameter
    - in: query
      name: $filter
      description: The filter to apply to the operation.
      schema:
        type: string
    get:
      tags:
      - virtual machine
      summary: Microsoft Azure Get All Virtual Machines For A Lab
      description: Returns a list of all virtual machines for a lab.
      operationId: microsoftAzureVirtualmachinesListbylab
      responses:
        '200':
          description: The request was successful; response contains all virtual machines for the given lab.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedVirtualMachines'
        default:
          description: The default error response.
          content:
            application/json:
              schema:
                $ref: ../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse
      x-ms-pageable:
        nextLinkName: nextLink
      x-ms-examples:
        listVirtualMachine:
          $ref: ./examples/VirtualMachines/listVirtualMachine.json
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}
  : parameters:
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter
    - $ref: Labs.json#/parameters/LabNameParameter
    - $ref: '#/components/parameters/VirtualMachineNameParameter'
    get:
      tags:
      - virtual machine
      summary: Microsoft Azure Get A Lab Virtual Machine
      description: Returns the properties for a lab virtual machine.
      operationId: microsoftAzureVirtualmachinesGet
      responses:
        '200':
          description: The request was successful; response contains the lab virtual machine.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualMachine'
        default:
          description: The default error response.
          content:
            application/json:
              schema:
                $ref: ../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse
      x-ms-examples:
        getVirtualMachine:
          $ref: ./examples/VirtualMachines/getVirtualMachine.json
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/start
  : parameters:
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter
    - $ref: Labs.json#/parameters/LabNameParameter
    - $ref: '#/components/parameters/VirtualMachineNameParameter'
    post:
      tags:
      - virtual machine
      summary: Microsoft Azure Start A Lab Virtual Machine
      description: Action to start a lab virtual machine.
      operationId: microsoftAzureVirtualmachinesStart
      responses:
        '200':
          description: The request was completed.
        '202':
          description: The request was accepted.
        default:
          description: The default error response.
          content:
            application/json:
              schema:
                $ref: ../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse
      x-ms-long-running-operation: true
      x-ms-long-running-operation-options:
        final-state-via: location
      x-ms-examples:
        startVirtualMachine:
          $ref: ./examples/VirtualMachines/startVirtualMachine.json
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/stop
  : parameters:
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter
    - $ref: Labs.json#/parameters/LabNameParameter
    - $ref: '#/components/parameters/VirtualMachineNameParameter'
    post:
      tags:
      - virtual machine
      summary: Microsoft Azure Stop A Lab Virtual Machine
      description: Action to stop a lab virtual machine.
      operationId: microsoftAzureVirtualmachinesStop
      responses:
        '200':
          description: The request was completed.
        '202':
          description: The request was accepted.
        default:
          description: The default error response.
          content:
            application/json:
              schema:
                $ref: ../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse
      x-ms-long-running-operation: true
      x-ms-long-running-operation-options:
        final-state-via: location
      x-ms-examples:
        stopVirtualMachine:
          $ref: ./examples/VirtualMachines/stopVirtualMachine.json
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/reimage
  : parameters:
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter
    - $ref: Labs.json#/parameters/LabNameParameter
    - $ref: '#/components/parameters/VirtualMachineNameParameter'
    post:
      tags:
      - virtual machine
      summary: Microsoft Azure Re Image A Lab Virtual Machine
      description: Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published snapshot of the reference environment of the lab.
      operationId: microsoftAzureVirtualmachinesReimage
      responses:
        '200':
          description: The request was completed.
        '202':
          description: The request was accepted.
        default:
          description: The default error response.
          content:
            application/json:
              schema:
                $ref: ../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse
      x-ms-long-running-operation: true
      x-ms-long-running-operation-options:
        final-state-via: location
      x-ms-examples:
        reimageVirtualMachine:
          $ref: ./examples/VirtualMachines/reimageVirtualMachine.json
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/redeploy
  : parameters:
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter
    - $ref: Labs.json#/parameters/LabNameParameter
    - $ref: '#/components/parameters/VirtualMachineNameParameter'
    post:
      tags:
      - virtual machine
      summary: Microsoft Azure Redeploy A Lab Virtual Machine To A Different Compute Node For…
      description: Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity.
      operationId: microsoftAzureVirtualmachinesRedeploy
      responses:
        '200':
          description: The request was completed.
        '202':
          description: The request was accepted.
        default:
          description: The default error response.
          content:
            application/json:
              schema:
                $ref: ../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse
      x-ms-long-running-operation: true
      x-ms-long-running-operation-options:
        final-state-via: location
      x-ms-examples:
        redeployVirtualMachine:
          $ref: ./examples/VirtualMachines/redeployVirtualMachine.json
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/resetPassword
  : parameters:
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter
    - $ref: ../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter
    - $ref: Labs.json#/parameters/LabNameParameter
    - $ref: '#/components/parameters/VirtualMachineNameParameter'
    post:
      tags:
      - virtual machine
      summary: Microsoft Azure Reset A Lab Virtual Machine Password
      description: Resets a lab virtual machine password.
      operationId: microsoftAzureVirtualmachinesResetpassword
      responses:
        '200':
          description: The request was completed.
        '202':
          description: The request was accepted.
        default:
          description: The default error response.
          content:
            application/json:
              schema:
                $ref: ../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse
      x-ms-long-running-operation: true
      x-ms-long-running-operation-options:
        final-state-via: location
      x-ms-examples:
        resetPasswordVirtualMachine:
          $ref: ./examples/VirtualMachines/resetPasswordVirtualMachine.json
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResetPasswordBody'
        description: The request body.
        required: true
components:
  parameters:
    VirtualMachineNameParameter:
      name: virtualMachineName
      in: path
      required: true
      description: The ID of the virtual machine that uniquely identifies it within the containing lab. Used in resource URIs.
      x-ms-parameter-location: method
      schema:
        type: string
        maxLength: 100
        minLength: 1
        pattern: ^[-\w\\._\\(\\)]+$
  schemas:
    ResetPasswordBody:
      description: Body of a reset password request.
      type: object
      properties:
        username:
          description: The user whose password is being reset
          type: string
          x-ms-mutability:
          - read
          - create
        password:
          description: The password
          type: string
          x-ms-secret: true
          x-ms-mutability:
          - create
      required:
      - username
      - password
    VirtualMachineType:
      type: string
      enum:
      - User
      - Template
      description: The type of the lab virtual machine.
      x-ms-enum:
        name: VirtualMachineType
        modelAsString: false
        values:
        - value: User
          description: A user VM
        - value: Template
          description: A template VM
    VirtualMachineState:
      type: string
      enum:
      - Stopped
      - Starting
      - Running
      - Stopping
      - ResettingPassword
      - Reimaging
      - Redeploying
      description: The state of a virtual machine.
      x-ms-enum:
        name: VirtualMachineState
        modelAsString: false
        values:
        - value: Stopped
          description: The VM is currently stopped.
        - value: Starting
          description: The VM is starting.
        - value: Running
          description: The VM is running.
        - value: Stopping
          description: The VM is stopping.
        - value: ResettingPassword
          description: The VM password is being reset.
        - value: Reimaging
          description: The VM is being reimaged.
        - value: Redeploying
          description: The VM is being redeployed.
    PagedVirtualMachines:
      description: Paged list of lab services virtual machines.
      type: object
      properties:
        value:
          description: The array page of virtual machine results.
          type: array
          items:
            $ref: '#/components/schemas/VirtualMachine'
          readOnly: true
        nextLink:
          description: The link to get the next page of virtual machine results.
          type: string
          readOnly: true
    VirtualMachineConnectionProfile:
      description: The connection information for the virtual machine
      type: object
      properties:
        privateIpAddress:
          description: The private IP address of the virtual machine.
          type: string
          readOnly: true
        sshAuthority:
          description: Port and host name separated by semicolon for connecting via SSH protocol to the virtual machine.
          type: string
          readOnly: true
        sshInBrowserUrl:
          description: URL for connecting via SSH protocol to the virtual machine in browser.
          $ref: LabServices.json#/definitions/url
          readOnly: true
        rdpAuthority:
          description: Port and host name separated by semicolon for connecting via RDP protocol to the virtual machine.
          type: string
          readOnly: true
        rdpInBrowserUrl:
          description: URL for connecting via RDP protocol to the virtual machine in browser.
          $ref: LabServices.json#/definitions/url
          readOnly: true
        adminUsername:
          description: The username used to log on to the virtual machine as admin.
          type: string
          readOnly: true
        nonAdminUsername:
          description: The username used to log on to the virtual machine as non-admin, if one exists.
          type: string
          readOnly: true
    VirtualMachineProperties:
      description: Virtual machine resource properties
      type: object
      properties:
        provisioningState:
          description: Current provisioning state of the virtual machine.
          $ref: LabServices.json#/definitions/provisioningState
          readOnly: true
        state:
          description: The current state of the virtual machine
          $ref: '#/components/schemas/VirtualMachineState'
          readOnly: true
        connectionProfile:
          description: Profile for information about connecting to the virtual machine.
          $ref: '#/components/schemas/VirtualMachineConnectionProfile'
          readOnly: true
        claimedByUserId:
          description: The lab user ID (not the PUID!) of who claimed the virtual machine.
          type: string
          readOnly: true
        vmType:
          description: The type of this VM resource
          $ref: '#/components/schemas/VirtualMachineType'
          readOnly: true
    VirtualMachine:
      description: A lab virtual machine resource.
      type: object
      allOf:
      - $ref: ../../../../../common-types/resource-management/v2/types.json#/definitions/ProxyResource
      properties:
        systemData:
          $ref: ../../../../../common-types/resource-management/v2/types.json#/definitions/systemData
          description: System data of the Lab virtual machine.
          readOnly: true
        properties:
          description: Virtual machine resource properties
          $ref: '#/components/schemas/VirtualMachineProperties'
          x-ms-client-flatten: true
      required:
      - properties
  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