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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
brunozanoelo
Post Patron
Post Patron

response.StatusCode=500 InternalServerError

            if (File.Exists(pbixFilePath) == true)
            {
                //DeleteImport(workspace.id, NomedoCubo);

                string restUrlImportPbix = "https://api.powerbi.com/v1.0/myorg/groups/" + workspace + "/imports?datasetDisplayName=" + NomedoCubo + "&nameConflict=CreateOrOverwrite";
                var pbixBodyContent = new StreamContent(File.Open(pbixFilePath, FileMode.Open));

                pbixBodyContent.Headers.Add("Content-Type", "application/octet-stream");
                pbixBodyContent.Headers.Add("Content-Disposition",
                                             @"form-data; name=""file""; filename=""" + pbixFilePath + @"""");


                MultipartFormDataContent requestBody = new MultipartFormDataContent(Guid.NewGuid().ToString());
                requestBody.Add(pbixBodyContent);

                HttpClient client = new HttpClient();
                client.DefaultRequestHeaders.Add("Accept", "application/json");
                client.DefaultRequestHeaders.Add("Authorization", "Bearer " + AccessToken);


                Console.WriteLine("Enviando Cubo: " + NomedoCubo);
                var response = client.PostAsync(restUrlImportPbix, requestBody).Result;

                //  Check de Sucesso
                if (response.StatusCode.ToString().Equals("Accepted"))
                {
                    Console.WriteLine("Processo de Importação efetuado com Sucesso: " + NomedoCubo);
                }
                else {
                    Console.WriteLine("Processo com erro: " + response.StatusCode);
                }
            }
            else {
                Console.WriteLine("Arquivo não encontrado." + NomedoCubo); 
            }

I´m receiving InternalServerError for all my tenant customers. It´s strange because I was using last month andit was workin percfectly. Did anyone found the same problem?

1) I have pro license.
2) It was working properly.

3) My code is the same.

0 REPLIES 0

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.