<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [REST API] Datasets Take Over: Positional Parameter cannot be found that accepts argument 'Metho in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2212196#M33210</link>
    <description>&lt;P&gt;Looks like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Get-PowerBIAccessToken -AsString&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;returns more than you need. Investigate that and then only use the auth part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;most likely&lt;/P&gt;
&lt;PRE&gt;$authHeader = @{&lt;BR /&gt;'Content-Type'='application/json'&lt;BR /&gt;'Authorization'=$token.Values[0]&lt;BR /&gt;}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Nov 2021 14:59:57 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2021-11-29T14:59:57Z</dc:date>
    <item>
      <title>[REST API] Datasets Take Over: Positional Parameter cannot be found that accepts argument 'Method'</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2205312#M33104</link>
      <description>&lt;P class="lia-indent-padding-left-30px"&gt;Getting the following error when trying to take over dataset using this REST API:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/take-over-in-group" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/take-over-in-group&lt;/A&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="smohanty_0-1637742722953.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/635448iB2CFFB9AEB2F181A/image-size/large?v=v2&amp;amp;px=999" role="button" title="smohanty_0-1637742722953.png" alt="smohanty_0-1637742722953.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following is my code:&lt;/P&gt;&lt;PRE&gt;&lt;BR /&gt;#Login using Service Principal&lt;BR /&gt;#-------------------------------&lt;BR /&gt;cls&lt;BR /&gt;$applicationId = "XXXXX"&lt;BR /&gt;$clientsec = "XXXXX" | ConvertTo-SecureString -AsPlainText -Force #&lt;BR /&gt;$tenantId = "XXXXX"&lt;BR /&gt;$resource = "https://analysis.windows.net/powerbi/api"&lt;BR /&gt;&lt;BR /&gt;$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $applicationId, $clientsec&lt;BR /&gt;Connect-PowerBIServiceAccount -ServicePrincipal -Credential $credential -TenantId $tenantId&lt;BR /&gt;&lt;BR /&gt;# Get token&lt;BR /&gt;#-------------------------------&lt;BR /&gt;$token = Get-PowerBIAccessToken -AsString&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# Building Rest API header with authorization token&lt;BR /&gt;#-------------------------------&lt;BR /&gt;$authHeader = @{&lt;BR /&gt;'Content-Type'='application/json'&lt;BR /&gt;'Authorization'=$token&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;#Group and Dataset Parameters&lt;BR /&gt;#-------------------------------&lt;BR /&gt;$group= "xxxxx" #workspace ID&lt;BR /&gt;$dataset= "xxxxxx" #dataset ID&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# POST body &lt;BR /&gt;#-------------------------------&lt;BR /&gt;$postParams = @{&lt;BR /&gt;"datasetId" = "$dataset"&lt;BR /&gt;}&lt;BR /&gt;$jsonPostBody = $postParams | ConvertTo-JSON&lt;BR /&gt;&lt;BR /&gt;$Url = "https://api.powerbi.com/v1.0/myorg/groups/$group/datasets/$dataset/Default.TakeOver"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;## Take Over DataSet&lt;BR /&gt;#-------------------------------&lt;BR /&gt;Invoke-PowerBIRestMethod -Url $Url -Headers $authHeader -Body $jsonPostBody Method -POST -Verbose&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The Service Principal has the following permissions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="smohanty_1-1637743057259.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/635450i5C024238B01B1F11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="smohanty_1-1637743057259.png" alt="smohanty_1-1637743057259.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What am I missing? Please help! Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Nov 2021 20:58:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2205312#M33104</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-24T20:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: [REST API] Datasets Take Over: Positional Parameter cannot be found that accepts argument 'Metho</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2210123#M33176</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;instead of&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Method -Post&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you need&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Method POST&lt;/P&gt;</description>
      <pubDate>Sat, 27 Nov 2021 01:50:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2210123#M33176</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-11-27T01:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: [REST API] Datasets Take Over: Positional Parameter cannot be found that accepts argument 'Metho</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2212108#M33207</link>
      <description>&lt;P&gt;Getting the same error after replacing -POST with POST:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="smohanty_0-1638194520499.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/637066i83F886B20884311A/image-size/large?v=v2&amp;amp;px=999" role="button" title="smohanty_0-1638194520499.png" alt="smohanty_0-1638194520499.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 14:02:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2212108#M33207</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-29T14:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: [REST API] Datasets Take Over: Positional Parameter cannot be found that accepts argument 'Metho</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2212128#M33208</link>
      <description>&lt;P&gt;Please read my reply again.&amp;nbsp; Use -Method&amp;nbsp; (note the dash)&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 14:21:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2212128#M33208</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-11-29T14:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: [REST API] Datasets Take Over: Positional Parameter cannot be found that accepts argument 'Metho</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2212157#M33209</link>
      <description>&lt;P&gt;Thank you, I changed the code but getting this new error now:&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Invoke-PowerBIRestMethod -Url $Url -Headers $authHeader -Body $jsonPostBody &lt;FONT face="arial black,avant garde"&gt;-Method POST&lt;/FONT&gt; -Verbose&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="smohanty_0-1638196040196.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/637074iEFDC8AA6D88CA2C5/image-size/large?v=v2&amp;amp;px=999" role="button" title="smohanty_0-1638196040196.png" alt="smohanty_0-1638196040196.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 14:30:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2212157#M33209</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-29T14:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: [REST API] Datasets Take Over: Positional Parameter cannot be found that accepts argument 'Metho</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2212196#M33210</link>
      <description>&lt;P&gt;Looks like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Get-PowerBIAccessToken -AsString&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;returns more than you need. Investigate that and then only use the auth part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;most likely&lt;/P&gt;
