Azure Web App Error, No such host is known

5

When Running the web App locally there is no issue to connect to the DB,

after deploying the Web App to Azure the DB(Also Azure) connection attempt throws the following error:

[Win32Exception (0x80004005): No such host is known]

[SqlException (0x80131904): 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 - No such host is known.)]

The DB FW Settings: Allow access to Azure services: is set ON

Any Idea on how I can trouble shoot/ Resolve this issue?

asp.net
azure
azure-sql-database
azure-web-sites
asked on Stack Overflow Apr 9, 2016 by David Lang • edited Apr 10, 2016 by David Makogon

7 Answers

3

Make sure you don't override connection string in portal config enter image description here

answered on Stack Overflow Sep 3, 2016 by Egor Popov
2

This could be caused by pasting your connection string in after Data Source=

connectionString="Data Source=Server=...."

Instead, it should be

connectionString="Server=...."  
answered on Stack Overflow Nov 3, 2017 by Petebr • edited Nov 3, 2017 by Tom Aranda
1

Could you ensure that: 1) Remote connections are allowed to the SQL Server. - You did that, so it is OK.

2) Use the full name of the server you are connecting to (myserver.database.windows.net) not something else.

Did you try to connect to it from your local computer using SQL Server Management Studio? If so, and if server authentication is set to SQL Server and Windows Authentication and it works, then please paste the details as David suggested and we will try to troubleshoot (actually, with SQL Azure there is not so much to troubleshoot), or try to ask technical support.

0

I had the exact same situation:

This happened to me:

  1. I created a database in Azure, using a bacpac from a blob
  2. I deployed my web app to azurewebsites.net
  3. Running my web app in localhost it connects successfully to the new database
  4. Running my web app in azurewebsites.net it throwed: No such host is known

I tried many things but at the end I think it solved by itself (maybe it was a cache problem).

Try deleting your web.config using FTP and reuploading it.

answered on Stack Overflow Aug 15, 2016 by sports
0

I fixed this issue replacing the connection string in my code.

The correct connectionstring for mysql, the port is splited from the host, like:

Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword

check it out in: https://www.connectionstrings.com/mysql/

answered on Stack Overflow Dec 9, 2016 by Henrique
0

I was missing Service Bus connection, that can be found below:

Azure Function > Integrate > Outputs > Azure Service Bus > Service Bus connection

Last two may be something else for you.

0

Worked yesterday, stopped working today. Redeployed my app and it started working again.

answered on Stack Overflow May 3, 2019 by ulu

User contributions licensed under CC BY-SA 3.0