Microsoft Azure Policies API

The Policies API from Microsoft Azure, for policies.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 5

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.DevTestLab/labs/{labName}/policysets/{policySetName}/policies List policies in a DevTest Labs policy set · Microsoft Azure Get Subscriptions Subscriptionid Resourcegroups… #
Ask an LLM
“What policies are applied to my DevTest Labs lab?”
“Can I filter or sort the policies in a lab's policy set?”
Tell an agent
List policies in policy set {policySetName} of lab {labName} in {resourceGroupName}, subscription {subscriptionId}.
Show the first {top} lab {labName} policies in set {policySetName} ordered by {orderby}.
GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name} Get a DevTest Labs policy · Microsoft Azure Get Subscriptions Subscriptionid Resourcegroups… #
Ask an LLM
“How do I check the threshold of a specific lab policy, like max VMs per user?”
“Is a particular DevTest Labs policy enabled?”
Tell an agent
Get policy {name} in set {policySetName} of lab {labName}, group {resourceGroupName}, subscription {subscriptionId}.
Show whether lab {labName} policy {name} is enabled and its threshold.
PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name} Create or replace a DevTest Labs policy · Microsoft Azure Put Subscriptions Subscriptionid Resourcegroups… #
Ask an LLM
“How do I cap the number of VMs each user can create in a lab?”
“Can I replace an existing lab policy with a new definition?”
Tell an agent
Create policy {name} in set {policySetName} of lab {labName} in {resourceGroupName}, subscription {subscriptionId}, with {properties}.
Replace lab {labName} policy {name} with a new threshold definition.
DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name} Delete a DevTest Labs policy · Microsoft Azure Delete Subscriptions Subscriptionid Resourcegroups… #
Ask an LLM
“How do I remove a restriction policy from my lab?”
“Can I delete one policy from a lab's policy set?”
Tell an agent destructive · confirm first
Delete policy {name} from set {policySetName} of lab {labName}, group {resourceGroupName}, subscription {subscriptionId}.
Remove the {name} policy from lab {labName}.
PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name} Update tags on a DevTest Labs policy · Microsoft Azure Patch Subscriptions Subscriptionid Resourcegroups… #
Ask an LLM
“Can I change anything besides tags when patching a lab policy?”
“How do I tag a DevTest Labs policy for cost tracking?”
Tell an agent
Set tags {tags} on policy {name} in set {policySetName} of lab {labName}, {resourceGroupName}, subscription {subscriptionId}.
Retag lab {labName} policy {name} with {tags}.

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-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. 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-policies-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: '2018-09-15'
  title: Microsoft Azure DevTestLabsClient Policies API
  description: The DevTest Labs Client.
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:
      tags:
      - Policies
      description: List policies in a given policy set.
      operationId: microsoftAzurePoliciesList
      parameters:
      - $ref: '#/components/parameters/subscriptionId'
      - $ref: '#/components/parameters/resourceGroupName'
      - name: labName
        in: path
        description: The name of the lab.
        required: true
        schema:
          type: string
      - name: policySetName
        in: path
        description: The name of the policy set.
        required: true
        schema:
          type: string
      - name: $expand
        in: query
        description: 'Specify the $expand query. Example: ''properties($select=description)'''
        schema:
          type: string
      - name: $filter
        in: query
        description: 'The filter to apply to the operation. Example: ''$filter=contains(name,''myName'')'
        schema:
          type: string
      - name: $top
        in: query
        description: 'The maximum number of resources to return from the operation. Example: ''$top=10'''
        schema:
          type: integer
          format: int32
      - name: $orderby
        in: query
        description: 'The ordering expression for the results, using OData notation. Example: ''$orderby=name desc'''
        schema:
          type: string
      - $ref: '#/components/parameters/api-version'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyList'
        default:
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudError'
      x-ms-pageable:
        nextLinkName: nextLink
      x-ms-odata: '#/definitions/Policy'
      x-ms-examples:
        Policies_List:
          $ref: ./examples/Policies_List.json
      summary: Microsoft Azure Get Subscriptions Subscriptionid Resourcegroups…
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}
  : get:
      tags:
      - Policies
      description: Get policy.
      operationId: microsoftAzurePoliciesGet
      parameters:
      - $ref: '#/components/parameters/subscriptionId'
      - $ref: '#/components/parameters/resourceGroupName'
      - name: labName
        in: path
        description: The name of the lab.
        required: true
        schema:
          type: string
      - name: policySetName
        in: path
        description: The name of the policy set.
        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)'''
        schema:
          type: string
      - $ref: '#/components/parameters/api-version'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
        default:
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudError'
      x-ms-examples:
        Policies_Get:
          $ref: ./examples/Policies_Get.json
      summary: Microsoft Azure Get Subscriptions Subscriptionid Resourcegroups…
    put:
      tags:
      - Policies
      description: Create or replace an existing policy.
      operationId: microsoftAzurePoliciesCreateorupdate
      parameters:
      - $ref: '#/components/parameters/subscriptionId'
      - $ref: '#/components/parameters/resourceGroupName'
      - name: labName
        in: path
        description: The name of the lab.
        required: true
        schema:
          type: string
      - name: policySetName
        in: path
        description: The name of the policy set.
        required: true
        schema:
          type: string
      - name: name
        in: path
        description: The name of the policy.
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/api-version'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
        default:
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudError'
      x-ms-examples:
        Policies_CreateOrUpdate:
          $ref: ./examples/Policies_CreateOrUpdate.json
      summary: Microsoft Azure Put Subscriptions Subscriptionid Resourcegroups…
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Policy'
        description: A Policy.
        required: true
    delete:
      tags:
      - Policies
      description: Delete policy.
      operationId: microsoftAzurePoliciesDelete
      parameters:
      - $ref: '#/components/parameters/subscriptionId'
      - $ref: '#/components/parameters/resourceGroupName'
      - name: labName
        in: path
        description: The name of the lab.
        required: true
        schema:
          type: string
      - name: policySetName
        in: path
        description: The name of the policy set.
        required: true
        schema:
          type: string
      - name: name
        in: path
        description: The name of the policy.
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/api-version'
      responses:
        '200':
          description: OK
        '204':
          description: No Content
        default:
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudError'
      x-ms-examples:
        Policies_Delete:
          $ref: ./examples/Policies_Delete.json
      summary: Microsoft Azure Delete Subscriptions Subscriptionid Resourcegroups…
    patch:
      tags:
      - Policies
      description: Allows modifying tags of policies. All other properties will be ignored.
      operationId: microsoftAzurePoliciesUpdate
      parameters:
      - $ref: '#/components/parameters/subscriptionId'
      - $ref: '#/components/parameters/resourceGroupName'
      - name: labName
        in: path
        description: The name of the lab.
        required: true
        schema:
          type: string
      - name: policySetName
        in: path
        description: The name of the policy set.
        required: true
        schema:
          type: string
      - name: name
        in: path
        description: The name of the policy.
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/api-version'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
        default:
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudError'
      x-ms-examples:
        Policies_Update:
          $ref: ./examples/Policies_Update.json
      summary: Microsoft Azure Patch Subscriptions Subscriptionid Resourcegroups…
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyFragment'
        description: A Policy.
        required: true
components:
  parameters:
    subscriptionId:
      name: subscriptionId
      in: path
      description: The subscription ID.
      required: true
      schema:
        type: string
    api-version:
      name: api-version
      in: query
      description: Client API version.
      required: true
      schema:
        type: string
        default: '2018-09-15'
    resourceGroupName:
      name: resourceGroupName
      in: path
      description: The name of the resource group.
      required: true
      x-ms-parameter-location: method
      schema:
        type: string
  schemas:
    PolicyList:
      description: The response of a list operation.
      type: object
      properties:
        value:
          description: Results of the list operation.
          type: array
          items:
            $ref: '#/components/schemas/Policy'
        nextLink:
          description: Link for next set of results.
          type: string
    UpdateResource:
      description: Represents an update resource
      type: object
      properties:
        tags:
          description: The tags of the resource.
          type: object
          additionalProperties:
            type: string
    CloudErrorBody:
      description: Body of an error from a REST request.
      type: object
      properties:
        code:
          description: The error code.
          type: string
        message:
          description: The error message.
          type: string
        target:
          description: The error target.
          type: string
        details:
          description: Inner errors.
          type: array
          items:
            $ref: '#/components/schemas/CloudErrorBody'
      x-ms-external: true
    Policy:
      description: A Policy.
      required:
      - properties
      type: object
      allOf:
      - $ref: '#/components/schemas/Resource'
      properties:
        properties:
          $ref: '#/components/schemas/PolicyProperties'
          description: The properties of the resource.
          x-ms-client-flatten: true
    CloudError:
      description: Error from a REST request.
      type: object
      properties:
        error:
          $ref: '#/components/schemas/CloudErrorBody'
          description: The cloud error that occurred
      x-ms-external: true
    PolicyProperties:
      description: Properties of a Policy.
      type: object
      properties:
        description:
          description: The description of the policy.
          type: string
        status:
          description: The status of the policy.
          enum:
          - Enabled
          - Disabled
          type: string
          x-ms-enum:
            name: PolicyStatus
            modelAsString: true
        factName:
          description: The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.
          enum:
          - UserOwnedLabVmCount
          - UserOwnedLabPremiumVmCount
          - LabVmCount
          - LabPremiumVmCount
          - LabVmSize
          - GalleryImage
          - UserOwnedLabVmCountInSubnet
          - LabTargetCost
          - EnvironmentTemplate
          - ScheduleEditPermission
          type: string
          x-ms-enum:
            name: PolicyFactName
            modelAsString: true
        factData:
          description: The fact data of the policy.
          type: string
        threshold:
          description: The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy).
          type: string
        evaluatorType:
          description: The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
          enum:
          - AllowedValuesPolicy
          - MaxValuePolicy
          type: string
          x-ms-enum:
            name: PolicyEvaluatorType
            modelAsString: true
        createdDate:
          format: date-time
          description: The creation date of the policy.
          type: string
          readOnly: true
        provisioningState:
          description: The provisioning status of the resource.
          type: string
          readOnly: true
        uniqueIdentifier:
          description: The unique immutable identifier of a resource (Guid).
          type: string
          readOnly: true
    PolicyFragment:
      description: A Policy.
      type: object
      allOf:
      - $ref: '#/components/schemas/UpdateResource'
      properties: {}
    Resource:
      description: An Azure resource.
      type: object
      properties:
        id:
          description: The identifier of the resource.
          type: string
          readOnly: true
        name:
          description: The name of the resource.
          type: string
          readOnly: true
        type:
          description: The type of the resource.
          type: string
          readOnly: true
        location:
          description: The location of the resource.
          type: string
        tags:
          description: The tags of the resource.
          type: object
          additionalProperties:
            type: string
      x-ms-azure-resource: true
  securitySchemes:
    azure_auth:
      type: oauth2
      flows:
        implicit:
          scopes:
            user_impersonation: Access Microsoft Azure
          authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
      description: OAuth2 Implicit Grant
x-provenance:
  method: harvested
  publisher: Microsoft Azure
  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)