Azure Resource Notifications에서 발생한 이벤트 구독 - ContainerService 이벤트 리소스 시스템 항목(미리 보기)
이 문서에서는 Azure Resource Notifications - ContainerService 이벤트 리소스에서 게시한 이벤트를 구독하는 데 필요한 단계를 설명합니다. 이러한 이벤트에 대한 자세한 내용은 Azure Resource Notifications - ContainerService 이벤트 리소스를 참조 하세요.
상태 리소스 시스템 토픽 만들기
시스템 토픽을 만들고자 하는 Azure 구독에 계정을 설정합니다.
az account set –s AZURESUBSCRIPTIONID
microsoft.resourcenotifications.containerserviceeventresources
명령을 사용하여az eventgrid system-topic create
유형의 시스템 토픽을 만듭니다.az eventgrid system-topic create --name SYSTEMTOPICNAME --resource-group RESOURCEGROUPNAME --source /subscriptions/AZURESUBSCRIPTIONID --topic-type microsoft.resourcenotifications.containerserviceeventresources --location Global
이벤트 구독
명령을 사용하여 위 항목에 대한 이벤트 구독을 만듭니다 az eventgrid system-topic event-subscription create
.
다음 샘플 명령은 ScheduledEventEmitted 이벤트에 대한 이벤트 구독을 만듭니다.
az eventgrid system-topic event-subscription create --name EVENTSUBSCRIPTIONNAME --resource-group RESOURCEGROUPNAME --system-topic-name SYSTEMTOPICNAME –included-event-types Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted --endpoint /subscriptions/AZURESUBSCRIPTIONID/resourceGroups/RESOURCEGROUPNAME/providers/Microsoft.EventHub/namespaces/MYEVENTHUBSNAMESPACE/eventhubs/MYEVENTHUB --endpoint-type eventhub
included-event-types
를 지정하지 않으면 모든 이벤트 유형이 기본적으로 포함됩니다.
특정 리소스에서 이벤트를 필터링하려면 --subject-begins-with
매개 변수를 사용합니다. 이 예제에서는 지정된 리소스 그룹의 리소스에 대한 ScheduledEventsEmitted
이벤트를 구독 하는 방법을 보여줍니다.
az eventgrid system-topic event-subscription create --name EVENTSUBSCRIPTIONNAME --resource-group RESOURCEGROUPNAME --system-topic-name SYSTEMTOPICNAME –included-event-types Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted --endpoint /subscriptions/AZURESUBSCRIPTIONID/resourceGroups/RESOURCEGROUPNAME/providers/Microsoft.EventHub/namespaces/MYEVENTHUBSNAMESPACE/eventhubs/MYEVENTHUB --endpoint-type eventhub --subject-begins-with /subscriptions/AZURESUBSCRIPTIONID/resourceGroups/SOURCERESOURCEGROUP/
이벤트 구독 및 시스템 토픽 삭제
이벤트 구독을 삭제하려면 az eventgrid system-topic event-subscription delete
명령을 사용합니다. 예를 들면 다음과 같습니다.
az eventgrid system-topic event-subscription delete --name EVENTSUBSCRIPTIONNAME --resourcegroup RESOURCEGROUPNAME --system-topic-name SYSTEMTOPICNAME
시스템 토픽을 삭제하려면 az eventgrid system-topic delete
명령을 사용합니다. 예를 들면 다음과 같습니다.
az eventgrid system-topic delete --name SYSTEMTOPICNAME --resource-group RESOURCEGROUPNAME
필터링 예
특정 클러스터로 Azure Kubernetes 클러스터 예약 이벤트 구독
구독자 끝의 특정 클러스터별로 Azure Kubernetes 클러스터 예약 이벤트를 필터링할 수 있습니다. 이 필터링을 통해 관심 있는 클러스터에서만 알림을 받을 수 있습니다.
az eventgrid system-topic event-subscription create \
--name EVENTSUBSCRIPTIONNAME \
--resource-group RESOURCEGROUPNAME \
--system-topic-name SYSTEMTOPICNAME \
--included-event-types Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted \
--endpoint /subscriptions/000000000-0000-0000-0000-0000000000000/resourceGroups/RESOURCEGROUPNAME/providers/Microsoft.EventHub/namespaces/EVENTHUBNAMESPACE/eventhubs/EVENTHUBNAME \
--endpoint-type evenhub \
--advanced-filter data.resourceInfo.properties.resources StringContains clusterName
"완료됨" 이벤트 상태로 Azure Kubernetes 클러스터 예약 이벤트 구독
Azure Kubernetes 클러스터 예약된 이벤트를 구독자 끝의 "완료됨"등 특정 상태로 필터링할 수 있습니다. 이 필터링을 사용하면 관심 있는 이벤트로부터만 알림을 받을 수 있습니다.
az eventgrid system-topic event-subscription create \
--name EVENTSUBSCRIPTIONNAME \
--resource-group RESOURCEGROUPNAME \
--system-topic-name SYSTEMTOPICNAME \
--included-event-types Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted \
--endpoint /subscriptions/000000000-0000-0000-0000-0000000000000/resourceGroups/RESOURCEGROUPNAME/providers/Microsoft.EventHub/namespaces/EVENTHUBNAMESPACE/eventhubs/EVENTHUBNAME \
--endpoint-type evenhub \
--advanced-filter data.resourceInfo.properties.eventStatus StringContains Completed
문의하기
이 기능에 대한 질문이나 피드백이 있는 경우 주저하지 말고 arnsupport@microsoft.com을 통해 연락해 주세요.
특정 이벤트에 대한 구체적인 피드백을 더 잘 지원하기 위해 다음 정보를 제공합니다.
누락된 이벤트의 경우:
- 시스템 토픽 유형 이름
- 작업이 실행되었을 때 UTC의 대략적 타임스탬프
- 알림이 생성된 기본 리소스 ID
- Azure Portal의 리소스로 이동하고 맨 오른쪽 모서리에서 JSON 보기를 선택합니다. 리소스 ID는 JSON 보기 페이지의 첫 번째 필드입니다.
- 예상 이벤트 유형
- 실행된 작업(예: VM 시작 또는 중지, 스토리지 계정 생성 등)
- 발생한 문제에 대한 설명(예: VM이 시작되고 Microsoft.ResourceNotifications.HealthResources.AvailabilityStatusChanged 이벤트가 생성되지 않음)
- 가능하면 실행된 작업의 상관 관계 ID를 제공합니다.
지연되었거나 예기치 않은 콘텐츠가 있는 이벤트의 경우
- 시스템 토픽 유형 이름
- data.resourceInfo.properties를 제외한 알림의 전체 콘텐츠
- 발생한 문제 및 영향을 받은 필드 값에 대한 설명
이 데이터를 공유하는 동안 최종 사용자 식별 정보를 제공하고 있지 않은지 확인합니다.
다음 단계
이러한 이벤트에 대한 자세한 내용은 Azure 리소스 알림 - 컨테이너 서비스 이벤트를 참조 하세요.