Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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.
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?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 58 | |
| 56 | |
| 35 | |
| 18 | |
| 14 |