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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Web.Contents failed to get contents from web when authentication is required

Hi there, 

 

I've been having the following issue when importing web data into PowerBI desktop:

 

I'm trying to source data from a website (https://.../content/126/data.csv), where I can set up access controls over my csv files. When I set my dataset to 'public - no authentication required', the data is imported without issues -so I know the URL is working fine. However, since the data I'm planning on using is usually sensitive, I need to restrict access to authenticated users only (within my organisation). 

After a bit of tinkering, the authentication credentials for the website have been set up correctly in Data Source settings as  Windows > Use alternate credentials).

I then go to Get Data > From Web > URL: https://.../data.csv, and the data preview displays the data correctly (this is how I know that the credentials work):

ayleono_3-1632801366137.png

But when I go on to import the dataset, I get a '404 - not found' message:

ayleono_2-1632800994549.png

PowerQuery seems to be failing at the last step (the Web.Contents functions I presume), but not quite sure what the issue is, or how I can fix this - if the issue was the URL, or the credentials, it would fail before the preview. I've looked and looked online for answers to no avail, so any help would be much appreciated! 

 

ayleono_1-1632800361343.png

 

ayleono_0-1632800242656.png

Thank you,

 

Rodrigo

Status: New
Comments
v-robertq-msft
Community Support

Hi, 

Before you use this URL to connect to the Power BI, I suggest you to check if you can access this website using the URL in your browser and check if you need any credential to access the content in the website.

 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

ayleono
Regular Visitor

Thanks for the reply, @v-robertq-msft. Let me provide a bit more detail:

 

The URL is my organisation's online publishing platform (R Connect). To answer your question, I do require authentication to log onto R Connect, however I can set up the  persmissions for each dataset:  

ayleono_0-1632981913424.png

Now onto the different scenarios:

1. Dataset access is 'Anyone - no login required'

As i mentioned in the original post, if I set my test dataset to 'Anyone - no login required', PowerBI imports the dataset without issues (Get Data > Web)

If I type the file URL (https://rconnect.xxxxxxxxxx/content/126/data.csv) directly in the browser, it downloads it automatically.

 

2. Dataset access is 'All users -  login required'

When I set the file to 'All users - login required', the data import fails, even though the data preview displays the data correctly.

 If I go on incognito mode on my browser and type the full URL (https://rconnect.xxxxxxxxxx/content/126/data.csv) I get the following error:

 

ayleono_1-1632982042767.png

So, my issue is that, requiring authentication is non-negotiable for my use case (the data contains sensitive personal and commercial information so I cannot leave it open). And since the data preview is displaying correctly when authentication is required, this makes me think that the issue happens somewhere in the PowerQuery / Web.Content function between the preview and the load...

 

Thanks again!

 

Rodrigo

v-robertq-msft
Community Support

Hi, 

If you want to get a solution for this kind of connection problem as soon as possible, I suggest you to open a support ticket to get direct help from the technical support team of Microsoft.

https://community.powerbi.com/t5/Community-Blog/How-to-create-a-support-ticket-in-Power-BI/ba-p/6830...

https://powerbi.microsoft.com/en-us/support/

 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

mathewnamanda
New Member

the issue is the datatype kindly convert it into a format to higher type for my case whole number to decimal number