canonical: https://jentic.com/apis/azure.com/azure-managedlabsclient

# Microsoft Azure ManagedLabsClient

Jentic publishes the only available OpenAPI specification for ManagedLabsClient, keeping it validated and agent-ready. ManagedLabsClient is the Azure Resource Manager surface for the Microsoft.LabServices provider - Azure Lab Services. It provisions lab accounts, the labs inside them, gallery images for VM templates, environment settings, and the per-user environments that students and trainees connect to. It is purpose-built for classroom and training scenarios where many short-lived VMs must be created from a shared template.

## For AI agents

Provision and manage Azure Lab Services accounts, labs, gallery images, and per-user training environments. Use for classroom and training VM lifecycle, not for production virtual machine workloads.

## Scope

Does not run production VMs, manage Microsoft.Compute virtual machines, or act as a learning management system - use only for Microsoft.LabServices classroom and training lab lifecycle.

## Capabilities

- Create and manage lab accounts that group labs under a billing and policy boundary
- Provision labs inside a lab account with size limits, expiration, and shared password policy
- Configure environment settings that define the VM template, size, and network for a lab
- Manage per-user environments - start, stop, and reset VMs assigned to individual students
- Add and remove users from a lab and inspect their assigned environments
- Browse gallery images available for use as a lab VM template
- Register and authenticate global users, retrieve their personal preferences and environment list

## Use cases

### Classroom Lab Provisioning

Universities and corporate training providers deliver hands-on courses by provisioning a lab per cohort. ManagedLabsClient creates the lab account, the lab itself, and the environment setting that ties the lab to a Windows or Linux gallery image. Students are added by email and Lab Services creates a per-user environment cloned from the template, ready before class starts.

Example prompt: Create lab account 'data-science-training' in westus, then provision a lab 'spring-2026-cohort' with 30 maxUsersInLab and an environmentSetting using gallery image 'Win11-DataScience' on Standard_D2s_v3, then add student emails from a CSV.

### Per-Student Environment Lifecycle

Instructors start a student's lab VM right before class and stop it at the end to keep compute spend predictable. The Environments resource exposes Start and Stop on each per-user environment, and the GlobalUsers GetEnvironment endpoint lets a student-facing portal fetch the connection details on demand. Reset returns the environment to template state for a fresh session.

Example prompt: List environments in lab 'spring-2026-cohort' with status=Stopped, call Start on each one assigned to today's session attendees, and return their RDP connection URLs.

### Cohort Cost Control

Operations teams cap classroom spend by stopping all running environments in a lab at the end of the day and removing expired labs from the lab account. Listing environments by status and bulk-stopping is a common end-of-day routine. Lab expiration is enforced through the lab's expirationDate property, and Labs_Delete cleans up everything underneath.

Example prompt: List all labs in the lab account, stop every Environment with status=Started across labs, then DELETE any lab whose expirationDate is more than 7 days in the past.

### Gallery Image Curation

Course owners curate which VM images students can launch by approving gallery images for a lab account. GalleryImages_List returns every available image in the lab account; updating an image's isEnabled flag controls whether instructors can select it when configuring environment settings. This keeps lab launches consistent with curriculum requirements.

Example prompt: List GalleryImages in lab account 'data-science-training', then PATCH the image named 'Win10-Office' setting isEnabled=true so instructors can use it in new environment settings.

### AI Agent Lab Operations

Operations agents that own classroom infrastructure use Jentic to discover Lab Services operations on demand. Searching for an intent like 'start a lab services environment' returns the matching schema; the agent loads it and executes against management.azure.com using a token retrieved from your Jentic One instance, so per-cohort routines do not require bundling the Lab Services SDK.

Example prompt: Use Jentic to search 'start an azure lab services environment for a user', load the Environments_Start schema, and POST to start the per-user environment for each student in the day's session.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /providers/Microsoft.LabServices/users/{userName}/listEnvironments | List all environments assigned to a global user |
| POST | /providers/Microsoft.LabServices/users/{userName}/listLabs | List labs a global user is enrolled in |
| POST | /providers/Microsoft.LabServices/users/{userName}/getEnvironment | Fetch a single environment with connection details |
| POST | /providers/Microsoft.LabServices/users/{userName}/register | Register a global user against a lab |
| GET | /providers/Microsoft.LabServices/operations | List Microsoft.LabServices provider operations |
| POST | /providers/Microsoft.LabServices/users/{userName}/getPersonalPreferences | Get a global user's personal lab preferences |

