Azure Monitor Data Collection Rules API

Operations for managing data collection rules

Documentation

📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/metrics
📖
Authentication
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/rest-api-walkthrough
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/rest-api-walkthrough
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/metric-definitions
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/metrics-batch
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/loganalytics/
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/api/overview
📖
Documentation
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/logs-ingestion-api-overview
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/tutorial-logs-ingestion-api
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/alertrules
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/scheduledqueryrule-2021-08-01/scheduled-query-rules
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/action-groups
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/autoscale-settings
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/autoscale/autoscale-best-practices
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/application-insights/
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-enable
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/diagnostic-settings
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/activity-logs
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/data-collection-rules
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/data-collection/data-collection-rule-create-edit
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/data-collection-endpoints
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/data-collection/data-collection-endpoint-overview
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/private-link-scopes
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/private-link-configure

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

microsoft-azure-monitor-data-collection-rules-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Azure Monitor Action Groups Data Collection Rules API
  description: Create and manage action groups that define notification and automation actions triggered by Azure Monitor alerts, including email, SMS, webhooks, and Azure Functions.
  version: '2022-06-01'
  contact:
    name: Microsoft Azure Support
    url: https://azure.microsoft.com/en-us/support/options/
  license:
    name: Microsoft API License
    url: https://azure.microsoft.com/en-us/support/legal/
servers:
- url: https://management.azure.com
  description: Azure Resource Manager
security:
- oauth2:
  - https://management.azure.com/.default
tags:
- name: Data Collection Rules
  description: Operations for managing data collection rules
