Azure DevTest Labs Policies API

The Policies API from Azure DevTest Labs — 2 operation(s) for policies.

GitHub OpenAPI

Operations 5

GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies Policies list #
GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name} Policies get #
PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name} Policies create or update #
PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name} Policies update #
DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name} Policies 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/azure-test-labs:azure-test-labs-policies-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

azure-test-labs-policies-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: DevTestLabsClient Policies API
  version: '2018-09-15'
  description: The DevTest Labs Client.
  x-typespec-generated:
  - emitter: '@azure-tools/typespec-autorest'
servers:
- url: https://management.azure.com
security:
- azure_auth:
  - user_impersonation
tags:
- name: Policies
paths:
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies
  : get:
      operationId: Policies_List
      tags:
      - Policies
      description: List policies in a given policy set.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: labName
        in: path
        description: labs
        required: true
        schema:
          type: string
      - name: policySetName
        in: path
        description: policysets
        required: true
        schema:
          type: string
      - name: $expand
        in: query
        description: 'Specify the $expand query. Example: ''properties($select=description)'''
        required: false
        schema:
          type: string
      - name: $filter
        in: query
        description: 'The filter to apply to the operation. Example: ''$filter=contains(name,''myName'')'
        required: false
        schema:
          type: string
      - name: $top
        in: query
        description: 'The maximum number of resources to return from the operation. Example: ''$top=10'''
        required: false
        schema:
          type: integer
          format: int32
      - name: $orderby
        in: query
        description: 'The ordering expression for the results, using OData notation. Example: ''$orderby=name desc'''
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Azure operation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyList'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-ms-pageable:
        nextLinkName: nextLink
      summary: Policies list
      x-summary-source: derived
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}
  : get:
      operationId: Policies_Get
      tags:
      - Policies
      description: Get policy.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: labName
        in: path
        description: labs
        required: true
        schema:
          type: string
      - name: policySetName
        in: path
        description: policysets
        required: true
        schema:
          type: string
      - name: name
        in: path
        description: The name of the Policy
        required: true
        schema:
          type: string
      - name: $expand
        in: query
        description: 'Specify the $expand query. Example: ''properties($select=description)'''
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Azure operation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      summary: Policies get
      x-summary-source: derived
    put:
      operationId: Policies_CreateOrUpdate
      tags:
      - Policies
      description: Create or replace an existing policy.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: labName
        in: path
        description: labs
        required: true
        schema:
          type: string
      - name: policySetName
        in: path
        description: policysets
        required: true
        schema:
          type: string
      - name: name
        in: path
        description: The name of the Policy
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Resource 'Policy' update operation succeeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
        '201':
          description: Resource 'Policy' create operation succeeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Policy'
        description: A Policy.
        required: true
      summary: Policies create or update
      x-summary-source: derived
    patch:
      operationId: Policies_Update
      tags:
      - Policies
      description: Allows modifying tags of policies. All other properties will be ignored.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: labName
        in: path
        description: labs
        required: true
        schema:
          type: string
      - name: policySetName
        in: path
        description: policysets
        required: true
        schema:
          type: string
      - name: name
        in: path
        description: The name of the Policy
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Azure operation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyFragment'
        description: A Policy.
        required: true
      summary: Policies update
      x-summary-source: derived
    delete:
      operationId: Policies_Delete
      tags:
      - Policies
      description: Delete policy.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: labName
        in: path
        description: labs
        required: true
        schema:
          type: string
      - name: policySetName
        in: path
        description: policysets
        required: true
        schema:
          type: string
      - name: name
        in: path
        description: The name of the Policy
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Resource deleted successfully.
        '204':
          description: Resource does not exist.
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      summary: Policies delete
      x-summary-source: derived
