Step 1: Register an app in active directory app registration, Get Application Id which is also called the client id. Now configure the permission. In permission, give access to log analytics data as user that should be given
Step2: Get a secret id from the azure. That you can get from the key configure that in the app that you just register and make a new key you need o save that.
Now go to Azure Portal - Log Analytics
Step3: Get Log Analytics Workspace ID.
Step4: Go to access control. Add a new role assignment
Role: Contributor
Select: the app that you created
SAVE