paths:
  /subscriptions/{subscriptionId}/providers/Microsoft.Insights/dataCollectionRules:
    get:
      operationId: DataCollectionRules_ListBySubscription
      summary: Azure Monitor List data collection rules in a subscription
      description: Lists all data collection rules in the specified subscription.
      tags:
      - Data Collection Rules
      parameters:
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '200':
          description: Successful request to list data collection rules.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataCollectionRuleResourceListResult'
        default:
          description: Error response describing why the operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules:
    get:
      operationId: DataCollectionRules_ListByResourceGroup
      summary: Azure Monitor List data collection rules in a resource group
      description: Lists all data collection rules in the specified resource group.
      tags:
      - Data Collection Rules
      parameters:
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '200':
          description: Successful request to list data collection rules.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataCollectionRuleResourceListResult'
        default:
          description: Error response describing why the operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}
  : get:
      operationId: DataCollectionRules_Get
      summary: Azure Monitor Get a data collection rule
      description: Returns the specified data collection rule.
      tags:
      - Data Collection Rules
      parameters:
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - $ref: '#/components/parameters/DataCollectionRuleNameParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '200':
          description: Successful request to get a data collection rule.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataCollectionRuleResource'
        default:
          description: Error response describing why the operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    put:
      operationId: DataCollectionRules_Create
      summary: Azure Monitor Create or update a data collection rule
      description: Creates or updates a data collection rule. Data collection rules define the data sources, transformations, and destinations for data collection in Azure Monitor.
      tags:
      - Data Collection Rules
      parameters:
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - $ref: '#/components/parameters/DataCollectionRuleNameParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      requestBody:
        description: The data collection rule to create or update.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataCollectionRuleResource'
      responses:
        '200':
          description: Successfully updated the data collection rule.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataCollectionRuleResource'
        '201':
          description: Successfully created the data collection rule.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataCollectionRuleResource'
        default:
          description: Error response describing why the operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    patch:
      operationId: DataCollectionRules_Update
      summary: Azure Monitor Update a data collection rule
      description: Updates part of a data collection rule. Only tags and identity can be updated via PATCH.
      tags:
      - Data Collection Rules
      parameters:
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - $ref: '#/components/parameters/DataCollectionRuleNameParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      requestBody:
        description: The data collection rule properties to update.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceForUpdate'
      responses:
        '200':
          description: Successfully updated the data collection rule.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataCollectionRuleResource'
        default:
          description: Error response describing why the operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    delete:
      operationId: DataCollectionRules_Delete
      summary: Azure Monitor Delete a data collection rule
      description: Deletes a data collection rule.
      tags:
      - Data Collection Rules
      parameters:
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - $ref: '#/components/parameters/DataCollectionRuleNameParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '200':
          description: Successfully deleted the data collection rule.
        '204':
          description: The data collection rule did not exist.
        default:
          description: Error response describing why the operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    ApiVersionParameter:
      name: api-version
      in: query
      required: true
      description: The API version to use for this operation.
      schema:
        type: string
        default: '2023-03-11'
    DataCollectionRuleNameParameter:
      name: dataCollectionRuleName
      in: path
      required: true
      description: The name of the data collection rule.
      schema:
        type: string
    ResourceGroupNameParameter:
      name: resourceGroupName
      in: path
      required: true
      description: The name of the resource group.
      schema:
        type: string
    SubscriptionIdParameter:
      name: subscriptionId
      in: path
      required: true
      description: The ID of the target subscription.
      schema:
        type: string
  schemas:
    DataCollectionRuleResource:
      type: object
      required:
      - location
      properties:
        id:
          type: string
          readOnly: true
          description: Fully qualified resource ID.
        name:
          type: string
          readOnly: true
          description: The name of the resource.
        type:
          type: string
          readOnly: true
          description: The type of the resource.
        location:
          type: string
          description: The geo-location where the resource lives.
        tags:
          type: object
          additionalProperties:
            type: string
          description: Resource tags.
        kind:
          type: string
          enum:
          - Linux
          - Windows
          description: The kind of the resource.
        identity:
          $ref: '#/components/schemas/ManagedServiceIdentity'
        properties:
          $ref: '#/components/schemas/DataCollectionRule'
        systemData:
          $ref: '#/components/schemas/SystemData'
    DataSources:
      type: object
      properties:
        performanceCounters:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: A friendly name for the data source.
              streams:
                type: array
                items:
                  type: string
              samplingFrequencyInSeconds:
                type: integer
                description: The number of seconds between consecutive counter measurements.
              counterSpecifiers:
                type: array
                items:
                  type: string
                description: A list of specifier names of the performance counters.
          description: The list of performance counter data sources.
        windowsEventLogs:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              streams:
                type: array
                items:
                  type: string
              xPathQueries:
                type: array
                items:
                  type: string
          description: The list of Windows Event Log data sources.
        syslog:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              streams:
                type: array
                items:
                  type: string
              facilityNames:
                type: array
                items:
                  type: string
              logLevels:
                type: array
                items:
                  type: string
          description: The list of Syslog data sources.
        extensions:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              streams:
                type: array
                items:
                  type: string
              extensionName:
                type: string
              extensionSettings:
                type: object
                additionalProperties: true
              inputDataSources:
                type: array
                items:
                  type: string
          description: The list of Azure VM extension data sources.
        logFiles:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              streams:
                type: array
                items:
                  type: string
              filePatterns:
                type: array
                items:
                  type: string
              format:
                type: string
                enum:
                - text
              settings:
                type: object
                properties:
                  text:
                    type: object
                    properties:
                      recordStartTimestampFormat:
                        type: string
          description: The list of Log file data sources.
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code.
            message:
              type: string
              description: Error message.
            target:
              type: string
              description: The target of the error.
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  target:
                    type: string
    DataCollectionRule:
      type: object
      properties:
        description:
          type: string
          description: Description of the data collection rule.
        immutableId:
          type: string
          readOnly: true
          description: The immutable ID of this data collection rule.
        dataCollectionEndpointId:
          type: string
          description: The resource ID of the data collection endpoint.
        streamDeclarations:
          type: object
          additionalProperties:
            type: object
            properties:
              columns:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                      description: The name of the column.
                    type:
                      type: string
                      enum:
                      - string
                      - int
                      - long
                      - real
                      - boolean
                      - datetime
                      - dynamic
                      description: The type of the column data.
          description: Declaration of custom streams used in this rule.
        dataSources:
          $ref: '#/components/schemas/DataSources'
        destinations:
          $ref: '#/components/schemas/Destinations'
        dataFlows:
          type: array
          items:
            $ref: '#/components/schemas/DataFlow'
          description: The specification of data flows.
        provisioningState:
          type: string
          readOnly: true
          enum:
          - Creating
          - Updating
          - Deleting
          - Succeeded
          - Canceled
          - Failed
          description: The resource provisioning state.
    ResourceForUpdate:
      type: object
      properties:
        tags:
          type: object
          additionalProperties:
            type: string
          description: Resource tags.
        identity:
          $ref: '#/components/schemas/ManagedServiceIdentity'
    SystemData:
      type: object
      properties:
        createdBy:
          type: string
        createdByType:
          type: string
          enum:
          - User
          - Application
          - ManagedIdentity
          - Key
        createdAt:
          type: string
          format: date-time
        lastModifiedBy:
          type: string
        lastModifiedByType:
          type: string
          enum:
          - User
          - Application
          - ManagedIdentity
          - Key
        lastModifiedAt:
          type: string
          format: date-time
    ManagedServiceIdentity:
      type: object
      required:
      - type
      properties:
        type:
          type: string
          enum:
          - None
          - SystemAssigned
          - UserAssigned
          - SystemAssigned,UserAssigned
          description: Type of managed service identity.
        principalId:
          type: string
          readOnly: true
          description: The service principal ID of the system-assigned identity.
        tenantId:
          type: string
          readOnly: true
          description: The tenant ID of the system-assigned identity.
        userAssignedIdentities:
          type: object
          additionalProperties:
            type: object
            properties:
              principalId:
                type: string
                readOnly: true
              clientId:
                type: string
                readOnly: true
          description: The set of user-assigned identities.
    DataFlow:
      type: object
      properties:
        streams:
          type: array
          items:
            type: string
          description: List of streams for this data flow.
        destinations:
          type: array
          items:
            type: string
          description: List of destinations for this data flow.
        transformKql:
          type: string
          description: The KQL query to transform stream data.
        outputStream:
          type: string
          description: The output stream of the transform.
        builtInTransform:
          type: string
          description: The built-in transform to apply.
    DataCollectionRuleResourceListResult:
      type: object
      required:
      - value
      properties:
        value:
          type: array
          items:
            $ref: '#/components/schemas/DataCollectionRuleResource'
          description: A list of data collection rules.
        nextLink:
          type: string
          description: The URI to fetch the next page.
    Destinations:
      type: object
      properties:
        logAnalytics:
          type: array
          items:
            type: object
            properties:
              workspaceResourceId:
                type: string
                description: The resource ID of the Log Analytics workspace.
              workspaceId:
                type: string
                readOnly: true
                description: The workspace ID (GUID).
              name:
                type: string
                description: A friendly name for the destination.
          description: List of Log Analytics destinations.
        monitoringAccounts:
          type: array
          items:
            type: object
            properties:
              accountResourceId:
                type: string
              accountId:
                type: string
                readOnly: true
              name:
                type: string
          description: List of monitoring account destinations.
        azureMonitorMetrics:
          type: object
          properties:
            name:
              type: string
              description: A friendly name for the destination.
          description: Azure Monitor Metrics destination.
        eventHubs:
          type: array
          items:
            type: object
            properties:
              eventHubResourceId:
                type: string
              name:
                type: string
          description: List of Event Hub destinations.
        eventHubsDirect:
          type: array
          items:
            type: object
            properties:
              eventHubResourceId:
                type: string
              name:
                type: string
          description: List of direct Event Hub destinations.
        storageBlobsDirect:
          type: array
          items:
            type: object
            properties:
              storageAccountResourceId:
                type: string
              containerName:
                type: string
              name:
                type: string
          description: List of Storage Blob Direct destinations.
        storageTablesDirect:
          type: array
          items:
            type: object
            properties:
              storageAccountResourceId:
                type: string
              tableName:
                type: string
              name:
                type: string
          description: List of Storage Table Direct destinations.
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
          scopes:
            https://management.azure.com/.default: Access Azure Management API