Microsoft Azure Purview Devops Policies API Document

The Microsoft Azure Purview DevOps Policies REST API Document provides developers with a comprehensive guide to leveraging Azure Purview's policy management capabilities within a DevOps workflow. This document outlines the various REST API endpoints and operations available for interacting with Purview's policy engines, allowing developers to define, enforce, and monitor governance policies across their data assets.

OpenAPI Specification

purview-devops-policies-rest-api-document-openapi-original.yml Raw ↑
swagger: '2.0'
info:
  title: Microsoft Azure Purview devops policies REST API Document
  version: 2022-11-01-preview
paths:
  /devops-policies:
    get:
      tags:
        - DevopsPolicy
      description: List all devops policies.
      operationId: microsoftAzureDevopspolicyList
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/api-version'
      responses:
        '200':
          description: Success
          schema:
            $ref: '#/definitions/DevopsPolicyList'
        default:
          description: An error response received from the Policy Service
          schema:
            $ref: '#/definitions/ErrorResponseModel'
          headers:
            x-ms-error-code:
              type: string
              description: The error code
      x-ms-pageable:
        nextLinkName: nextLink
        itemName: value
      x-ms-examples:
        DevopsPolicy_List:
          $ref: ./examples/DevopsPolicy_List.json
      summary: Microsoft Azure Get Devops Policies
  /devops-policies/{purviewResourceName}/sql-security-auditor-roles:
    put:
      tags:
        - DevopsPolicy
      description: Create/replace sql security auditor devops policy
      operationId: microsoftAzureDevopssqlsecurityauditorpolicyCreateorreplace
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - in: path
          name: purviewResourceName
          description: Name of resource as registered on the Azure purview portal
          required: true
          type: string
        - in: header
          name: If-Match
          description: >-
            Http Etag value of a policy to be updated. Required only during the
            replace operation
          type: string
        - $ref: '#/parameters/api-version'
        - in: body
          name: body
          description: Devops policy object to create or update..
          required: true
          schema:
            $ref: '#/definitions/DevopsPolicy'
      responses:
        '200':
          description: Success
          schema:
            $ref: '#/definitions/DevopsPolicy'
          headers:
            ETag:
              description: An HTTP entity tag associated with the policy entity
              type: string
        '201':
          description: Created
          schema:
            $ref: '#/definitions/DevopsPolicy'
          headers:
            ETag:
              description: An HTTP entity tag associated with the policy entity
              type: string
        default:
          description: An error response received from the Policy Service
          schema:
            $ref: '#/definitions/ErrorResponseModel'
          headers:
            x-ms-error-code:
              type: string
              description: The error code
      x-ms-examples:
        DevopsSqlSecurityAuditorPolicy_CreateOrReplace:
          $ref: ./examples/DevopsSqlSecurityAuditorPolicy_CreateOrReplace.json
      summary: Microsoft Azure Put Devops Policies Purviewresourcename Sql Security Auditor Roles
    delete:
      tags:
        - DevopsPolicy
      description: Deletes a devops sql security auditor policy
      operationId: microsoftAzureDevopssqlsecurityauditorpolicyDelete
      parameters:
        - in: path
          name: purviewResourceName
          description: Name of resource as registered on the Azure purview portal
          required: true
          type: string
        - in: header
          name: If-Match
          description: Http Etag value of a policy to be deleted.
          required: true
          type: string
        - $ref: '#/parameters/api-version'
      responses:
        '204':
          description: No Content
        default:
          description: An error response received from the Policy Service
          schema:
            $ref: '#/definitions/ErrorResponseModel'
          headers:
            x-ms-error-code:
              type: string
              description: The error code
      x-ms-examples:
        DevopsSqlSecurityAuditorPolicy_Delete:
          $ref: ./examples/DevopsSqlSecurityAuditorPolicy_Delete.json
      summary: Microsoft Azure Delete Devops Policies Purviewresourcename Sql Security Auditor Roles
    get:
      tags:
        - DevopsPolicy
      description: Get devops sql security auditor policy
      operationId: microsoftAzureDevopssqlsecurityauditorpolicyGet
      produces:
        - application/json
      parameters:
        - in: path
          name: purviewResourceName
          description: Name of resource as registered on the Azure purview portal
          required: true
          type: string
        - $ref: '#/parameters/api-version'
      responses:
        '200':
          description: Success
          schema:
            $ref: '#/definitions/DevopsPolicy'
          headers:
            ETag:
              description: An HTTP entity tag associated with the policy entity
              type: string
        default:
          description: An error response received from the Policy Service
          schema:
            $ref: '#/definitions/ErrorResponseModel'
          headers:
            x-ms-error-code:
              type: string
              description: The error code
      x-ms-examples:
        DevopsSqlSecurityAuditorPolicy_Get:
          $ref: ./examples/DevopsSqlSecurityAuditorPolicy_Get.json
      summary: Microsoft Azure Get Devops Policies Purviewresourcename Sql Security Auditor Roles
  /devops-policies/{purviewResourceName}/sql-perf-monitor-roles:
    delete:
      tags:
        - DevopsPolicy
      description: Deletes a devops sql perf monitor policy
      operationId: microsoftAzureDevopssqlperfmonitorpolicyDelete
      parameters:
        - in: path
          name: purviewResourceName
          description: Name of resource as registered on the Azure purview portal
          required: true
          type: string
        - in: header
          name: If-Match
          description: Http Etag value of a policy to be deleted.
          required: true
          type: string
        - $ref: '#/parameters/api-version'
      responses:
        '204':
          description: No Content
        default:
          description: An error response received from the Policy Service
          schema:
            $ref: '#/definitions/ErrorResponseModel'
          headers:
            x-ms-error-code:
              type: string
              description: The error code
      x-ms-examples:
        DevopsSqlPerfMonitorPolicy_Delete:
          $ref: ./examples/DevopsSqlPerfMonitorPolicy_Delete.json
      summary: Microsoft Azure Delete Devops Policies Purviewresourcename Sql Perf Monitor Roles
    put:
      tags:
        - DevopsPolicy
      description: Create/replace devops sql perf monitor policy
      operationId: microsoftAzureDevopssqlperfmonitorpolicyCreateorreplace
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - in: path
          name: purviewResourceName
          description: Name of resource as registered on the Azure purview portal
          required: true
          type: string
        - in: header
          name: If-Match
          description: >-
            Etag value of a policy to be updated. Required only during the
            replace operation
          type: string
        - $ref: '#/parameters/api-version'
        - in: body
          name: body
          description: Devops policy object to create or update..
          required: true
          schema:
            $ref: '#/definitions/DevopsPolicy'
      responses:
        '200':
          description: Success
          schema:
            $ref: '#/definitions/DevopsPolicy'
          headers:
            ETag:
              description: An HTTP entity tag associated with the policy entity
              type: string
        '201':
          description: Created
          schema:
            $ref: '#/definitions/DevopsPolicy'
          headers:
            ETag:
              description: An HTTP entity tag associated with the policy entity
              type: string
        default:
          description: An error response received from the Policy Service
          schema:
            $ref: '#/definitions/ErrorResponseModel'
          headers:
            x-ms-error-code:
              type: string
              description: The error code
      x-ms-examples:
        DevopsSqlPerfMonitorPolicy_CreateOrReplace:
          $ref: ./examples/DevopsSqlPerfMonitorPolicy_CreateOrReplace.json
      summary: Microsoft Azure Put Devops Policies Purviewresourcename Sql Perf Monitor Roles
    get:
      tags:
        - DevopsPolicy
      description: Get devops sql perf monitor policy
      operationId: microsoftAzureDevopssqlperfmonitorpolicyGet
      produces:
        - application/json
      parameters:
        - in: path
          name: purviewResourceName
          description: Name of resource as registered on the Azure purview portal
          required: true
          type: string
        - $ref: '#/parameters/api-version'
      responses:
        '200':
          description: Success
          schema:
            $ref: '#/definitions/DevopsPolicy'
          headers:
            ETag:
              description: An HTTP entity tag associated with the policy entity
              type: string
        default:
          description: An error response received from the Policy Service
          schema:
            $ref: '#/definitions/ErrorResponseModel'
          headers:
            x-ms-error-code:
              type: string
              description: The error code
      x-ms-examples:
        DevopsSqlPerfMonitorPolicy_Get:
          $ref: ./examples/DevopsSqlPerfMonitorPolicy_Get.json
      summary: Microsoft Azure Get Devops Policies Purviewresourcename Sql Perf Monitor Roles
