Forum Discussion
ADLS Gen2 Power Query custom connector
Hi, Pawel_S
The issue you're encountering is due to the SAS token being included directly in the container URL. The AzureStorage.Blobs function is not expecting query parameters in the URL, and that's why you're seeing the error "The account URL should not contain query parameters".
You could use AzureStorage.DataLake(accountName as text, sasToken as text) function for your purpose.
This function creates a Data Lake Store data source that can be used as input to other functions like Value.NativeQuery or Table.FromPartitions. This function supports SAS tokens.
Here is an example on how you can use it:
let
accountName = "youraccount",
sasToken = "?sv=2019-10-10&ss=bfqt&srt=sco&sp=rwdlacupx&se=2025-04-14T03:21:54Z&st=2020-04-13T19:21:54Z&spr=https,http&sig=YOUR_SAS_TOKEN",
dataLake = AzureStorage.DataLake(accountName, sasToken),
contents = dataLake{[#"Folder Path"="containername/",#"File Name"="filename"]}[Content]
in
contents
In the above code, replace "youraccount", YOUR_SAS_TOKEN, "containername/", and "filename" with your actual account name, SAS token, container name, and file name respectively.
In your connector, you will need to ask the user for the account name, container name, file name and SAS token as parameters. You would then substitute these parameters into the code above to connect to the user's data. This should resolve your issue.
Remember to also handle cases where the user inputs are not valid or the requested data cannot be accessed with the provided SAS token.