Azure Queue Storage 작업 로그 비활성화

Queue Storage의 읽기·쓰기·삭제 로그를 필요한 대상으로 전송하세요.

설명

Azure Queue Storage의 queueServices/default에 큐 작업을 기록하는 진단 설정을 적용하세요.

잠재적 영향

별도 수집 경로가 없으면 누가 큐 데이터를 읽거나 변경했는지 나중에 확인하기 어렵습니다.

해결 방법

필요한 작업에 맞게 StorageRead, StorageWrite, StorageDelete를 켜고 목적지에서 보관 기간을 설정하세요. 테스트 큐에서 해당 작업을 수행한 뒤 목적지에 로그가 도착하는지 확인하세요.

예시

예제에는 기존 스토리지 계정 이름과 Log Analytics 작업 영역 ID가 필요합니다. Blob, File, Table에는 각각 별도 진단 설정을 적용하세요.

변경 전

bicep
param storageAccountName string
param workspaceId string

resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' existing = {
  name: storageAccountName
}

resource queueService 'Microsoft.Storage/storageAccounts/queueServices@2021-09-01' existing = {
  parent: storageAccount
  name: 'default'
}

resource default_Microsoft_Insights 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = {
  name: 'default'
  scope: queueService
  properties: {
    workspaceId: workspaceId
    logs: [
      {
        category: 'StorageRead'
        enabled: false
      }
      {
        category: 'StorageWrite'
        enabled: false
      }
      {
        category: 'StorageDelete'
        enabled: false
      }
    ]
  }
}

변경 후

bicep
param storageAccountName string
param workspaceId string

resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' existing = {
  name: storageAccountName
}

resource queueService 'Microsoft.Storage/storageAccounts/queueServices@2021-09-01' existing = {
  parent: storageAccount
  name: 'default'
}

resource default_Microsoft_Insights 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = {
  name: 'default'
  scope: queueService
  properties: {
    workspaceId: workspaceId
    logs: [
      {
        category: 'StorageRead'
        enabled: true
      }
      {
        category: 'StorageWrite'
        enabled: true
      }
      {
        category: 'StorageDelete'
        enabled: true
      }
    ]
  }
}

참조