Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
Could someone help me understand how to use "set-cookies" in power query. I've been trying this from a long time but do not have any success. I do not see any documentation that could guide me. I've looked at pretty much all the mentions of cookies in the community and none of it helped.
Here is my code:
let
request = Web.Contents("https://domain/api/cookie", [Headers=[#"Authorization"="Bearer "&Access_Token("password","token","code")[access_token]]),// Only this gets me the response as abc.domain.com
//response = Json.FromValue(request),
//converttojson = Json.Document(response)
body = Json.Document(request),
result = if (Record.HasFields(body, {"error", "error_description"})) then
error Error.Record(body[error], body[error_description], body)
else
body
in
result
I'm not sure how to use "set-cookies" in the above code as the way it is being used in the below code:
---> var cookie = "";
---> var headersForCookie = {
"Host": "abc.domain.com",
"Authorization": "Bearer "+ token
}
request({
"url": "/api/cookie",
"method": "GET",
"headers": headersForCookie
})
in = (err, res, body){
print of// this is a very important step of verification: JSON.docume(res.headers["set-cookie"])}
cookie = res.headers["set-cookie"];
I would really appreciate some help on this.
Hello Team
I'm still chasing for the information on cookies. I would appreciate any response.
Its been quite some time and I'm still trying to get information on this. I know we would go out of vacation soon or some would already be on vacation. I would appreciate any inputs before we all head out to our vacation.
Wishing you all happy holidays.
@dm-p Thank you for the response. Unfortunately, I don't have a pro account to submit a ticket and from our organisation it might not be possible to get a pro account. Hence, I've been running back and forth in the community here and other places on the internet.
I've looked at the references you have shared and unfortunately, they haven't helped. However, I appreciate your response.
Does anyone have any inputs on this. I would appreciate any response.
Hi @Anonymous,
From the looks of things, you've mined all existing community content and come up with no further solutions. I suspect that if someone would have figured this out within the community, it would have been shared and searchable in some capacity, as it would be pretty valuable for a lot of people. I would say that if Chris Webb doesn't have a post about it then it's probably not a thing (here's his power query post archive if you want to take a look).
There is some support for authorisation/session handling in custom connectors, but I believe that this is currently all that's possible at present. I don't do any work in this area so can't advise further but there might be something in that documentation that might be able to help you, if you haven't tried it already.
If you're at your limit with the community resources, have you tried opening a support ticket with Microsoft to get an official answer? If you have a pro subscription, support is free.
I personally haven't got this to work in Power Query. In my case, I ended up writing an Azure Function to abstract the logic to a C# endpoint, which would handle this part and return the results to Power Query, effectively wrapping the web API and making it a simple HTTP request for Power Query. The function cost nothing to host and run as the workload could be handled under the consumption plan, and maybe a few hours of my time to write the code. If you're familiar with C#, JS/TS, Python, PHP, Java or PowerShell then these can be a cheap, quick and secure way to manage these kinds of issues, if you haven't considered them.
Good luck,
Daniel
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
@Team I've explored everything there is on the internet about cookies using power queries. There is very limited or no information. There have been a very few posts in the past about cookies asking different questions. Looks like a handful of connector might have tried using cookies so far but there is no concrete information online. Could someone from the Microsoft Team, let me know if there is a way to use cookies in Power Query.
If someone from the community has done it, I would appreciate your inputs.
Any help on this would be appreciated. I don't seem to have any alternative to understand this than reaching out to the community.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
6 | |
1 | |
1 | |
1 | |
1 |