<?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: Issue in importing Dataflow using Powershell in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Issue-in-importing-Dataflow-using-Powershell/m-p/923518#M22225</link>
    <description>&lt;P&gt;Found the workaround for this as we can't update Dataflows as of now&lt;/P&gt;&lt;P&gt;1. Delete the Dataflow,&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Delete the files from blob (if you have specific blob storage)&lt;/P&gt;&lt;P&gt;3. Recreate the Dataflow&lt;/P&gt;&lt;P&gt;4. Run the dataflow with full refresh&lt;/P&gt;</description>
    <pubDate>Thu, 06 Feb 2020 05:18:44 GMT</pubDate>
    <dc:creator>gauravkh</dc:creator>
    <dc:date>2020-02-06T05:18:44Z</dc:date>
    <item>
      <title>Issue in importing Dataflow using Powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Issue-in-importing-Dataflow-using-Powershell/m-p/830917#M21219</link>
      <description>&lt;P&gt;Problem:&lt;BR /&gt;I need to import Dataflow json using Powershell&lt;BR /&gt;I created a copy of my Dataflow json file with a separate name and able to import using Powershell&lt;BR /&gt;It is able to Create the copied Dataflow&lt;BR /&gt;But when I run the function on original Dataflow json file it returns with exception: "The remote server returned an error: (404) Not Found."&lt;BR /&gt;I'm using the following function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;function ImportDataflow([string]$GroupID, [string]$DataflowName, [string]$DataflowDefinition) {

    $UserAccessToken = Get-PowerBIAccessToken
    $bearer = $UserAccessToken.Authorization.ToString()
    
    $DataflowListurl = "groups/$GroupID/dataflows"
    $flowItems = Invoke-PowerBIRestMethod -Method GET -Url $DataflowListurl | ConvertFrom-Json
    $flow = $flowItems.value | Where-Object { $_.name -eq $DataflowName }
    
    if ($flow) {
        $CreateOrReplace = "&amp;amp;nameConflict=CreateOrOverwrite"
        Write-Host "Overwriting Dataflow: $DataflowName";
    } else {
        $CreateOrReplace = ""
        Write-Host "Creating new Dataflow: $DataflowName";
    }
    

    $url = "https://api.powerbi.com/v1.0/myorg/groups/$GroupID/imports?datasetDisplayName=model.json$CreateOrReplace"

    $boundary = [System.Guid]::NewGuid().ToString("N")
    $LF = [System.Environment]::NewLine
		
    $body = (
        "--$boundary",
        "Content-Disposition: form-data, name=`"model.json`" filename=`"model.json`"",
        "Content-Type: application/json$LF",
        $DataflowDefinition,
        "--$boundary--$LF"
    ) -join $LF

    $headers = @{
        'Authorization' = "$bearer"
        'Content-Type'  = "multipart/form-data; boundary=--$boundary"
    }
    
    Invoke-RestMethod -Uri $url -ContentType 'multipart/form-data' -Method POST -Headers $headers -Body $body
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FYI - I am clearing Partition entity from $DataflowDefinition before passing it to the function&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 08:44:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Issue-in-importing-Dataflow-using-Powershell/m-p/830917#M21219</guid>
      <dc:creator>gauravkh</dc:creator>
      <dc:date>2019-11-04T08:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in importing Dataflow using Powershell</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Issue-in-importing-Dataflow-using-Powershell/m-p/923518#M22225</link>
      <description>&lt;P&gt;Found the workaround for this as we can't update Dataflows as of now&lt;/P&gt;&lt;P&gt;1. Delete the Dataflow,&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Delete the files from blob (if you have specific blob storage)&lt;/P&gt;&lt;P&gt;3. Recreate the Dataflow&lt;/P&gt;&lt;P&gt;4. Run the dataflow with full refresh&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 05:18:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Issue-in-importing-Dataflow-using-Powershell/m-p/923518#M22225</guid>
      <dc:creator>gauravkh</dc:creator>
      <dc:date>2020-02-06T05:18:44Z</dc:date>
    </item>
  </channel>
</rss>

