Question

I have a dnn website that I'm testing a move to Azure Websites. What I wanted to do was first recreate the database on Azure and then just change the connection string to point to the azure sql database. I migrated the database just fine. It exists in my azure portal and as far as I can tell the data is accurate.

My previous connection string was:

<add name="SiteSqlServer" connectionString="Data Source={SERVERNAME};Initial Catalog={DBNAME};User ID={USERNAME};Password={PASSWORD}" providerName="System.Data.SqlClient" />

Which I changed to the azure connection as follows:

<add name="SiteSqlServer" connectionString="Data Source=tcp:{SERVERNAME}.database.windows.net,1433;Database={DBNAME};User ID={USERNAME};Password={PASSWORD};Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" providerName="System.Data.SqlClient" />

But I get The following error when I try to load the site: enter image description here

and the url that is hsown in the browser is: mysite.com/Install/UnderConstruction.htm

I am not sure how to trouble shoot this. Is the database not connecting or is the connection good and another problem is happening. I have not changed any files in the root of my stie. I just changed the connection string to point to the new azure database.

I can connect to this database successfully from Sql Management Studio using the connection credentials fro the connection string.

QUESTION:

How can I tell if this is a database connection issue or trouble shoot why this error appears.

Alternatively, do I need to enable a firewall access for the external IIS server IP that the site's files are hosted on?

BEGIN EDIT 1:

So I logged into my sql azure database in question and included more metrics in the monitoring page. I could see that there were connections that failed due to being blocked by the firewall, as shown below. enter image description here

SO I got he IP address of the shared IIS server where my website files reside and added a firewall rule to allow that IP address. THis did not solve the problem.

Follow up Question: is there a way to tell what the ip address is of the failed connection that was blocked by the firewall?

END EDIT 1:

Thanks in advance

Was it helpful?

Solution 2

So, the problem was a firewall setting in the Sql Azure Server.

The hosted web app that is requesting a connection to the Sql Azure database is not from another azure service but a separate IIS server. When I do a DMS/IP lookup for the web app I got a certain IP address. I added that to the firewall rules and it did not work so it must use another ip address.

What I Did: I opened all the IP address to make sure that any IP could get through, this allowed the web app to connect to the Sql Azure DB. Here is how i enabled all IP's: enter image description here

I used http://centralops.net/co/ to get the "net IP range" for the shared server where the web app resides and entered that as an allowed IP range. Now the site connects properly.

OTHER TIPS

You can tell if it is a DB connection issue by going to

/install/install.aspx

That page will tell you if the connection string fails.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top