Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bboschert
Helper I
Helper I

Invoke-RestMethod: The remote server returned an error: (404) Not Found.

Hello!

 

So I'm working on getting this streaming dataset to work and I keep getting the error that the remote server is not found. I'm confused because I would think that there is a problem with my endpoint but I'm copying the link right out of power bi service. Also, This is only happening to streaming datasets that I have created today, all of the streaming datasets I've made prior work fine. Is anyone else experiencing the same thing or can spot something wrong with my script. I'm using powershell to post the data, here is the script.

 

# Initialise Stream
$sleepDuration = 1 #PowerBI seldom updates realtime dashboards faster than once per second.
$eventsToSend = 500 #Change this to determine how many events are part of the stream

$endpoint = "https://api.powerbi.com/beta/1bb841c5-79dd-4f6f-8ffa-1c73e03e5ab1/datasets/c443c22d-cab5-4ea2-a6f1-f..."

# Initialise the Payload
$payload = @{
"ResourceName" ="AAAAA555555"
"CurrentStreamSpeed" =98.6
"AverageOutput" =98.6
"JobNumber" ="AAAAA555555"
"JobName" ="AAAAA555555"
"OpCode" ="AAAAA555555"
"TimeLastUpdated" ="2019-09-30T17:18:18.863Z"
}

# Iterate until $eventsToSend events have been sent
$index = 1
do
{
[xml]$SpeedInfo = Get-Content "\\Yharnam\Technique$\SFDCspeedXML\DCSpeed_130.xml"
$payload.ResourceName = $SpeedInfo.resourcespeed.resourcename
$payload.CurrentSpeedStream = $SpeedInfo.resourcespeed.currentspeedstream1
$payload.AverageOutput = $SpeedInfo.resourcespeed.averagespeeds.averageoutput
$payload.OpCode = $SpeedInfo.resourcespeed.currentoperation.name
$payload.TimeLastUpdated = (Get-Date).AddHours(-5)
$payload.JobName = $SpeedInfo.resourcespeed.runningjobs.job.name
[xml]$DetailInfo = Get-Content "\\Yharnam\Technique$\SFDCspeedXML\DCDetail_130.xml"
$payload.JobNumber = $DetailInfo.resourcedetail.tasks.task.jobnumber

# Send the event
Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo-Json @($payload))


"`nEvent {0}" -f $index
$payload

# Sleep for a second
Start-Sleep $sleepDuration

# Ready for the next iteration
$index++

} While ($index -le $eventsToSend)

# Finished
"`n{0} Events Sent" -f $eventsToSend

1 ACCEPTED SOLUTION
bboschert
Helper I
Helper I

They just started working today, for no reason.

 

Cool.......

View solution in original post

2 REPLIES 2
bboschert
Helper I
Helper I

They just started working today, for no reason.

 

Cool.......

bboschert
Helper I
Helper I

So, I've found that it only errors out when the historical data analysis is checked. Is there something different with the script that is supposed to be changed to accommodate for this? I didn't have this issue last week when I was using the historical data analysis.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.