Is there a way to Stream Activity Logs to EventHub ?

%3CLINGO-SUB%20id%3D%22lingo-sub-580584%22%20slang%3D%22en-US%22%3EIs%20there%20a%20way%20to%20Stream%20Activity%20Logs%20to%20EventHub%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-580584%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20to%20stream%20Azure%20Activity%20Logs%20to%20Event%20Hub%20programmatically%20via%20sdk%20but%20there%20seems%20to%20be%20no%20way%20to%20do%20that%20%2C%20or%20if%20there%20is%20REST%20API%20to%20do%20that%20%2C%20following%20the%20documentation%20page%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fplatform%2Factivity-logs-stream-event-hubs%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fplatform%2Factivity-logs-stream-event-hubs%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3Bit's%20doable%20either%20by%20portal%20export%20facility%20or%20Azure%20Powershell%2FCLI%20but%20for%20the%20developers%20who%20need%20to%20automate%20this%20after%20creating%20the%20resource-%26gt%3Bevent%20hub%20name%20space-%26gt%3Bevent%20hub%20-%26gt%3Bstorage%20%2C%20the%20final%20thing%20is%20to%20route%20the%20logs%20based%20on%20subscription%20from%20activity%20log%20to%20the%20event%20hub%20.%3C%2FP%3E%3CP%3EPlease%20share%20if%20anyone%20knows%20anything%20about%20the%20REST%20API%20or%20the%20SDK%20way%20to%20do%20that..%3F%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-722780%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20there%20a%20way%20to%20Stream%20Activity%20Logs%20to%20EventHub%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-722780%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F343716%22%20target%3D%22_blank%22%3E%40sanjaymahara_1984%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDocumentation%20for%20configuring%20%22log%20profiles%22%20via%20REST%2C%20which%20is%20the%20current%20way%20to%20export%20Activity%20Logs%20via%20Eventhub%2C%20is%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fmonitor%2Flogprofiles%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fmonitor%2Flogprofiles%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EIs%20that%20sufficient%20for%20your%20needs%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-724588%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20there%20a%20way%20to%20Stream%20Activity%20Logs%20to%20EventHub%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-724588%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F367338%22%20target%3D%22_blank%22%3E%40nikiest%3C%2FA%3E%26nbsp%3B%20thanks.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New 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?