<?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: Import Dataflow in Power BI Service in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Import-Dataflow-in-Power-BI-Service/m-p/2766329#M38635</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/320777"&gt;@v-chenwuz-msft&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What do you mean when you write : "&lt;SPAN&gt;This parameter should be hardcoded to model.json." ?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried this script but it doesn't work : &lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/groups/cfafbeb1-8037-4d0c-896e-a46fb27ff229/imports?datasetDisplayName=model.json&amp;amp;nameConflict=Abort&amp;amp;skipReport=True" -Method Post&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error message :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;AVERTISSEMENT : The Body parameter was null, the request may be invalid when Method par
ameter is Post.
Invoke-PowerBIRestMethod : Une ou plusieurs erreurs se sont produites.
Au caractère Ligne:5 : 1
+ Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/gro ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], AggregateException
    + FullyQualifiedErrorId : Une ou plusieurs erreurs se sont produites.,Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 14 Sep 2022 07:13:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-09-14T07:13:37Z</dc:date>
    <item>
      <title>Import Dataflow in Power BI Service</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Import-Dataflow-in-Power-BI-Service/m-p/2764568#M38619</link>
      <description>&lt;P&gt;I use this script to import a dataflow :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "...", ("..." | ConvertTo-SecureString -AsPlainText -Force)

Connect-PowerBIServiceAccount -ServicePrincipal -Tenant "..." -Credential $credential -Environment "Public"

$workspaceName = "WKS - DTS [DEV]"

$DataflowImportFileName = "C:\Users\cbonier\Documents\DTF FINANCE.json"

$DataflowDefinition = [IO.File]::ReadAllText($DataflowImportFileName)


$UserAccessToken = Get-PowerBIAccessToken
$bearer = $UserAccessToken.Authorization.ToString()


$workspace = Get-PowerBIWorkspace -Name $workspaceName
$workspaceId = $workspace.Id

$importsUrl = "https://api.powerbi.com/v1.0/myorg/groups/$workspaceId/imports?datasetDisplayName=DTF FINANCE.json"

$boundary = [System.Guid]::NewGuid().ToString("N")
$LF = [System.Environment]::NewLine

$contentType = "multipart/from-data; boundary=""$boundary"""

$body = (
"--$boundary",
"Content-Disposition: form-data $LF",
$DataflowDefinition,
"--$boundary--$LF"
) -join $LF

$header = @{
    'Authorization' = "$bearer"
    'Content-Type' = "$contentType"
}

Invoke-RestMethod -Uri $importsUrl -ContentType $contentType -Method Post -Headers $header -Body $body&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;But I have this error :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Charline74_0-1663076184097.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/782764i17D8B7BCB61259B6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Charline74_0-1663076184097.png" alt="Charline74_0-1663076184097.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 13:36:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Import-Dataflow-in-Power-BI-Service/m-p/2764568#M38619</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-13T13:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Import Dataflow in Power BI Service</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Import-Dataflow-in-Power-BI-Service/m-p/2766300#M38634</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;POST https://api.powerbi.com/v1.0/myorg/groups/cfafbeb1-8037-4d0c-896e-a46fb27ff229/imports?datasetDisplayName=&lt;FONT color="#FF0000"&gt;model.json&lt;/FONT&gt;&amp;amp;nameConflict=Abort&amp;amp;skipReport=True&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This parameter should be hardcoded to model.json.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For more details, you can refer this link.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/imports/post-import-in-group#import-dataflow-model.json-example" target="_blank"&gt;Imports - Post Import In Group - REST API (Power BI Power BI REST APIs) | Microsoft Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 07:05:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Import-Dataflow-in-Power-BI-Service/m-p/2766300#M38634</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-09-14T07:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Import Dataflow in Power BI Service</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Import-Dataflow-in-Power-BI-Service/m-p/2766329#M38635</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/320777"&gt;@v-chenwuz-msft&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What do you mean when you write : "&lt;SPAN&gt;This parameter should be hardcoded to model.json." ?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried this script but it doesn't work : &lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/groups/cfafbeb1-8037-4d0c-896e-a46fb27ff229/imports?datasetDisplayName=model.json&amp;amp;nameConflict=Abort&amp;amp;skipReport=True" -Method Post&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error message :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;AVERTISSEMENT : The Body parameter was null, the request may be invalid when Method par
ameter is Post.
Invoke-PowerBIRestMethod : Une ou plusieurs erreurs se sont produites.
Au caractère Ligne:5 : 1
+ Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/gro ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], AggregateException
    + FullyQualifiedErrorId : Une ou plusieurs erreurs se sont produites.,Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 14 Sep 2022 07:13:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Import-Dataflow-in-Power-BI-Service/m-p/2766329#M38635</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-14T07:13:37Z</dc:date>
    </item>
  </channel>
</rss>

