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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
lelouchcccccc
Microsoft Employee
Microsoft Employee

Error while using PBI API to create data resources from Azure Analysis Service

Hi,

 

I was using the rest api https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources to add an Azure Analysis Service to my PowerBI gateway. I got an error 

"The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. " 
of the access token I passed in the credentials?
 
The JWT token is generated using Azure Analysis Server information, could anyone tell me how to solve it?
4 REPLIES 4
raghavm
Regular Visitor

@lelouchcccccc  -- Hi... Did you manage to fix this error? I have the same error for Updating datasource and would like to know the fix you applied for this. Thank you!

Anonymous
Not applicable

Hi, did you find an answer to this at all? Thanks

lbendlin
Super User
Super User

Look at the format of the bearer token here (click the "Try it"  button and log in).  This is how yours should be formatted too.

 

https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/getdatasource

Hi @lbendlin . This is the Authorization token for logging in, which I already used in the request header. The token failed is the one in the request body (credentials) 

https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/createdatasource

This is the referenced API

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.