extract logs using azure analytics workspace

FZ-KECH 41 Reputation points
2022-05-17T08:53:06.11+00:00

Hello everyone,

Hope you're doing well,

We used to extract logs using analytics workspace with the credentials:
($ClientId = "" $ClientSecret = "" $TenantId = "" $WorkspaceId = "")

This part is used to access the data from the script without having to connect to log analytics.

qst:

Is it possible to use a certificate instead of client secret keys??

Do you have any idea?

thank you in advance.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

Answer accepted by question author
  1. Givary-MSFT 35,771 Reputation points Microsoft Employee Moderator
    2022-05-19T05:47:41.18+00:00

    @fatimazahrahida-9743

    Reviewed the script which was sent yesterday and I see you are trying to authenticate Azure AD using Invoke-RestMethod with Client Credential flow ( below snipped from script for reference )

    203526-image.png

    I came across this article with the similar requirement - https://stackoverflow.com/questions/71265186/how-do-i-authenticate-to-aad-using-invoke-restmethod-with-clientcredential-flow

    You need to make few changes to your script to authenticate via Certificate, refer to the below article ( section: Acquire an Access token using a certificate ).
    https://adamtheautomator.com/powershell-graph-api/#:~:text=RestMethod%20%40PostSplat-,Acquire%20an%20Access%20Token%20(Using%20a%20Certificate),-The%20authenticate%20to

    Let me know if you have any questions.

    Please remember to "Accept Answer" if answer helped, so that others in the community facing similar issues can easily find the solution.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. FZ-KECH 41 Reputation points
    2022-05-26T09:39:42.7+00:00

    thank you that was very helpful

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.