definitions:
  DevopsPolicyDecisionRule:
    type: object
    required:
      - effect
      - principals
      - principalGroups
    properties:
      effect:
        description: The effect for rule
        enum:
          - Permit
        type: string
        x-ms-enum:
          name: Decision
          modelAsString: true
      purviewRoleName:
        type: string
        description: This is field will indicate the role of a devops policy.
      principals:
        type: array
        description: Azure Active Directory Ids for users
        items:
          type: string
          description: Azure Active Directory Id
      principalGroups:
        type: array
        description: Azure Active Directory Ids for groups
        items:
          type: string
          description: Azure Active Directory Id
      resourceAzurePath:
        type: string
        description: Optional resource path of the azure resource
  ErrorModel:
    description: The error model for policy
    required:
      - code
      - message
    type: object
    properties:
      code:
        description: The error code
        minLength: 1
        type: string
      message:
        description: The error message
        minLength: 1
        type: string
      details:
        description: The error details
        type: array
        items:
          $ref: '#/definitions/ErrorModel'
  ErrorResponseModel:
    description: The error response model for policy
    required:
      - error
    type: object
    properties:
      error:
        $ref: '#/definitions/ErrorModel'
  DevopsPolicy:
    required:
      - decisionRules
      - purviewResourceName
    type: object
    properties:
      systemData:
        $ref: '#/definitions/SystemData'
      decisionRules:
        type: array
        description: Array of decisionRules for the policy
        items:
          $ref: '#/definitions/DevopsPolicyDecisionRule'
      purviewResourceName:
        type: string
        description: Purview resource name
  DevopsPolicyList:
    required:
      - value
    type: object
    properties:
      value:
        type: array
        description: List of policies
        items:
          $ref: '#/definitions/DevopsPolicy'
      nextLink:
        type: string
        description: Pagination link
  SystemData:
    type: object
    readOnly: true
    properties:
      createdBy:
        type: string
        description: Created by
      createdByType:
        type: string
        description: Created by type
      createdAt:
        format: date-time
        type: string
        description: Created at
      lastModifiedBy:
        type: string
        description: last modified by
      lastModifiedByType:
        type: string
        description: last modified by type
      lastModifiedAt:
        format: date-time
        type: string
        description: last modified at
parameters:
  api-version:
    in: query
    name: api-version
    description: The api version to use.
    required: true
    type: string
    x-ms-client-name: ApiVersion
    x-ms-parameter-location: method
  endpoint:
    in: path
    name: endpoint
    description: >-
      The endpoint of your Purview account. Example:
      https://{accountName}.purview.azure.com.
    required: true
    type: string
    format: url
    x-ms-parameter-location: client
    x-ms-skip-url-encoding: true
securityDefinitions:
  azure_auth:
    type: oauth2
    flow: implicit
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    scopes:
      user_impersonation: impersonate your user account
    description: Azure Active Directory OAuth2 Flow.
x-ms-parameterized-host:
  hostTemplate: '{endpoint}'
  useSchemePrefix: false
  parameters:
    - $ref: '#/parameters/endpoint'
basePath: /policyStore
security:
  - azure_auth:
      - user_impersonation
tags:
  - name: DevopsPolicy