Microsoft.ApiManagement 서비스/진단 2024-05-01

Bicep 리소스 정의

다음을 대상으로 하는 작업을 사용하여 서비스/진단 리소스 유형을 배포할 수 있습니다.

각 API 버전에서 변경된 속성 목록은 변경 로그참조하세요.

사용 예제

Bicep 샘플

API Management 서비스 진단 배포의 기본 예제입니다.

param location string = 'westeurope'
param resourceName string = 'acctest0001'

resource component 'Microsoft.Insights/components@2020-02-02' = {
  name: resourceName
  location: location
  kind: 'web'
  properties: {
    Application_Type: 'web'
    DisableIpMasking: false
    DisableLocalAuth: false
    ForceCustomerStorageForProfiler: false
    RetentionInDays: 90
    SamplingPercentage: 100
    publicNetworkAccessForIngestion: 'Enabled'
    publicNetworkAccessForQuery: 'Enabled'
  }
}

resource service 'Microsoft.ApiManagement/service@2021-08-01' = {
  name: resourceName
  location: location
  sku: {
    capacity: 0
    name: 'Consumption'
  }
  properties: {
    certificates: []
    customProperties: {
      'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30': 'false'
      'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10': 'false'
      'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11': 'false'
      'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10': 'false'
      'Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11': 'false'
    }
    disableGateway: false
    publicNetworkAccess: 'Enabled'
    publisherEmail: 'pub1@email.com'
    publisherName: 'pub1'
    virtualNetworkType: 'None'
  }
}

resource diagnostic 'Microsoft.ApiManagement/service/diagnostics@2021-08-01' = {
  name: 'applicationinsights'
  parent: service
  properties: {
    loggerId: logger.id
    operationNameFormat: 'Name'
  }
}

resource logger 'Microsoft.ApiManagement/service/loggers@2021-08-01' = {
  name: resourceName
  parent: service
  properties: {
    credentials: {
      instrumentationKey: component.properties.InstrumentationKey
    }
    description: ''
    isBuffered: true
    loggerType: 'applicationInsights'
  }
}

Azure 확인된 모듈

다음 Azure 확인된 모듈 사용하여 이 리소스 유형을 배포할 수 있습니다.

Module 묘사
API 관리 서비스 - 진단 API 관리 서비스용 AVM 자식 모듈 - 진단

Azure 빠른 시작 샘플

다음 Azure 빠른 시작 템플릿에는 이 리소스 유형을 배포하기 위한 Bicep 샘플이 포함되어 있습니다.

Bicep 파일 묘사
내부 API Management 및 Web App 사용하여 Application Gateway Azure Web App에서 호스트되는 웹 API를 서비스하는 가상 네트워크(내부 모드) API Management 인스턴스로 인터넷 트래픽을 라우팅하는 Application Gateway입니다.
App Gateway 사용하여 내부 VNet에서 API Management 만들기 이 템플릿은 Azure Application Gateway로 보호되는 프라이빗 네트워크에서 Azure API Management 인스턴스를 만드는 방법을 보여 줍니다.

리소스 형식

Microsoft.ApiManagement/service/diagnostics 리소스를 만들려면 템플릿에 다음 Bicep을 추가합니다.

resource symbolicname 'Microsoft.ApiManagement/service/diagnostics@2024-05-01' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    alwaysLog: 'string'
    backend: {
      request: {
        body: {
          bytes: int
        }
        dataMasking: {
          headers: [
            {
              mode: 'string'
              value: 'string'
            }
          ]
          queryParams: [
            {
              mode: 'string'
              value: 'string'
            }
          ]
        }
        headers: [
          'string'
        ]
      }
      response: {
        body: {
          bytes: int
        }
        dataMasking: {
          headers: [
            {
              mode: 'string'
              value: 'string'
            }
          ]
          queryParams: [
            {
              mode: 'string'
              value: 'string'
            }
          ]
        }
        headers: [
          'string'
        ]
      }
    }
    frontend: {
      request: {
        body: {
          bytes: int
        }
        dataMasking: {
          headers: [
            {
              mode: 'string'
              value: 'string'
            }
          ]
          queryParams: [
            {
              mode: 'string'
              value: 'string'
            }
          ]
        }
        headers: [
          'string'
        ]
      }
      response: {
        body: {
          bytes: int
        }
        dataMasking: {
          headers: [
            {
              mode: 'string'
              value: 'string'
            }
          ]
          queryParams: [
            {
              mode: 'string'
              value: 'string'
            }
          ]
        }
        headers: [
          'string'
        ]
      }
    }
    httpCorrelationProtocol: 'string'
    logClientIp: bool
    loggerId: 'string'
    metrics: bool
    operationNameFormat: 'string'
    sampling: {
      percentage: int
      samplingType: 'string'
    }
    verbosity: 'string'
  }
}

