question

OriOfek-6456 avatar image
0 Votes"
OriOfek-6456 asked KlodiD-4050 answered

Connection Problems When Deploying SQL DB To Azure DB

I have created a new Azure account to publish my web app + DB.
I have created the app service, service plan, SQL Server and SQL DB,
I have also configured the Azure sql server firewall to accept request from my client IP.

WHAT'S WORKING
When I'm using the connection string for the Azure DB in my local server explorer (In Visual Studio and SQL Server Management Studio) I can see the server and the DB and all is OK. TEST CONNECTION also works fine.
Also - I can publish my web app to Azure and it is successful.

WHAT' NOT WORKING

Only when I am trying to publish/deploy my local DB to Azure I keep getting the same connection error:

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

I Get this message either when trying to connect from the Visual Studio DB Publish Window, And also when trying to export the data directly from SSMS using BACPAC...

Is there any way to fix this?

azure-sql-databaseazure-webapps
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @OriOfek-6456, I was successfully able to publish a SQL Server Project in Visual Studio to a SQL Azure database. Did you save your publish file? If so, to start, I would double check the connection string. SQL Server Object Explorer may be using a separate connection from your publish profile. In checking the troubleshooting guide and these steps, another possibility is that your client ip is changing and you need to update your firewall settings.

17503-2020-08-13-13-55-46-sql-todo-microsoft-visual-stud.png


0 Votes 0 ·

1 Answer

KlodiD-4050 avatar image
0 Votes"
KlodiD-4050 answered

Hello,

The error (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified) appear mostly while trying to connect to a SQL Server named instance and not when you use default instance. The client stack could not receive SSRP response UDP packet from SQL Browser.


Some fast steps to troubleshoot this error:

Recheck the server name for any error and fix it
Check the instance name for any error
Check if SQL Server browser is running
Control if this instance exist on server
Ping the server and check if DNS can be resolved correctly

Also you can follow the following article here to troubleshoot the error step by step.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.