Logger - Create Or Update

로거를 만들거나 업데이트합니다.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}?api-version=2022-08-01

URI 매개 변수

Name In(다음 안에) 필수 형식 Description
loggerId
path True

string

로거 식별자입니다. API Management 서비스 instance 고유해야 합니다.

Regex pattern: ^[^*#&+:<>?]+$

resourceGroupName
path True

string

리소스 그룹의 이름. 이름은 대소문자를 구분하지 않습니다.

serviceName
path True

string

API Management 서비스의 이름입니다.

Regex pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

subscriptionId
path True

string

대상 구독의 ID입니다.

api-version
query True

string

이 작업에 사용할 API 버전입니다.

요청 헤더

Name 필수 형식 Description
If-Match

string

엔터티의 ETag입니다. 엔터티를 만들 때는 필요하지 않지만 엔터티를 업데이트할 때 필요합니다.

요청 본문

Name 필수 형식 Description
properties.loggerType True

LoggerType

로거 형식입니다.

properties.credentials

object

azureEventHub 로거에 대한 이벤트 허브의 이름 및 SendRule 연결 문자열. applicationInsights 로거에 대한 계측 키입니다.

properties.description

string

로거 설명.

properties.isBuffered

boolean

게시하기 전에 로거에서 레코드가 버퍼링되는지 여부입니다. 기본값은 true로 간주됩니다.

properties.resourceId

string

로그 대상의 Azure 리소스 ID(Azure Event Hub 리소스 또는 Azure 애플리케이션 Insights 리소스)입니다.

응답

Name 형식 Description
200 OK

LoggerContract

기존 로거가 성공적으로 업데이트되었습니다.

Headers

ETag: string

201 Created

LoggerContract

로거가 성공적으로 만들어졌습니다.

Headers

ETag: string

Other Status Codes

ErrorResponse

작업이 실패한 이유를 설명하는 오류 응답입니다.

보안

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation 사용자 계정 가장

예제

ApiManagementCreateAILogger
ApiManagementCreateEHLogger

ApiManagementCreateAILogger

Sample Request

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/loggerId?api-version=2022-08-01

{
  "properties": {
    "loggerType": "applicationInsights",
    "description": "adding a new logger",
    "credentials": {
      "instrumentationKey": "11................a1"
    }
  }
}

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/loggerId",
  "type": "Microsoft.ApiManagement/service/loggers",
  "name": "loggerId",
  "properties": {
    "loggerType": "applicationInsights",
    "description": null,
    "credentials": {
      "instrumentationKey": "{{5a.......2a}}"
    },
    "isBuffered": false,
    "resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/microsoft.insights/components/airesource"
  }
}
{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/loggerId",
  "type": "Microsoft.ApiManagement/service/loggers",
  "name": "loggerId",
  "properties": {
    "loggerType": "applicationInsights",
    "description": null,
    "credentials": {
      "instrumentationKey": "{{5a.......2a}}"
    },
    "isBuffered": false
  }
}

ApiManagementCreateEHLogger

Sample Request

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/eh1?api-version=2022-08-01

{
  "properties": {
    "loggerType": "azureEventHub",
    "description": "adding a new logger",
    "credentials": {
      "name": "hydraeventhub",
      "connectionString": "Endpoint=sb://hydraeventhub-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=********="
    }
  }
}

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/eh1",
  "type": "Microsoft.ApiManagement/service/loggers",
  "name": "eh1",
  "properties": {
    "loggerType": "azureEventHub",
    "description": "adding a new logger",
    "credentials": {
      "connectionString": "{{Logger-Credentials-5f28745bbebeeb13cc3f7301}}"
    },
    "isBuffered": true
  }
}
{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/eh1",
  "type": "Microsoft.ApiManagement/service/loggers",
  "name": "eh1",
  "properties": {
    "loggerType": "azureEventHub",
    "description": "adding a new logger",
    "credentials": {
      "connectionString": "{{Logger-Credentials-5f28745bbebeeb13cc3f7301}}"
    },
    "isBuffered": true
  }
}

정의

Name Description
ErrorFieldContract

오류 필드 계약.

ErrorResponse

오류 응답.

LoggerContract

로거 세부 정보.

LoggerType

로거 형식입니다.

ErrorFieldContract

오류 필드 계약.

Name 형식 Description
code

string

속성 수준 오류 코드입니다.

message

string

사람이 읽을 수 있는 속성 수준 오류 표현입니다.

target

string

속성 이름입니다.

ErrorResponse

오류 응답.

Name 형식 Description
error.code

string

서비스에서 정의한 오류 코드입니다. 이 코드는 응답에 지정된 HTTP 오류 코드의 하위 상태로 사용됩니다.

error.details

ErrorFieldContract[]

유효성 검사 오류가 발생한 경우 요청에 잘못된 필드가 전송됩니다.

error.message

string

사람이 읽을 수 있는 오류 표현입니다.

LoggerContract

로거 세부 정보.

Name 형식 Description
id

string

리소스에 대한 정규화된 리소스 ID입니다. 예 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

리소스의 이름입니다.

properties.credentials

object

azureEventHub 로거에 대한 이벤트 허브의 이름 및 SendRule 연결 문자열. applicationInsights 로거에 대한 계측 키입니다.

properties.description

string

로거 설명.

properties.isBuffered

boolean

게시하기 전에 로거에서 레코드가 버퍼링되는지 여부입니다. 기본값은 true로 간주됩니다.

properties.loggerType

LoggerType

로거 형식입니다.

properties.resourceId

string

로그 대상의 Azure 리소스 ID(Azure Event Hub 리소스 또는 Azure 애플리케이션 Insights 리소스)입니다.

type

string

리소스 형식입니다. 예: "Microsoft.Compute/virtualMachines" 또는 "Microsoft.Storage/storageAccounts"

LoggerType

로거 형식입니다.

Name 형식 Description
applicationInsights

string

로그 대상으로 Insights를 Azure 애플리케이션.

azureEventHub

string

Azure Event Hub를 로그 대상으로 지정합니다.

azureMonitor

string

Azure Monitor