Azure Cloud Service + SQL Azure and firewall configuration issue - azure-sql-database

I'm facing the issue while creating a azure database in the local machine by sql server 2012 ,
this is my error:
TITLE: Connect to Server
Cannot connect to tcp:ServerName.database.windows.net.
ADDITIONAL INFORMATION:
Login failed for user 'UserName'.
This session has been assigned a tracing ID of '041a1130-65a5-4ad6-91c0-02ff3b4fbca5'. Provide this tracing ID to customer support when you need assistance. (Microsoft SQL Server, Error: 18456)

The issue is occurring might be due to following the following, I have specified how to overcome against each issue:
Check if your IP is added in the firewall, if not refer to http://msdn.microsoft.com/en-us/library/azure/jj553530.aspx
Check if you have configured the wrong IP in Azure Firewall. Try opening SQL Azure Management Studio online http://msdn.microsoft.com/en-us/library/azure/ee621784.aspx#WinAzMgtPort where it asks you to add the IP in firewall.
If above is not working then check if the user credentials is correct, if you forgot the credentials then resetting it might help.

Related

unable to connect to azure sql server from vsts

I am trying to deploy test.dacpac file using vsts to azure sql server, Given connection details properly and it is getting connected if I try to connect it from visual studio.
But when it tries to deploy file using vsts, gets error message -
A network-related or instance-specific error occurred while
establishing a connection to SQL Server azure
Not sure why this is happening.
Note: There is no firewall rule applied, it has default settings, though the virtual machine on which VSTS agent is installed is in another Azure AD subscription.
Do I have to look into VPN for this?
Please use the FQDN for database name instead of the IP address. e.g. myAzureSQLDB.windows.database.net.
You need to configure Azure SQL Database firewall. Make sure "Allow access to Azure Services" is turned on. If that does not work, then try adding firewall rule 0.0.0.0 to 255.255.255.255.

TFS Configuration Error

I am facing a problem that when i try to configure my TFS it show me the following Error Message
Error
TF255049: A connection cannot be made to the server that is running SQL Server. Verify that you have entered the correct name for the server, including the instance name, that the server you are attempting to connect to is online, and that you have the required permissions to connect. If you are attempting to connect to the remote SQL Server instance, then verify that it is configured to allow remote connections, that TCP/IP protocol is both enabled and configured to use port 1433 (default), and that Windows Firewall does not block this port.
Check whether the SQL version is supported by the TFS version: https://www.visualstudio.com/en-us/docs/setup-admin/requirements#sql-server
Check the permission of the account that you use, and make sure it belongs to SysAdmin Server Role.
As #Daniel mentioned in comment, follow the troubleshooting steps provided in the error message, and check this blog to see whether it is helpful: https://elhajj.wordpress.com/2013/02/25/workaround-error-tf255049-punching-a-hole-through-windows-firewall/
I was running an upgrade from TFS 2018 to Azure DevOps 2020.
After the server restart, the Azure DevOps Server Configuration wizard opened.
I was logged in as the local machine administrator and got this error (TF255049: A connection cannot be made to the server that is running SQL Server...) when trying to connect to my SQL Server machine (to chose the configuration database).
I logged in as Network Administrator, started the wizard again and the SQL connection worked.
To restart the Azure DevOps Configuration Wizard again...
Open the Azure DevOps Administration Console and choose Configure Installed Features to open the Server Configuration Wizard...

Unable to connect to SQL Azure remotely from SSMS 2012

I am unable to connect to my SQL Azure database instance remotely using SQL Management Studio 2012. Firewall exception is in there for my local IP. I can connect successfully and admin the database using the browser based management link in my Azure account.
I just can't seem to connect to the database via SSMS or anything else like VS2012.
Here is the format I'm for my connection in SSMS:
Server Name: myservername.database.windows.net
Authentication: SQL Server Authentication
Login: myusername#myservername
Password: my-password
Connect to: (i've tried) "master", mydatabasename, <default>
Encryption: TRUE
Once again, I DO have the firewall rule active for my local IP address on the server instance of my Azure account.
When I attempt to connect, I receive this error:
A connection was successfully established with the server, but then an
error occurred during the pre-login handshake. (provider: SSL
Provider, error: 0 - the wait operation timed out.) (Microsoft SQL
Server, Error: 258)
When searching for that 258 error, I do not get many results related to SQL Azure. I appreciate any help.
Error 258 is generated due to some of the configuration within your machine if a secure network could be established between two endpoints and if one machine initiate secure channel. This problem could be very much machine specific and not SQL specific that why you did not find any resources on this regard.
Can you try using SQLCMD as described in the following troubleshooting guide and see if that works to isolate SSMS specific issues on the same machine:
http://social.technet.microsoft.com/wiki/contents/articles/1719.windows-azure-sql-database-connectivity-troubleshooting-guide.aspx
IF you capture and analyze network packets traffic you might be able to determine the root cause of connectivity error.

Need help with remote SQL server. some to do with Azure Portal

I was supposed to set up a localhost for a user. But it turned out that the website is on an SQL server and not MySQL.
I installed wamp and the website runs fine. But wherever there is a database connection, it tries to connect to the remote server, which doesn't give access. I have some visual studio and configuration files and what not. And I am clueless about what to do.
The website on the localhost tries to connect to the remote server, but i get this message:
"Could not connect. Array ([0] = ... Login failed for user '####'... cannot open server '########' requested by client. client with ##### IP is not allowed to access this server. To enable access, use the SQL Azure Portal or run sp_set_firewall_rule on master database..
I also have this bit of code in the connection file, that i think shows that the database is hosted on this website:
$srver = "http://########.cloudapp.net/";
Any help will be appreciated!
When you configure SQL Azure, you can specify what the allowed IP addresses are. As the error message indicates, the requesting IP is not authorized to access that database.
How to: Configure the SQL Azure Firewall
SQL Azure Firewall

SQL Azure : Connection to SQL Azure throws exception

When I connect to SQL Azure from my code, I get the following error.. I am able to connect to SQL Azure from SQL Server Management Studio successfully.
System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The requested name is valid, but no data of the requested type was found.)
I also tried connecting using sqlCMD and that connects without any issue. Only issue arises is during runtime when I get this exception.
You might also want to check to make sure your firewall allows outbound connections on port 1433.
There can be numerous reasons for this failure, I am listing out the scenarios and the options that needs to be allowed on the server.
If you are connecting an Azure SQL Instance using Sql server management studio while inside you company's network/firewall, first of all you will need to check if your company's firewall rules allow that or not.
On the AZURE SQL Server, make sure your IP address is in the allowed list.
I believe you just need to tick the checkbox "Allow other Windows Azure services to access this server" in Firewall Rules on your SQL Azure account (this will allow connecting to the db server from your deployed Azure application). Hope this helps.
It would be helpful if you post your connection string here. Also a sample app on connecting to sql azure using ado.net: http://msdn.microsoft.com/en-us/library/windowsazure/ee336243.aspx
Makesure you pay attention to the SqlConnectionStringBuilder properties.
If you have your IP added into firewall rules and allowing SQL
connection to Azure Services Enabled. It should work fine!