Showing results for 
Search instead for 
Did you mean: 

dataflow refresh using api failed - 400 bad request

Hi there,


I am trying to refresh dataflows using the rest api:


And I am getting the following error:

Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At line:2 char:1
+ Invoke-RestMethod -Uri $uri –Headers $authHeader –Method POST –Verbos ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand


The code:

function GetAuthToken
if(-not (Get-Module AzureRm.Profile)) {
Import-Module AzureRm.Profile

$redirectUri = "urn:ietf:wgSmiley Surprisedauth:2.0Smiley Surprisedob"

$authContext = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext" -ArgumentList $authority

$authResult = $authContext.AcquireToken($resourceAppIdURI, $clientId, $redirectUri, "Auto")

return $authResult

$token = GetAuthToken

$authHeader = @{
$groupsPath = ""
if ($groupID -eq "me") {
$groupsPath = "myorg"
} else {
$groupsPath = "myorg/groups/$groupID"

Invoke-RestMethod -Uri $uri –Headers $authHeader –Method POST –Verbose
Status: New

I am not sure is this a bug or not though, I can get dataflow list using same authenticaiton.


Anyone have ideas on this issue?


Hi @SimonL7 ,


You need to pass "refreshRequest": "y" in your request body. For more information, please refer to this thread:


Best Regards,
Qiuyun Yu