Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
We are trying to call one of our api to generate access token for one of our automation work.
Using below configuration.
When I connect, its failing with Datasource error. (in power bi)
But the same service is retuning response access token from postman or even with desktop app.
Any suggestions on this will be much appreciated.
Hi @bickychoudhary ,
any chance you can whitelist the domain name instead?
Not sure that powerbi.com runs under one dedicated IP address.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @bickychoudhary ,
if its the same query than in PBI, then I'm afraid I am running out of ideas here.
Looks like a bug.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @ImkeF , Thanks for your thoughts,
Is there any method for retrieving the IP address of the Power BI cloud service? I attempted a GET request to another service using the query, and it provided a response. I have a suspicion that the service "https://api.apm****.com" may be limiting calls from Power BI, so we might need to add the Power BI cloud's IP address to the whitelist.
Hi @bickychoudhary ,
have you copied the query over from PBI Desktop or could it be that you have a typo in row 8:
acessAuth instead of accessAuth?
Otherwise: Any more hints if you click on "Show Details" in the error-message?
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @ImkeF
I am using pwerbi cloud - i.e, https://app.powerbi.com/ ,
The query is working fine on the desktop app, but when I try to call the service from power bi cloud, Looks like its unable to make the call to the rest api for generating the token's.
Below is the query i am try to hit.
let
Url = "https://api.apm****.com",
credentials =
[
client_id = "E5eUI7PBFfVLuKrJHhyw**",
client_secret = "Iu3Ih9eQ**"
],
acessAuth =
Json.Document(Web.Contents(
Url,
[
RelativePath = "oauth/client_credential/accesstoken",
Query =
[
grant_type = "client_credentials"
],
Headers =
[
#"Content-Type"= "application/x-www-form-urlencoded"
],
Content = Text.ToBinary(Uri.BuildQueryString(credentials))
]
)
),
token = acessAuth[access_token]
in
token
Check out the July 2025 Power BI update to learn about new features.