Failed to read logs from event logs with C# in Azure Windows Server 2012

297 views Asked by At

I created Windows Server 2012 R2 machine in Azure and I try to create simple c# application to read logs from event logs.

I am using the EventLog, EventLogQuery, EventLogReader classes to read the logs.

I test the code in a private virtual machine with Windows Server 2012 (in my PC) and its worked great, I was able to read the logs locally and from remote.

When I run my code in Azure, I get EventLogException with the message:

"The RPC server is unavailable"

I try to enable some firewall rules & start some services but it didn't help.

Do anyone know the issue ? Do you have any other solution to read the event logs ?

I see some people that read the logs with PowerShell but I prefer to do it with pure c#

Thanks.

0

There are 0 answers