Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure SQL Login Denied, error 18456 state 113

We have an Azure SQL server. From some machines in our Azure subscription we cannot connect to our SQL server, but from other machines it's fine. From machines outside of Azure we have no issues at all.

The error thrown is

Login failed for user 'SQLAdminUser'

And the SQL log itself shows:

<login_information><error_code>18456</error_code><error_state>113</error_state></login_information>

Reproduction is very simple. From an affected machine, in Powershell, execute:

$sqlConnection = New-Object System.Data.SqlClient.SqlConnection  "Server=tcp:ourdb-sql.database.windows.net,1433;Initial Catalog=SitesEE;Persist Security Info=False;User ID=SQLAdminUser;Password=[password]"
$sqlConnection.Open()

Exception calling "Open" with "0" argument(s): "Login failed for user 'SQLAdminUser'."

I don't see Error 113 documented anywhere on the official documentation. I'm assuming it's related to a VM somehow as other machines can execute that code without issues.

like image 458
Mark Henderson Avatar asked Nov 21 '18 06:11

Mark Henderson


1 Answers

After a support call with Microsoft, they confirmed that Error 113 is a temporary firewall ban of the connections IP address.

We had a process that had an invalid password configured, and it got enough attempts wrong that the IP address got on a ban list. It kept retrying, so it stayed on the ban list. Every VM that used that outbound IP address was thus also banned.

Fixing the errant process cleared the ban within a matter of minutes.

Documenting that here in the hope that it can save someone else the hassle of opening a support ticket to find out something that should be public documentation.

like image 101
Mark Henderson Avatar answered Nov 01 '22 14:11

Mark Henderson