Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello All,
I have a dillemma id like some asisstance with. I have the age old Web.Contents scheduled refresh issue when i build reports from a specific source (I pretty much only work with htis source.
I have the below M Code for the data
let
Source = Csv.Document(Web.Contents("Put Helm CONNECT CSV Connection String Here", [ApiKeyName= "apikey"]),[Delimiter=",", Encoding=65001, QuoteStyle=QuoteStyle.Csv]),#"Promoted Headers" = Table.PromoteHeaders(Source)
in
#"Promoted Headers"
But witht he above I subsequantly cannot refresh this on the service and the onlyw ay i could figure to make this work is via the below by addine api within the query
let
ApiKey = "your_api_key_here",
Url = "CSV String here&apikey=" & ApiKey, //keep the &apikey=
Source = Csv.Document(Web.Contents(Url), [Delimiter=",", Encoding=65001, QuoteStyle=QuoteStyle.Csv]),
#"Promoted Headers" = Table.PromoteHeaders(Source)
in
#"Promoted Headers"
But this obviousis not the most secure way pass the API key this way.
Does anyone have any better solutions i could try to be more secure witht he API key as Im not always the one witht he key so the ideal situation would be to prompt thd user to place the key in when they get the file to upload to there own service and it then allows scheduled refresh
I have done some research on the topic and mosta referencing the jscontents and some arent working for (inc the Skip test connection)
Hi @NathanV8
What error did you meet when using the first method with the parameter ApiKeyName in Web.Contents? According to the official document, this method seems to work. Web.Contents - PowerQuery M | Microsoft Learn
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 8 | |
| 7 |