Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
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?
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 11 | |
| 11 | |
| 5 | |
| 4 | |
| 4 |