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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
CESAR_OLIVEIRA9
New Member

Extract archieve from url with SAML2 authentication

Hi!

 

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)

2 REPLIES 2
CESAR_OLIVEIRA9
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

v-stephen-msft
Community Support
Community Support

Hi @CESAR_OLIVEIRA9 ,

 

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",
"DadosPlanilha",
each Excel.Workbook(
Web.Contents([Link.Anexo], [Headers=[Authorization="Bearer YOUR_ACCESS_TOKEN"]]),
null,
true
),
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

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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