0

I'm looking to post a PBIX file up to a workspace through the .NET API using the PostImportWithFile method of the PowerBiClients Imports object. The code is pretty much identical to that seen in option 6 of the Provision Sample (see https://github.com/Azure-Samples/power-bi-embedded-integrate-report-into-web-app/blob/master/ProvisionSample/Program.cs).

There is a workspace collection and a workspace that have been created. The workspace was created through code using the relevant API methods so I know that the authentication side of things is working correctly.

When I call the PostImportWithFile method I'm getting a BadRequest exception being thrown. To verify that this wasn't something to do with my code I've compiled and run the ProvisionSample and selected option 6 and selected the same file and received the same result.

I'm supplying null for the dataset parameter, which is optional and defaults to null anyway, so I can't see this being the cause of my issues.

I've been unable to find anything online regarding this method and a BadRequest so was wondering if there was anyone with experience with this API that had run into something similar?

The PBIX file works fine through Power BI Services, so I'm assuming nothing is wrong with the file.

4

1 に答える 1

2

ドキュメントhereに基づいて、データセット名を指定する必要があるように見えますが、オプションではないようです。

public static Task<Import> PostImportWithFileAsync(
this IImports operations,
string collectionName,
string workspaceId,
Stream fileStream,
string datasetDisplayName,
Nullable<int> nameConflict = null,
CancellationToken cancellationToken = null)

ここの非非同期バージョンも、datasetdisplayname がオプションではないように見えます。

お役に立てれば。

于 2016-08-17T13:03:35.403 に答える