속성 값

Microsoft.ApiManagement/서비스/진단

이름 묘사 값
이름 리소스 이름 문자열

제약 조건:
최소 길이 = 1
최대 길이 = 80
패턴 = ^[^*#&+:<>?]+$(필수)
부모 Bicep에서 자식 리소스에 대한 부모 리소스를 지정할 수 있습니다. 자식 리소스가 부모 리소스 외부에서 선언된 경우에만 이 속성을 추가해야 합니다.

자세한 내용은 부모 리소스외부의 자식 리소스 참조하세요.
형식의 리소스에 대한 기호 이름: 서비스
속성 진단 엔터티 계약 속성입니다. DiagnosticContractProperties

신체진단설정

이름 묘사 값
바이트 기록할 요청 본문 바이트 수입니다. 정수

제약 조건:
최대값 = 8192

데이터마스킹

이름 묘사 값
헤더 헤더에 대한 마스킹 설정 dataMaskingEntity[]
쿼리 매개변수 Url 쿼리 매개 변수에 대한 마스킹 설정 dataMaskingEntity[]

DataMaskingEntity (데이터 마스킹 엔티티)

이름 묘사 값
모드 데이터 마스킹 모드입니다. '숨기기'
'마스크'
값 마스킹할 엔터티의 이름(예: 헤더 또는 쿼리 매개 변수의 이름)입니다. 문자열

DiagnosticContractProperties

이름 묘사 값
항상로그 적용할 메시지 샘플링 설정 유형을 지정합니다. '모든 오류'
백 엔드 백 엔드로 들어오는/나가는 HTTP 메시지에 대한 진단 설정 파이프라인진단 설정
프런트 엔드 게이트웨이로 들어오는/나가는 HTTP 메시지에 대한 진단 설정입니다. 파이프라인진단 설정
http상관관계 프로토콜 Application Insights 진단에 사용할 상관 관계 프로토콜을 설정합니다. '레거시'
'없음'
'W3C'
로그 클라이언트 IP ClientIP를 기록합니다. 기본값은 false입니다. bool
로거 ID 대상 로거의 리소스 ID입니다. string(필수)
운율학 메트릭 내보내기 정책을 통해 사용자 지정 메트릭을 내보낸다. Application Insights 진단 설정에만 적용됩니다. bool
operationNameFormat Application Insights 원격 분석에 대한 작업 이름의 형식입니다. 기본값은 Name입니다. '이름'
'url'
견본 추출 진단에 대한 샘플링 설정입니다. 샘플링설정
자세한 정보 표시 추적 정책에서 내보낸 추적에 적용되는 세부 정보 수준입니다. '오류'
'정보'
'자세한 정보 표시'

HttpMessage진단

이름 묘사 값
몸 본문 로깅 설정입니다. 신체진단설정
data마스킹 데이터 마스킹 설정입니다. 데이터마스킹
헤더 기록할 HTTP 헤더의 배열입니다. 문자열[]

파이프라인진단 설정

이름 묘사 값
요청 요청에 대한 진단 설정입니다. HttpMessage진단
응답 응답에 대한 진단 설정입니다. HttpMessage진단

샘플링설정

이름 묘사 값
백분율 고정 비율 샘플링에 대한 샘플링 비율입니다. 정수

제약 조건:
최소값 = 0
최대값 = 100
샘플링 유형 샘플링 유형입니다. '고정됨'

ARM 템플릿 리소스 정의

다음을 대상으로 하는 작업을 사용하여 서비스/진단 리소스 유형을 배포할 수 있습니다.

사용 예제

Azure 빠른 시작 템플릿

다음 Azure 빠른 시작 템플릿은 이 리소스 유형을 배포할 있습니다.

템플렛 묘사
내부 API Management 및 Web App 사용하여 Application Gateway

Azure
배포
Azure Web App에서 호스트되는 웹 API를 서비스하는 가상 네트워크(내부 모드) API Management 인스턴스로 인터넷 트래픽을 라우팅하는 Application Gateway입니다.
App Gateway 사용하여 내부 VNet에서 API Management 만들기

Azure 배포
이 템플릿은 Azure Application Gateway로 보호되는 프라이빗 네트워크에서 Azure API Management 인스턴스를 만드는 방법을 보여 줍니다.

리소스 형식

Microsoft.ApiManagement/service/diagnostics 리소스를 만들려면 템플릿에 다음 JSON을 추가합니다.

{
  "type": "Microsoft.ApiManagement/service/diagnostics",
  "apiVersion": "2024-05-01",
  "name": "string",
  "properties": {
    "alwaysLog": "string",
    "backend": {
      "request": {
        "body": {
          "bytes": "int"
        },
        "dataMasking": {
          "headers": [
            {
              "mode": "string",
              "value": "string"
            }
          ],
          "queryParams": [
            {
              "mode": "string",
              "value": "string"
            }
          ]
        },
        "headers": [ "string" ]
      },
      "response": {
        "body": {
          "bytes": "int"
        },
        "dataMasking": {
          "headers": [
            {
              "mode": "string",
              "value": "string"
            }
          ],
          "queryParams": [
            {
              "mode": "string",
              "value": "string"
            }
          ]
        },
        "headers": [ "string" ]
      }
    },
    "frontend": {
      "request": {
        "body": {
          "bytes": "int"
        },
        "dataMasking": {
          "headers": [
            {
              "mode": "string",
              "value": "string"
            }
          ],
          "queryParams": [
            {
              "mode": "string",
              "value": "string"
            }
          ]
        },
        "headers": [ "string" ]
      },
      "response": {
        "body": {
          "bytes": "int"
        },
        "dataMasking": {
          "headers": [
            {
              "mode": "string",
              "value": "string"
            }
          ],
          "queryParams": [
            {
              "mode": "string",
              "value": "string"
            }
          ]
        },
        "headers": [ "string" ]
      }
    },
    "httpCorrelationProtocol": "string",
    "logClientIp": "bool",
    "loggerId": "string",
    "metrics": "bool",
    "operationNameFormat": "string",
    "sampling": {
      "percentage": "int",
      "samplingType": "string"
    },
    "verbosity": "string"
  }
}

속성 값

Microsoft.ApiManagement/서비스/진단

이름 묘사 값
API버전 api 버전 '2024-05-01'
이름 리소스 이름 문자열

제약 조건:
최소 길이 = 1
최대 길이 = 80
패턴 = ^[^*#&+:<>?]+$(필수)
속성 진단 엔터티 계약 속성입니다. DiagnosticContractProperties
형 리소스 종류 'Microsoft.ApiManagement/서비스/진단'

신체진단설정

이름 묘사 값
바이트 기록할 요청 본문 바이트 수입니다. 정수

제약 조건:
최대값 = 8192

데이터마스킹

이름 묘사 값
헤더 헤더에 대한 마스킹 설정 dataMaskingEntity[]
쿼리 매개변수 Url 쿼리 매개 변수에 대한 마스킹 설정 dataMaskingEntity[]

DataMaskingEntity (데이터 마스킹 엔티티)

이름 묘사 값
모드 데이터 마스킹 모드입니다. '숨기기'
'마스크'
값 마스킹할 엔터티의 이름(예: 헤더 또는 쿼리 매개 변수의 이름)입니다. 문자열

DiagnosticContractProperties

이름 묘사 값
항상로그 적용할 메시지 샘플링 설정 유형을 지정합니다. '모든 오류'
백 엔드 백 엔드로 들어오는/나가는 HTTP 메시지에 대한 진단 설정 파이프라인진단 설정
프런트 엔드 게이트웨이로 들어오는/나가는 HTTP 메시지에 대한 진단 설정입니다. 파이프라인진단 설정
http상관관계 프로토콜 Application Insights 진단에 사용할 상관 관계 프로토콜을 설정합니다. '레거시'
'없음'
'W3C'
로그 클라이언트 IP ClientIP를 기록합니다. 기본값은 false입니다. bool
로거 ID 대상 로거의 리소스 ID입니다. string(필수)
운율학 메트릭 내보내기 정책을 통해 사용자 지정 메트릭을 내보낸다. Application Insights 진단 설정에만 적용됩니다. bool
operationNameFormat Application Insights 원격 분석에 대한 작업 이름의 형식입니다. 기본값은 Name입니다. '이름'
'url'
견본 추출 진단에 대한 샘플링 설정입니다. 샘플링설정
자세한 정보 표시 추적 정책에서 내보낸 추적에 적용되는 세부 정보 수준입니다. '오류'
'정보'
'자세한 정보 표시'

HttpMessage진단

이름 묘사 값
몸 본문 로깅 설정입니다. 신체진단설정
data마스킹 데이터 마스킹 설정입니다. 데이터마스킹
헤더 기록할 HTTP 헤더의 배열입니다. 문자열[]

파이프라인진단 설정

이름 묘사 값
요청 요청에 대한 진단 설정입니다. HttpMessage진단
응답 응답에 대한 진단 설정입니다. HttpMessage진단

샘플링설정

이름 묘사 값
백분율 고정 비율 샘플링에 대한 샘플링 비율입니다. 정수

제약 조건:
최소값 = 0
최대값 = 100
샘플링 유형 샘플링 유형입니다. '고정됨'

Terraform(AzAPI 공급자) 리소스 정의

다음을 대상으로 하는 작업을 사용하여 서비스/진단 리소스 유형을 배포할 수 있습니다.

  • 자원 그룹 각 API 버전에서 변경된 속성 목록은 변경 로그를 참조하세요.

사용 예제

Terraform 샘플

API Management 서비스 진단 배포의 기본 예제입니다.

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westeurope"
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "component" {
  type      = "Microsoft.Insights/components@2020-02-02"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    kind = "web"
    properties = {
      Application_Type                = "web"
      DisableIpMasking                = false
      DisableLocalAuth                = false
      ForceCustomerStorageForProfiler = false
      RetentionInDays                 = 90
      SamplingPercentage              = 100
      publicNetworkAccessForIngestion = "Enabled"
      publicNetworkAccessForQuery     = "Enabled"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "service" {
  type      = "Microsoft.ApiManagement/service@2021-08-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      certificates = [
      ]
      customProperties = {
        "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30" = "false"
        "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10" = "false"
        "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11" = "false"
        "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10"         = "false"
        "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11"         = "false"
      }
      disableGateway      = false
      publicNetworkAccess = "Enabled"
      publisherEmail      = "pub1@email.com"
      publisherName       = "pub1"
      virtualNetworkType  = "None"
    }
    sku = {
      capacity = 0
      name     = "Consumption"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "logger" {
  type      = "Microsoft.ApiManagement/service/loggers@2021-08-01"
  parent_id = azapi_resource.service.id
  name      = var.resource_name
  body = {
    properties = {
      credentials = {
        instrumentationKey = azapi_resource.component.output.properties.InstrumentationKey
      }
      description = ""
      isBuffered  = true
      loggerType  = "applicationInsights"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
  lifecycle {
    ignore_changes = [body.properties.credentials.instrumentationKey]
  }
}

resource "azapi_resource" "diagnostic" {
  type      = "Microsoft.ApiManagement/service/diagnostics@2021-08-01"
  parent_id = azapi_resource.service.id
  name      = "applicationinsights"
  body = {
    properties = {
      loggerId            = azapi_resource.logger.id
      operationNameFormat = "Name"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

리소스 형식

Microsoft.ApiManagement/service/diagnostics 리소스를 만들려면 템플릿에 다음 Terraform을 추가합니다.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.ApiManagement/service/diagnostics@2024-05-01"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      alwaysLog = "string"
      backend = {
        request = {
          body = {
            bytes = int
          }
          dataMasking = {
            headers = [
              {
                mode = "string"
                value = "string"
              }
            ]
            queryParams = [
              {
                mode = "string"
                value = "string"
              }
            ]
          }
          headers = [
            "string"
          ]
        }
        response = {
          body = {
            bytes = int
          }
          dataMasking = {
            headers = [
              {
                mode = "string"
                value = "string"
              }
            ]
            queryParams = [
              {
                mode = "string"
                value = "string"
              }
            ]
          }
          headers = [
            "string"
          ]
        }
      }
      frontend = {
        request = {
          body = {
            bytes = int
          }
          dataMasking = {
            headers = [
              {
                mode = "string"
                value = "string"
              }
            ]
            queryParams = [
              {
                mode = "string"
                value = "string"
              }
            ]
          }
          headers = [
            "string"
          ]
        }
        response = {
          body = {
            bytes = int
          }
          dataMasking = {
            headers = [
              {
                mode = "string"
                value = "string"
              }
            ]
            queryParams = [
              {
                mode = "string"
                value = "string"
              }
            ]
          }
          headers = [
            "string"
          ]
        }
      }
      httpCorrelationProtocol = "string"
      logClientIp = bool
      loggerId = "string"
      metrics = bool
      operationNameFormat = "string"
      sampling = {
        percentage = int
        samplingType = "string"
      }
      verbosity = "string"
    }
  }
}

속성 값

Microsoft.ApiManagement/서비스/진단

이름 묘사 값
이름 리소스 이름 문자열

제약 조건:
최소 길이 = 1
최대 길이 = 80
패턴 = ^[^*#&+:<>?]+$(필수)
부모 ID 이 리소스의 부모인 리소스의 ID입니다. 유형의 리소스에 대한 ID: 서비스
속성 진단 엔터티 계약 속성입니다. DiagnosticContractProperties
형 리소스 종류 "Microsoft.ApiManagement/서비스/diagnostics@2024-05-01"

신체진단설정

이름 묘사 값
바이트 기록할 요청 본문 바이트 수입니다. 정수

제약 조건:
최대값 = 8192

데이터마스킹

이름 묘사 값
헤더 헤더에 대한 마스킹 설정 dataMaskingEntity[]
쿼리 매개변수 Url 쿼리 매개 변수에 대한 마스킹 설정 dataMaskingEntity[]

DataMaskingEntity (데이터 마스킹 엔티티)

이름 묘사 값
모드 데이터 마스킹 모드입니다. '숨기기'
'마스크'
값 마스킹할 엔터티의 이름(예: 헤더 또는 쿼리 매개 변수의 이름)입니다. 문자열

DiagnosticContractProperties

이름 묘사 값
항상로그 적용할 메시지 샘플링 설정 유형을 지정합니다. '모든 오류'
백 엔드 백 엔드로 들어오는/나가는 HTTP 메시지에 대한 진단 설정 파이프라인진단 설정
프런트 엔드 게이트웨이로 들어오는/나가는 HTTP 메시지에 대한 진단 설정입니다. 파이프라인진단 설정
http상관관계 프로토콜 Application Insights 진단에 사용할 상관 관계 프로토콜을 설정합니다. '레거시'
'없음'
'W3C'
로그 클라이언트 IP ClientIP를 기록합니다. 기본값은 false입니다. bool
로거 ID 대상 로거의 리소스 ID입니다. string(필수)
운율학 메트릭 내보내기 정책을 통해 사용자 지정 메트릭을 내보낸다. Application Insights 진단 설정에만 적용됩니다. bool
operationNameFormat Application Insights 원격 분석에 대한 작업 이름의 형식입니다. 기본값은 Name입니다. '이름'
'url'
견본 추출 진단에 대한 샘플링 설정입니다. 샘플링설정
자세한 정보 표시 추적 정책에서 내보낸 추적에 적용되는 세부 정보 수준입니다. '오류'
'정보'
'자세한 정보 표시'

HttpMessage진단

이름 묘사 값
몸 본문 로깅 설정입니다. 신체진단설정
data마스킹 데이터 마스킹 설정입니다. 데이터마스킹
헤더 기록할 HTTP 헤더의 배열입니다. 문자열[]

파이프라인진단 설정

이름 묘사 값
요청 요청에 대한 진단 설정입니다. HttpMessage진단
응답 응답에 대한 진단 설정입니다. HttpMessage진단

샘플링설정

이름 묘사 값
백분율 고정 비율 샘플링에 대한 샘플링 비율입니다. 정수

제약 조건:
최소값 = 0
최대값 = 100
샘플링 유형 샘플링 유형입니다. '고정됨'