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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Importing a large pbix via Post Import In Group

I am struggling with the rest api and i'm hoping i'm just missing something.  I am able to post to the import endpoint and publish a file using the .net client

var upload2 = await client.Imports.PostImportWithFileAsyncInGroup(groupid, fs, "test");

 

works great.  Now when i try and use the temporary file location for a large file i keep getting 400 bad request errors.

 

            var temp = await client.Imports.CreateTemporaryUploadLocationInGroupAsync(groupid);


            var fs = new FileStream("xxxxx.pbix", FileMode.Open,FileAccess.Read);
            fs.Position = 0;
            await saveBlob(temp.Url, fs);
            var importdetails = new Microsoft.PowerBI.Api.V2.Models.ImportInfo
            {
                //ConnectionType = ConnectionType.Import
                FileUrl = temp.Url,
                //FilePath = string.Empty
            };

            var upload = await client.Imports.PostImportInGroupAsync(groupid, "testpositions", importdetails);

The create of the tempfile works and the upload of that file is successful. Here is the raw request

 

POST https://api.powerbi.com/v1.0/myorg/groups/[groupid removed from sampl]/imports?datasetDisplayName=testpositions HTTP/1.1
Authorization: Bearer [removed from sample]
User-Agent: FxVersion/4.6.27414.05 OSName/Windows OSVersion/Microsoft.Windows.10.0.15063. Microsoft.PowerBI.Api.V2.PowerBIClient/3.4.0.19204
Content-Type: application/json; charset=utf-8
Content-Length: 315
Host: api.powerbi.com

{
  "fileUrl": "https://wabincuspbiv2p1.blob.core.windows.net/d331431b-899c-4666-8094-e82e6bfc3964/a7634353-a598-4420-b125-6b55801d2baa/Import/00a33942-a321-476c-8718-c27a0b2d8f02?sv=2015-04-05&sr=b&sig=pF8MdpeBu3mhyi8LPSQlNP6V63iUgMpaKFXVbEoNsiY%3D&st=2019-08-15T16%3A22%3A19Z&se=2019-08-16T16%3A27%3A19Z&sp=w"
}

I've tried ever combination of parameters in the post but always get back

 

HTTP/1.1 400 Bad Request
Content-Length: 0
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Frame-Options: deny
X-Content-Type-Options: nosniff
Access-Control-Expose-Headers: RequestId
RequestId: 54c996a6-217b-40ef-ae39-da47e450a04b
Date: Thu, 15 Aug 2019 16:27:19 GMT

Does anyone have a sample successful post call to imports using the fileURL parameter?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Turns out the api handles large files automatically.  Just need to use the 

.PostImportWithFileAsyncInGroup

and it detects if the file is over 1gb.  Very nice 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Turns out the api handles large files automatically.  Just need to use the 

.PostImportWithFileAsyncInGroup

and it detects if the file is over 1gb.  Very nice 

Anonymous
Not applicable

i know this is old but im looking at this exact issue right now. so for files over a gig i can still just upload the raw file using PostImportWithFileInGroup and dont have to upload to a temporary location first?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.