다음을 통해 공유


Azure 리소스 알림 - 상태 리소스 시스템 토픽(미리 보기)에서 발생한 이벤트 구독

이 문서에서는 Azure 리소스 알림 - 상태 리소스에서 게시한 이벤트를 구독하는 데 필요한 단계를 설명합니다. 이러한 이벤트에 대한 자세한 내용은 Azure 리소스 알림 - 상태 리소스 이벤트를 참조하세요.

상태 리소스 시스템 토픽 만들기

  1. 시스템 토픽을 만들고자 하는 Azure 구독에 계정을 설정합니다.

    az account set –s AZURESUBSCRIPTIONID
    
  2. az eventgrid system-topic create 명령을 사용해 microsoft.resourcenotifications.healthresources 유형의 시스템 토픽을 만듭니다

    az eventgrid system-topic create --name SYSTEMTOPICNAME --resource-group RESOURCEGROUPNAME --source /subscriptions/AZURESUBSCRIPTIONID --topic-type microsoft.resourcenotifications.healthresources --location Global        
    

이벤트 구독

az eventgrid system-topic event-subscription create 명령을 사용하여 위 토픽에 대한 이벤트 구독을 만듭니다.

다음 샘플 명령은 AvailabilityStatusChanged 이벤트에 대한 이벤트 구독을 만듭니다.

az eventgrid system-topic event-subscription create --name EVENTSUBSCRIPTIONNAME --resource-group RESOURCEGROUPNAME --system-topic-name SYSTEMTOPICNAME –included-event-types Microsoft.ResourceNotifications.HealthResources.AvailabilityStatusChanged --endpoint /subscriptions/AZURESUBSCRIPTIONID/resourceGroups/RESOURCEGROUPNAME/providers/Microsoft.EventHub/namespaces/MYEVENTHUBSNAMESPACE/eventhubs/MYEVENTHUB --endpoint-type eventhub        

다음 샘플 명령은 ResourceAnnotated 이벤트에 대한 이벤트 구독을 만듭니다.

az eventgrid system-topic event-subscription create --name EVENTSUBSCRIPTIONNAME --resource-group RESOURCEGROUPNAME --system-topic-name SYSTEMTOPICNAME –included-event-types Microsoft.ResourceNotifications.HealthResources.ResourceAnnotated --endpoint /subscriptions/AZURESUBSCRIPTIONID/resourceGroups/RESOURCEGROUPNAME/providers/Microsoft.EventHub/namespaces/MYEVENTHUBSNAMESPACE/eventhubs/MYEVENTHUB --endpoint-type eventhub        

included-event-types를 지정하지 않으면 모든 이벤트 유형이 기본적으로 포함됩니다.

특정 리소스에서 이벤트를 필터링하려면 --subject-begins-with 매개 변수를 사용합니다. 이 예제에서는 지정된 리소스 그룹의 리소스에 대한 AvailabilityStatusChanged 이벤트를 구독 하는 방법을 보여줍니다.

az eventgrid system-topic event-subscription create --name EVENTSUBSCRIPTIONNAME --resource-group RESOURCEGROUPNAME --system-topic-name SYSTEMTOPICNAME –included-event-types Microsoft.ResourceNotifications.HealthResources.AvailabilityStatusChanged --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 firstEventSubscription --resourcegroup sampletestrg --system-topic-name arnSystemTopicHealth

시스템 토픽을 삭제하려면 az eventgrid system-topic delete 명령을 사용합니다. 예를 들면 다음과 같습니다.

az eventgrid system-topic delete --name arnsystemtopicHealth --resource-group sampletestrg

필터링 예

계획되지 않은 범주에 속하는 플랫폼 시작 주석을 구독합니다.

