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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
andreadak
Regular Visitor

Web.Contents error : Access to the resource is forbidden

I'm trying to connect to a public open data web site for the PA governmental datasets.

One web page is https://www.italiadomani.gov.it/content/sogei-ng/it/it/catalogo-open-data/gare-del-pnrr.html

The page is accessible via browser without any permission requirement (anonymous access)  and from the page some files can be freely downloaded, for instance the Json file at link

https://www.italiadomani.gov.it/content/dam/sogei-ng/open_data_2024/PNRR_Gare-Dati_Validati_v3.json

 

However when I try to connect to the file with PQ module of PowerBI, I get the following error:

"Expression.Error: Access to the resource is forbidden"

This happens for all files that I tried to download from this site.

Can anyone help me understand how to solve the issue?

Many thanks

 

 

andreadak_0-1725624868660.png

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @andreadak ,

I've done some testing and found that there may be a setting on the site itself that prevents you from connecting to the site directly via the Web connection method or an M code such as Web.Contents to access the content therein.
I'm trying to connect directly to the Home page of the site using the Web Connector directly:

vjunyantmsft_0-1725850435601.png

But still the same error:

vjunyantmsft_1-1725850468399.png

If you can't even connect to the Home page, chances are that the site has disabled certain connectivity features.
If you need Power Query to connect to some of these files, you may need to download the file from the site first, and then use File.Contents to connect to the file you downloaded locally:

vjunyantmsft_2-1725850642979.png

vjunyantmsft_3-1725850663763.png


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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @andreadak ,

I've done some testing and found that there may be a setting on the site itself that prevents you from connecting to the site directly via the Web connection method or an M code such as Web.Contents to access the content therein.
I'm trying to connect directly to the Home page of the site using the Web Connector directly:

vjunyantmsft_0-1725850435601.png

But still the same error:

vjunyantmsft_1-1725850468399.png

If you can't even connect to the Home page, chances are that the site has disabled certain connectivity features.
If you need Power Query to connect to some of these files, you may need to download the file from the site first, and then use File.Contents to connect to the file you downloaded locally:

vjunyantmsft_2-1725850642979.png

vjunyantmsft_3-1725850663763.png


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

lbendlin
Super User
Super User

looks like that website is using a specific httpmanager script to prevent automated access.  Investigate if they offer an API instead.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.