Forum Discussion
PowerBI API Dataset Refresh 404 Not Found
Hi Anonymous ,
Based on the information you've provided, it seems like your PowerShell script works as expected when executed locally but encounters a 404 Not Found error when scheduled and run through ActiveBatch. This discrepancy suggests that the issue might not be with the script itself but rather with how ActiveBatch interacts with the Power BI API or the environment it's running in.
A few areas to investigate:
1. Endpoint Accessibility: Ensure that the ActiveBatch environment has network access to api.powerbi.com. It's possible that network policies or firewalls in the ActiveBatch environment are blocking access to the Power BI API endpoints.
2. PowerShell Environment: Verify that the PowerShell version and modules available in the ActiveBatch environment are the same as those on your local machine. Differences in PowerShell versions or missing modules could lead to unexpected behavior.
3. Service Principal Permissions: Double-check that the service principal used has the necessary API permissions assigned in Azure AD and that it's not restricted in any way when running from the ActiveBatch environment.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.