작업이 필요한 이벤트로 필터링하길 원할 수 있습니다. 근 실시간 경고는 빠른 완화 작업을 사용하도록 설정하는 데 중요합니다. Azure 시작된 활동 및 계획되지 않은 활동으로 필터링하면 즉각적인 주의가 필요한 워크로드 전체에서 예기치 않은 활동을 즉시 인식할 수 있습니다. 영향을 알리기 위해 최종 사용자에게 통신을 재배포하거나 트리거하길 원할 수 있습니다.

az eventgrid system-topic event-subscription create \
	--name firstEventSubscription \
	--resource-group sampletestrg \
	--system-topic-name arnSystemTopicHealth 
	--included-event-types Microsoft.ResourceNotifications.HealthResources.ResourceAnnotated \
	--endpoint /subscriptions/000000000-0000-0000-0000-000000000000/resourceGroups/sampletestrg/providers/Microsoft.EventHub/namespaces/testEventHub/eventhubs/ehforsystemtopicresources \
	--endpoint-type evenhub \
	--advanced-filter data.resourceInfo.properties.context StringEndsWith Platform Initiated \
	--advanced-filter data.resourceInfo.properties.category StringEndsWith Unplanned 

특정 대상 유형으로 범위가 지정된 주석 구독

영향을 받을 때 주의 또는 완화가 필요한 리소스 종류로 필터링할 수 있으므로 중요한 사항에 집중할 수 있습니다. VM 내에서도 부모 또는 전체 가상 머신 확장 집합의 상태가 영향을 받는 경우와 가상 머신 확장 집합의 인스턴스가 영향을 받는 경우에만 주의할 수 있습니다. 이 필터를 사용하면 근 실시간 경고를 원하는 리소스 유형을 정확하게 파악할 수 있습니다.

az eventgrid system-topic event-subscription create \
	--name firstEventSubscription \
	--resource-group sampletestrg \
	--system-topic-name arnSystemTopicHealth \
	--included-event-types Microsoft.ResourceNotifications.HealthResources.ResourceAnnotated \
	--endpoint/subscriptions/000000000-0000-0000-0000-0000000000000/resourceGroups/sampletestrg/providers/Microsoft.EventHub/namespaces/testEventHub/eventhubs/ehforsystemtopicresources \
	--endpoint-type evenhub \
	--advanced-filter data.resourceInfo.targetResourceType StringContains Microsoft.Compute/virtualMachines

문의하기

이 기능에 대한 질문이나 피드백이 있는 경우 주저하지 말고 arnsupport@microsoft.com을 통해 연락해 주세요.

특정 이벤트에 대한 구체적인 피드백을 더 잘 지원하기 위해 다음 정보를 제공합니다.

누락된 이벤트의 경우:

  • 시스템 토픽 유형 이름
  • 작업이 실행되었을 때 UTC의 대략적 타임스탬프
  • 알림이 생성된 기본 리소스 ID
  • Azure Portal의 리소스로 이동하고 맨 오른쪽 모서리에서 JSON 보기를 선택합니다. 리소스 ID는 JSON 보기 페이지의 첫 번째 필드입니다.
  • 예상 이벤트 유형
  • 실행된 작업(예: VM 시작 또는 중지, 스토리지 계정 생성 등)
  • 발생한 문제에 대한 설명(예: VM이 시작되고 Microsoft.ResourceNotifications.HealthResources.AvailabilityStatusChanged 이벤트가 생성되지 않음)
  • 가능하면 실행된 작업의 상관 관계 ID를 제공합니다.

지연되었거나 예기치 않은 콘텐츠가 있는 이벤트의 경우

  • 시스템 토픽 유형 이름
  • data.resourceInfo.properties를 제외한 알림의 전체 콘텐츠
  • 발생한 문제 및 영향을 받은 필드 값에 대한 설명

이 데이터를 공유하는 동안 최종 사용자 식별 정보를 제공하고 있지 않은지 확인합니다.

다음 단계

이러한 이벤트에 대한 자세한 내용은 Azure 리소스 알림 - 상태 리소스 이벤트를 참조하세요.