components:
  parameters:
    SubscriptionIdParameter:
      name: subscriptionId
      in: path
      description: The ID of the target subscription.
      required: true
      schema:
        type: string
        minLength: 1
    ApiVersionParameter:
      name: api-version
      in: query
      description: The API version to use for this operation.
      required: true
      schema:
        type: string
        minLength: 1
    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
  schemas:
    PolicyProperties:
      type: object
      description: Properties of a Policy.
      properties:
        description:
          type: string
          description: The description of the policy.
        status:
          $ref: '#/components/schemas/PolicyStatus'
          description: The status of the policy.
        factName:
          $ref: '#/components/schemas/PolicyFactName'
          description: The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.
        factData:
          type: string
          description: The fact data of the policy.
        threshold:
          type: string
          description: The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy).
        evaluatorType:
          $ref: '#/components/schemas/PolicyEvaluatorType'
          description: The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
        createdDate:
          type: string
          format: date-time
          description: The creation date of the policy.
          readOnly: true
        provisioningState:
          type: string
          description: The provisioning status of the resource.
          readOnly: true
        uniqueIdentifier:
          type: string
          description: The unique immutable identifier of a resource (Guid).
          readOnly: true
    PolicyFactName:
      type: string
      description: The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.
      enum:
      - UserOwnedLabVmCount
      - UserOwnedLabPremiumVmCount
      - LabVmCount
      - LabPremiumVmCount
      - LabVmSize
      - GalleryImage
      - UserOwnedLabVmCountInSubnet
      - LabTargetCost
      - EnvironmentTemplate
      - ScheduleEditPermission
      x-ms-enum:
        name: PolicyFactName
        modelAsString: true
        values:
        - name: UserOwnedLabVmCount
          value: UserOwnedLabVmCount
        - name: UserOwnedLabPremiumVmCount
          value: UserOwnedLabPremiumVmCount
        - name: LabVmCount
          value: LabVmCount
        - name: LabPremiumVmCount
          value: LabPremiumVmCount
        - name: LabVmSize
          value: LabVmSize
        - name: GalleryImage
          value: GalleryImage
        - name: UserOwnedLabVmCountInSubnet
          value: UserOwnedLabVmCountInSubnet
        - name: LabTargetCost
          value: LabTargetCost
        - name: EnvironmentTemplate
          value: EnvironmentTemplate
        - name: ScheduleEditPermission
          value: ScheduleEditPermission
    Resource:
      type: object
      title: Resource
      description: Common fields that are returned in the response for all Azure Resource Manager resources
      properties:
        id:
          type: string
          description: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
          readOnly: true
        name:
          type: string
          description: The name of the resource
          readOnly: true
        type:
          type: string
          description: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
          readOnly: true
        systemData:
          $ref: '#/components/schemas/systemData'
          type: object
          description: Azure Resource Manager metadata containing createdBy and modifiedBy information.
          readOnly: true
      x-ms-azure-resource: true
    PolicyEvaluatorType:
      type: string
      description: The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
      enum:
      - AllowedValuesPolicy
      - MaxValuePolicy
      x-ms-enum:
        name: PolicyEvaluatorType
        modelAsString: true
        values:
        - name: AllowedValuesPolicy
          value: AllowedValuesPolicy
        - name: MaxValuePolicy
          value: MaxValuePolicy
    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.
    PolicyFragment:
      type: object
      description: A Policy.
      allOf:
      - $ref: '#/components/schemas/UpdateResource'
    PolicyList:
      type: object
      description: The response of a list operation.
      properties:
        value:
          type: array
          description: The Policy items on this page
          items:
            $ref: '#/components/schemas/Policy'
        nextLink:
          type: string
          format: uri
          description: The link to the next page of items
      required:
      - value
    Policy:
      type: object
      description: A Policy.
      properties:
        properties:
          $ref: '#/components/schemas/PolicyProperties'
          description: The properties of the resource.
          x-ms-client-flatten: true
        tags:
          type: object
          description: The tags of the resource.
          additionalProperties:
            type: string
        location:
          type: string
          description: The location of the resource.
          x-ms-mutability:
          - read
          - create
      required:
      - properties
      allOf:
      - $ref: '#/components/schemas/ProxyResource'
    UpdateResource:
      type: object
      description: Represents an update resource
      properties:
        tags:
          type: object
          description: The tags of the resource.
          additionalProperties:
            type: string
    PolicyStatus:
      type: string
      description: The status of the policy.
      enum:
      - Enabled
      - Disabled
      x-ms-enum:
        name: PolicyStatus
        modelAsString: true
        values:
        - name: Enabled
          value: Enabled
        - name: Disabled
          value: Disabled
    ProxyResource:
      type: object
      title: Proxy Resource
      description: The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location
      allOf:
      - $ref: '#/components/schemas/Resource'
  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.
x-provenance:
  method: harvested
  publisher: Azure DevTest Labs
  source: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/DTL.json
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)