## Key resources

- **LabAccounts** — Top-level container resource that groups labs and gallery images under a billing boundary.
- **Labs** — Individual lab instances inside a lab account with user caps, expiration, and policies.
- **EnvironmentSettings** — Lab-level template configuration: gallery image, VM size, network, and resource settings.
- **Environments** — Per-user VM instances cloned from the environment setting; supports start, stop, reset.
- **Users** — Add and manage users (typically by email) inside a specific lab.
- **GalleryImages** — Images available in a lab account for selection as VM templates.
- **GlobalUsers** — Cross-tenant student-facing operations: register, list labs, list environments, get personal preferences.

## Why Jentic

- **Setup:** Wiring the Microsoft.LabServices management API by hand means registering an Azure AD app, negotiating OAuth 2.0 tokens for management.azure.com, and carrying user and lab scope through every classroom lab call. Through Jentic you install once, import ManagedLabsClient from the API Directory, store the Azure AD credential once, and your agent calls it.
- **Permission scoping:** This API puts the user in the URL path (/users/{userName}/listLabs, /users/{userName}/getEnvironment), so a rule can pin your agent to one user: it can list that user's labs and environments and read their preferences. You choose the operations it may call, so registering the user to a lab is not included unless you add it.
- **Credential handling:** Your Azure AD credential for the LabServices control plane is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'list a lab user's environments' or 'read lab personal preferences', and Jentic returns the matching LabServices operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **DevTestLabsClient** — Azure DevTest Labs API for engineering team test environments rather than classroom labs.
- **NetworkManagementClient** — Configure VNets and subnets used by lab environment settings.
- **ManagedServiceIdentityClient** — Provision identities used by lab automation runbooks.

## FAQ

### Why is there no official OpenAPI spec for ManagedLabsClient?

Microsoft Azure does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call ManagedLabsClient via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the ManagedLabsClient use?

AAD OAuth 2.0 bearer tokens scoped to https://management.azure.com/. With Jentic, AAD client credentials are stored encrypted in the vault and a short-lived bearer token is injected at call time.

### Does this API replace Azure DevTest Labs?

No - Azure Lab Services (Microsoft.LabServices) and Azure DevTest Labs (Microsoft.DevTestLab) are separate offerings. Lab Services is built for classroom and training scenarios with simple per-user VMs; DevTest Labs is aimed at developer and test environments with formulas, artifacts, and policies for engineering teams.

### What are the rate limits for the ManagedLabsClient?

Standard Azure Resource Manager throttling - typically 12,000 reads and 1,200 writes per hour per subscription per region. Environment Start and Stop calls are asynchronous and return 202 Accepted; the GlobalUsers GetOperationStatus endpoint surfaces progress.

### How do I start a student VM through Jentic?

Run pip install jentic, then search Jentic for 'start an azure lab services environment for a user'. Jentic returns the Environments_Start operation; load it, supply the lab account, lab name, environment setting name, and environment name, and POST to /environments/{environmentName}/start.

### Can I use this API to run production workloads?

No. Lab Services VMs are scoped to short-lived training scenarios with shared-password access and no SLA-grade guarantees. Production workloads should use Microsoft.Compute virtual machines or virtual machine scale sets via the standard compute APIs.

### Can I limit what my agent is allowed to do with the Azure Lab Services API?

Yes. Because you run Jentic One yourself, your own rules decide which Lab Services operations and credentials the agent may use. This API puts the user in the URL path, as in /users/{userName}/listLabs and /users/{userName}/getEnvironment, so a rule can pin the agent to a single user and let it list that user's labs and read their environments and preferences. You choose the operations it may call, so an action like registering a user to a lab or starting an environment is only available when you add it.
