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
Armand_Theron
Frequent Visitor

Rest API Export Report to PDF that uses Azure Analysis Service as a data set

Hi;

I'm using the Rest API Call : POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}/ExportTo.

 

I can successfully export a pdf report if the data is stored in PowerBI.

 

When I try to export a report to PDF that uses Analysis Service as it's Data Source
I then get the following Error : Export report requires effective identity to be provided for the report's data set.

 

What I have set up :
1. Premier Workspace where the PowerBI report is published
2. Followed the instructions to create a service principal and add it to power bi : https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal
3. The Service Principal has been added to the Azure Analysis Service Server as an Administrator
4. The Service Principal has been added to the Azure Analysis Service Database to a Role that has admin rights
5. Generate a Oauth Token :

grant_type:client_credentials
client_id: {My Client ID Generated in step 1}
client_secret:{Client Secret Generated in Step 1}
scope:openid
resource:https://analysis.windows.net/powerbi/api

6. Use the token received to call the Rest API Post Action : https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}/ExportTo


Is there something else that needs to be done in order to allow the generation of the pdf when the data set is from a analysis service database ?

 

Thanks in Advance

1 ACCEPTED SOLUTION
Armand_Theron
Frequent Visitor

Hi;

 

 

    Just an update on the solution.

    It seems to pass the effective identity one needs to add the following into the body :

   

{

    "format": "pdf",

    "powerBIReportConfiguration": {

        "identities": [

            {

                "username": "{ ServicePrincipal Object ID }",

                "roles": [

                    "{Role in AAS}"

                ],

                "datasets": [

                    "{datasetID}"

                ]

            }

        ]

    }

}

 

*Just also note as per the MS documentation that one needs to pass in the Service Principal object id and not the service ServicePrincipal app id

View solution in original post

1 REPLY 1
Armand_Theron
Frequent Visitor

Hi;

 

 

    Just an update on the solution.

    It seems to pass the effective identity one needs to add the following into the body :

   

{

    "format": "pdf",

    "powerBIReportConfiguration": {

        "identities": [

            {

                "username": "{ ServicePrincipal Object ID }",

                "roles": [

                    "{Role in AAS}"

                ],

                "datasets": [

                    "{datasetID}"

                ]

            }

        ]

    }

}

 

*Just also note as per the MS documentation that one needs to pass in the Service Principal object id and not the service ServicePrincipal app id

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.