In this Azure article, we will discuss the solution for the error: “an error happened while reading data from the provider: ‘could not load file or assembly ‘system.enterpriseservices, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a’ or one of its dependencies. either a required impersonation level was not provided, or the provided impersonation level is invalid. (exception from hresult: 0x80070542)'”.
I could not connect to the Azure SQL database from Power BI, and I got this error.
Table of Contents
An error happened while reading data from the provider
Recently, I was trying to connect to Azure SQL database from Power BI, But after clicking on the connect button, I got this error. The complete error message was as below
An error happened while reading data from the provider: ‘Could not load file or assembly ‘System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)'”
You can see it here.

An error happened while reading data from the provider [Solution]
The solution for this issue is very simple. You need to make sure to run the Power BI Desktop application with Run as administrator mode and then try connecting the Azure SQL database from the Power BI Desktop again. The moment I did the same thing, I could successfully connect to the Azure SQL Database without any issues.
1. Right-click on Power BI Desktop and select Run as administrator mode.

2. Then try the same steps to connect the Azure SQL database from the Power BI Desktop application, and this time, you should be able to connect successfully.
You may also like following the articles below
- The ‘Set-AzSqlDatabase’ command was found in the module ‘Az.Sql’
- Cannot Open Server Requested By The Login Azure SQL
- Requested tenant identifier ‘00000000-0000-0000-0000-000000000000’ is not valid.
Voila! it is so easy to solve the error “An error happened while reading data from the provider: ‘Could not load file or assembly ‘System.EnterpriseServices”. If you are facing the same issue, you can simply follow the above-mentioned instructions to fix the same issue. Thanks for reading this article. I hope this information will help you.

I am Rajkishore, and I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machine, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.