RuiRomano / pbimonitor

MIT License
216 stars 79 forks source link

Issue running in PowerShell #40

Open JimSorenson opened 1 year ago

JimSorenson commented 1 year ago

I have set this up just as described in the ReadME and keep running into this error: Fetch - Run.ps1 : Error on '.\Fetch - Activity.ps1' - System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).

I have checked and double checked everything and cannot figure out the source of the error.

JimSorenson commented 1 year ago

more information: The error is within the Fetc-Activity.ps1 script. I've stepped through that script and it errors when connecting to the $activityAPIUrl with the below message. Ignore the line #, I made changes to the script to execute without calling on config.json.

Invoke-PowerBIRestMethod : One or more errors occurred. At C:\Scripts\Temp\Fetch - Activity.ps1:93 char:27

I have checked permissions to the app registration and have verified the settings within Power BI Tenant Admin. This particular powershell error is very inconclusive.

JamesDBartlett3 commented 6 months ago

@JimSorenson Are you still experiencing this issue? If so, can you confirm that your app registration has the required permissions by authenticating with Login-PowerBIServiceAccount -ServicePrincipal and running the same commands that the script tries to run?