&lt;PRE&gt;$authHeader = @{&lt;BR /&gt;'Content-Type'='application/json'&lt;BR /&gt;'Authorization'=$token.Values[0]&lt;BR /&gt;}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 14:59:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2212196#M33210</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-11-29T14:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: [REST API] Datasets Take Over: Positional Parameter cannot be found that accepts argument 'Metho</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2212258#M33211</link>
      <description>&lt;P&gt;Hmm, maybe the issue is elsewhere. Both&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Connect-PowerBIServiceAccount
$headers = Get-PowerBIAccessToken -AsString
$authHeader = @{
'Content-Type'='application/json'
'Authorization'=$headers
}
Invoke-RestMethod -Headers $authHeader -Uri 'https://api.powerbi.com/v1.0/myorg/groups'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Connect-PowerBIServiceAccount
$headers = Get-PowerBIAccessToken 
Invoke-RestMethod -Headers $headers -Uri 'https://api.powerbi.com/v1.0/myorg/groups'
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;work for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe Invoke-PowerBIRestMethod is the culprit.&amp;nbsp; Use Invoke-RestMethod instead.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 15:30:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2212258#M33211</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-11-29T15:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: [REST API] Datasets Take Over: Positional Parameter cannot be found that accepts argument 'Metho</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2212409#M33214</link>
      <description>&lt;P&gt;Tried this code:&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;Invoke-RestMethod&lt;/STRONG&gt; -Uri $Url -Headers $authHeader -Body $jsonPostBody -Method POST -Verbose&lt;/PRE&gt;&lt;P&gt;Getting the following error now:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="smohanty_1-1638205414878.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/637122i469411FA2F327C89/image-size/large?v=v2&amp;amp;px=999" role="button" title="smohanty_1-1638205414878.png" alt="smohanty_1-1638205414878.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 17:04:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2212409#M33214</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-29T17:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: [REST API] Datasets Take Over: Positional Parameter cannot be found that accepts argument 'Metho</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2902544#M39718</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;replace the nonunicode "-" sign and type "-" again to each parameter.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 03:41:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/REST-API-Datasets-Take-Over-Positional-Parameter-cannot-be-found/m-p/2902544#M39718</guid>
      <dc:creator>AmilaGunawardan</dc:creator>
      <dc:date>2022-11-14T03:41:50Z</dc:date>
    </item>
  </channel>
</rss>

