Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
All,
NOTE: I am not a developer, trying to do the below from an online example.
I am using the following power shell script to push data to a power BI API and data set. It used to work fine, but then I started getting the following error
======================================
Invoke-RestMethod : The remote server returned an error: (404) Not Found.
At line:28 char:5
+ Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo- ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestM
ethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMeth
odCommand
=================================
Script is pretty simple - just getting local machine stats and posting to power BI API
$endpoint = "https://api.powerbi.com/beta/de3e5d90-25ee-443e-908a-0590e39c4dff/datasets/abfa7618-cc8e-49c3-bffe-0..."
while($true)
{
$ComputerCPU = (Get-WmiObject -Class win32_processor -ErrorAction Stop | Measure-Object -Property LoadPercentage -Average | Select-Object Average).Average
$ComputerMemory = Get-WmiObject -Class win32_operatingsystem -ErrorAction Stop
$UsedMemory = $ComputerMemory.TotalVisibleMemorySize - $ComputerMemory.FreePhysicalMemory
$Memory = (($UsedMemory/ $ComputerMemory.TotalVisibleMemorySize)*100)
$RoundMemory = [math]::Round($Memory, 2)
$Date = Get-Date -DisplayHint Date -Format MM/dd/yyyy
$Time = Get-Date -DisplayHint Time -Format HH:mm:ss
#$RoundMemory
#$ComputerCPU
#$Date
#$Time
$payload = @{
"Date" =$Date
"Time" =$Time
"CPU" = $ComputerCPU
"Memory" = $RoundMemory
}
Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo-Json @($payload))
Write-Host "Date: " $Date " Time: " $Time " CPU: " $ComputerCPU " Memory: " $RoundMemory
sleep 2
}
============================
Why would this suddenly stop working?
If I hit the full url : https://api.powerbi.com/beta/de3e5d90-25ee-443e-908a-0590e39c4dff/datasets/abfa7618-cc8e-49c3-bffe-0...
I get a 404
I get a 403
can someone help me fix this?
Thanks
Ravina
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |