Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create a dev token for import
- var devToken = PowerBIToken.CreateDevToken(workspaceCollectionName, workspaceId);
- using (var client = CreateClient(devToken))
- {
- // Import PBIX file from the file stream
- var import = await client.Imports.PostImportWithFileAsync(workspaceCollectionName, workspaceId, fileStream, datasetName);
- // Example of polling the import to check when the import has succeeded.
- while (import.ImportState != "Succeeded" && import.ImportState != "Failed")
- {
- import = await client.Imports.GetImportByIdAsync(workspaceCollectionName, workspaceId, import.Id);
- Console.WriteLine("Checking import state... {0}", import.ImportState);
- Thread.Sleep(1000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement