Forum Discussion
Unable to load Azure log analytics data completely to Power BI
- 3 months ago
Hi AndrewPrabhakar,
No worries at all, your follow-up questions are completely valid. Log Analytics API authentication and IAM setup can be a little confusing at first.
You can use the Log Analytics REST API outside of Power BI, such as in PowerShell or Python scripts, which is actually a better fit for your needs. While Power BI uses the same API under the hood, it's not ideal for managing very large historical datasets directly. PowerShell or Python allows for more control over incremental exports and file storage.
For this setup, you'll generally need:
- An Azure AD App Registration
- API permissions for Azure Monitor / Log Analytics
- A client secret or certificate
- IAM access like Log Analytics Reader or Monitoring Reader on the workspace
Once set up, your script can authenticate to Azure, run KQL queries for recent data, export results to CSV files, and save them to SharePoint or a folder. Power BI can then connect to the folder using the Folder connector and combine the files automatically during refresh.
Since you’re looking for a low-cost or no-cost solution, PowerShell with Windows Task Scheduler and SharePoint or folder storage is likely the best approach without needing Fabric capacity or extra services.
It's also a good idea to export smaller daily or hourly files instead of large cumulative ones to keep Power BI refreshes stable and avoid performance issues.
Thank you.
Is there a way to keep a query as historical in Power query without loading to Power BI and Without refresh enabled, then one query which only increments day wise adds to the historical set and that query again takes the next day pushes to the historical table.
Some thing like a dummy table but only loads piece by piece.