Skip to main content
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

New Member

Extract archieve from url with SAML2 authentication



I'm tryning to extract an Excel archieve received as a url in my outlook using Power Query. I already managed to extract the link in the body of the email and create a new column containing the link. But when I try to get the file from the link I'm redirected to the Microsoft Online login page to log in my Copaign Page. The method of authentication is SAML2. How can i do this steps into power query?


This is my step code:  #"Carregar Planilha" = Table.AddColumn(#"Remover Colunas", "DadosPlanilha", each Excel.Workbook(Web.Contents([Link.Anexo]), null, true), type table)

New Member

I've informed the TOKEN and BI retorned the error message bellow:

(After run de code, I had to inform my microsoft online login and username)


Expression.Error: The 'AccountLoginName' header is only supported when connecting anonymously. These headers can be used with all authentication types: Accept, Accept-Charset, Accept-Encoding, Accept-Language, Cache-Control, Content-Type, If-Modified-Since, Prefer, Referer

Community Support
Community Support



You’ve already extracted the link from the email body and created a new column. Great job!
Now, let’s modify your existing step to include the access token:

#"Carregar Planilha" = Table.AddColumn(
#"Remover Colunas",
each Excel.Workbook(
Web.Contents([Link.Anexo], [Headers=[Authorization="Bearer YOUR_ACCESS_TOKEN"]]),
type table

Replace YOUR_ACCESS_TOKEN with the actual access token you obtained during authentication.

Similar post:

Solved: How to pull data from Web API into PowerBI using A... - Microsoft Fabric Community


By the way, the token will expire within a certain period of time, so be prepared.


Best Regards,

Stephen Tao


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Helpful resources

Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City


Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors