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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
villasenorbritt
Resolver I
Resolver I

API Request Blocked by Keyblocker

I am getting an error when trying to push data into Bi from SQL via Powershell. It says that ""The request was blocked by Keyblocker". I tried limiting my query to under 10,000 rows with no luck. Here is my code:

 

(PowerShell)

$dataSource = '******' #Server Name
$userName = '****** ' #SQL User Name
$password = '*********' #SQL User Password
$database = '*******' #Database Name

$connectionString ="Server=$dataSource;Database=$database;trusted_connection=false; user id =$userName;Password=$password;Integrated Security=False"
$connection = New-Object System.Data.SqlClient.SqlConnection
$connection.ConnectionString = $connectionString
$connection.Open()

$query = '  
  SELECT [data],[datetime], [id], [source_id] FROM [dbo].[vwResawLine2FPM] 
  '
$command = $connection.CreateCommand()
$command.CommandText = $query
$dataset = $command.ExecuteReader()
#paste the endpoint URL which you have inside Power BI
$endpoint = "ENDPOINT"
#push data to Power BI 
while ($dataset.Read()) {
    $payload = @{
                "data" =$dataset['data']
                "datetime" =$dataset['datetime']
                "source_id" =$dataset['source_id']
		"id" =$dataset['id']
    } 
    Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo-Json @($payload))
}
$connection.Close();
$connection.Dispose();

 

 

I am hoping someone here has an indication of the issue. Basically, there is not much online explaining what this issue could be outside of the info found in the normal documentation, and I believe I have abided by the API limitations. 

2 REPLIES 2
v-yueyunzh-msft
Community Support
Community Support

Hi , @villasenorbritt 

According to the error message you encounter, it seems that your API request is blocked by the policy of your network environment or the firewall on the data source side, because as far as I know, there is generally no firewall setting on the Power BI side that will block the request, you can refer to a few similar cases and contact your company's network administrator to do some troubleshooting:

API - Keyblocker - Microsoft Power BI Community

Getting "The request is blocked" when accessing Po... - Power Platform Community (microsoft.com)

Vague "The request is blocked" when navigating to website - - Microsoft Community

 

Best Regards,

Aniya Zhang

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

I am being told this error could also be due to me being rate limited when usign the API. Would you know any good resources for how to change my script so that it pipes everything into a variable as opposed to making so many API calls?

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.