question

rk1199 avatar image
0 Votes"
rk1199 asked JamesHamil-MSFT edited

How to get Azure AD Sign-in logs by Python

Hi I want to retrieve Azure AD Sign-in logs by Python and save them to the storage.

I couldn't find documents for authentication, could anyone give me some advice?

Thanks,

azure-ad-libraries
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @rk1199 , do you specifically want it to be with Python? You can download logs manually to a CSV but if you want Python specifically I can look into it further for you.

Best,
James

0 Votes 0 ·

1 Answer

JamesHamil-MSFT avatar image
0 Votes"
JamesHamil-MSFT answered JamesHamil-MSFT edited

Hi @rk1199 , from my understanding, you want to authenticate and retrieve AD sign in logs? The best way to do this is by using the Graph API. The article linked details how you can authenticate with the Graph using python. This document shows how you can retrieve the sign in logs. Please let me know if you have any questions!

If this answer helped you please mark it as "Verified" so other users may reference it.

Thank you,
James

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.