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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
michael_mcclari
Regular Visitor

unable to authenticate invoked function

Hi, I am unable to authenticate when trying to invoke a function. See my code below:

 

 

(page as number) as table =>
let
    Source = Web.Page(Web.Contents("https://mycompany.atlassian.net/rest/api/2/search?jql=created%20%3E%20startOfMonth()&maxResults=100&startAt=" & Number.ToText(page) & "00")),
    Data1 = Source{1}[Data],
    RemoveBottom = Table.RemoveLastN(Data1,3)
in
    Data1

I have tried clearing credentials under Data Source Setting. 

 

The strange thing is that when trying to invoke this function from a custom query, I call this query and it works fine in there. See code below:

let
    url = "https://mycompany.atlassian.net/rest/api/2/search?jql=created%20%3E%20startOfMonth()&maxResults=100",
    query = Json.Document(Web.Contents(url)),
    total = query[total],
    maxResults = query[maxResults],
    N = total / maxResults,
    M = Number.RoundDown(N),

    Source = {1..M},
    ToTable = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    Renamed = Table.RenameColumns(ToTable,{{"Column1", "Page"}}),
    Added = Table.AddColumn(Renamed, "Custom", each GetData([Page]))
in
    Added

Everything returns correctly all the way until "Added". Seems there is a special way to do basic authentication when calling from a function.

 

Please help.

 

0 REPLIES 0

Helpful resources

Announcements
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.

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.