The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
Data refresh works fine in PBI Desktop but fails in the PBI Service.
My aadToken query:
let
Source = (TenantId as text, ClientId as text, ClientSecret as text, Resource as text) =>
let
aadRequest = [
grant_type = "client_credentials"
,client_id = ClientId
,client_secret = ClientSecret
,resource = Resource
],
aadContent = Text.ToBinary(Uri.BuildQueryString(aadRequest)),
aadTokenRequest = Web.Contents("https://login.microsoftonline.com/",
[
Headers = [#"content-type"="application/x-www-form-urlencoded"],
Content = aadContent,
RelativePath=TenantId & "/oauth2/token"
]
)
,aadTokenJSON = Json.Document(aadTokenRequest)
,aadToken = aadTokenJSON[access_token]
in
aadToken
in
Source
my GetFacilities query:
let
Source = (aadToken as text, opcSubscriptionKey as text) =>
let
customersRequest = Web.Contents("https://apis.collabor8.no",
[
Headers = [
#"Method"="POST",
#"Authorization"="Bearer "& aadToken ,
#"Content-Type"="application/json",
#"Ocp-Apim-Subscription-Key" = opcSubscriptionKey
],
RelativePath = "/stable/graph",
Content=Text.ToBinary(
"{""query"":""query{
metadata {
facilities{
name
id
}
}
}""}")
]
),
#"customers" = Json.Document(customersRequest)
in
#"customers"
in
Source
I call the aadToken inside my data query:
let
Source = aadToken(),
Custom1 = GetFacilitiesType(Source, "aa03071324654b71166de3cb58d"),
data = Custom1[data]
in
data
It works fine in the PBI Desktop with Anonymous connection, but when I published it to the workspace I got error 404 when I connect to the API anonymously, even though I'm connecting to the root path and already use the relative path.
Any help? Thanks!
Hi @Anonymous ,
You could check the Issues forum here:
https://community.powerbi.com/t5/Issues/idb-p/Issues. If it is not there, then you could post it.
And you could try to open a support ticket. It is free if you have a Pro account.
Go to https://support.powerbi.com. Scroll down and click "CREATE SUPPORT TICKET".
Best Regards,
Jay
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
51 | |
42 | |
23 | |
23 | |
18 |