Is there a way to Stream Activity Logs to EventHub ?

Copper Contributor

Hi,

 

I need to stream Azure Activity Logs to Event Hub programmatically via sdk but there seems to be no way to do that , or if there is REST API to do that , following the documentation page 

https://docs.microsoft.com/en-us/azure/azure-monitor/platform/activity-logs-stream-event-hubs

 it's doable either by portal export facility or Azure Powershell/CLI but for the developers who need to automate this after creating the resource->event hub name space->event hub ->storage , the final thing is to route the logs based on subscription from activity log to the event hub .

Please share if anyone knows anything about the REST API or the SDK way to do that..?

Thanks

2 Replies

@sanjaymahara_1984 

Documentation for configuring "log profiles" via REST, which is the current way to export Activity Logs via Eventhub, is here: https://docs.microsoft.com/en-us/rest/api/monitor/logprofiles

Is that sufficient for your needs?