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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
bumoverflow
Frequent Visitor

Cosmos DB ResourceAccessForbiddenException

Hey everyone,

I have a table that queries Cosmos DB with custom SQL. When I refresh the view in Power Query everything's fine. But when I want to refresh entire datamodel, i've got following error message:

Microsoft.Mashup.Engine.Interface.ResourceAccessForbiddenException

 

What could be causing this issue?

1 ACCEPTED SOLUTION
bumoverflow
Frequent Visitor

Thank you for the response. The issue was caused by a User-Defined Function (UDF) in CosmosDB. While it executed correctly in the Data Explorer in Azure, it caused significant problems when used in Power Query. We removed this function, and now all data loads successfully.

The problem is resolved, but unfortunately, we do not know why the UDF caused this issue with the CosmosDB connector. Perhaps UDFs are buggy, which might explain why they are not available in version 2 of the CosmosDB connector

View solution in original post

3 REPLIES 3
v-pnaroju-msft
Community Support
Community Support

Hi bumoverflow,

 

We are pleased to hear that your issue has been resolved. Kindly mark the response that resolved your issue as the accepted solution. This will help other community members facing similar challenges to find solutions more efficiently.

Please continue using Fabric Community for any help regarding your queries.

Thank you.

bumoverflow
Frequent Visitor

Thank you for the response. The issue was caused by a User-Defined Function (UDF) in CosmosDB. While it executed correctly in the Data Explorer in Azure, it caused significant problems when used in Power Query. We removed this function, and now all data loads successfully.

The problem is resolved, but unfortunately, we do not know why the UDF caused this issue with the CosmosDB connector. Perhaps UDFs are buggy, which might explain why they are not available in version 2 of the CosmosDB connector

v-pnaroju-msft
Community Support
Community Support

Hi @bumoverflow,

We sincerely appreciate your inquiry through the Microsoft Fabric Community Forum.

Kindly follow the troubleshooting steps provided below to resolve the issue:

 

  • Ensure that the account accessing Cosmos DB has the necessary read permissions for the database and container.
  • Verify the connection settings in Power BI by navigating to File > Options and Settings > Data Source Settings, and ensure that the correct credentials are being used.
  • Re-enter the credentials, as doing so can often resolve underlying issues related to credential caching.
  • Confirm that the Power BI service IPs are whitelisted in the Azure Cosmos DB firewall.
  • Create a basic query in Power Query to verify if it refreshes successfully. This step will help in isolating the issue.

 

If you find the response helpful, we kindly request you to mark it as the accepted solution and provide kudos. This will greatly assist other community members facing similar issues.

 

Thank you.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.