This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello, i am having trouble doing basic authentication within a function. Please see my code below:
GetData
(page as number) as table =>
let
Source = Web.Page(Web.Contents("https://my_company.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
Data1The funny thing is that I have no trouble doing basic authentication with the exact same URL in another query that uses this function, except when it calls the function.
Page
let
url = "https://my_company.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"}}),
//Everything works fine including authentication to "url" on line 2 but fails when it calls "GetData" on the next line
Added = Table.AddColumn(Renamed, "Custom", each GetData([Page]))
in
AddedSeems Basic Authentication works differently when in a function.
Any assistance would be greatly apprecaiated.
Regards,
Mike
Having the same problem. Does anyone know why Basic Authentication fails when WebContents is called within a function?
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |