2
votes

I am an Azure newcomer.

I went through Get Started with Azure Cloud Services tutorial and can run the Contoso Ad app locally.

When I push it to my dev/test Azure account, the app cannot see the database.

You can see it live here: My Dev/Test Azure instance running Contoso Ad App

I can run SSMS locally and connect to my database:

enter image description here (this works fine)

I did have to add my home IP Address to the Firewall rules:

enter image description here

Questions:

  1. Is there any way I can see more about what Azure doesn't like when trying to connect to the database?

  2. I followed the tutorial step-by-step, and I'm sure my connection Strings are correct, especially since I can connect from SSMS at home. Any firewall changes that need to be made so an Azure Web App can see an Azure SQL Server database?

Thank you very much in advance!

1
In the tutorial you link to they write about using the release .config file - are you sure the config file is not changed when doing a release build? Looks like the connection to the DB times out and that could be caused by an invalid connection string.Nicklas Møller Jepsen
@NicklasMøllerJepsen So, coming from a Java background, I didn't fully understand the Web.Release.config file, but when I do a local Release build, and go to ContosoAdsWeb\bin\ContosoAdsWeb.dll.config, I am seeing <add name="ContosoAdsContext" connectionString="Data Source=(localdb)\MSSQLLocalDB; Initial Catalog=ContosoAds; Integrated Security=True; MultipleActiveResultSets=True;" providerName="System.Data.SqlClient" />Philip Tenn
@NicklasMøllerJepsen I did find this article: forums.asp.net/t/1532038.aspx. It sounds like the local Release directory can be different that what is published to Azure. Is there a way I can see what Azure has after doing the publish?Philip Tenn
@NicklasMøllerJepsen Thank you for your help!!! If you promote your comment to an answer I'll upvote it since it lead me to the correct answer, which I will post. It had to do w/me not understanding the whole Web.Debug.Config/Web.Release.Config thing.Philip Tenn

1 Answers

3
votes

This turned out to be me not fully understanding how

  • Web.Config
  • Web.Debug.Config
  • Web.Release.Config

interact.

I learned that Web.Release.Config is only modifying upon a Web/Azure Publish, so I did not see the changes reflected in the local <project>\bin\Release folder.

I also learned that by changing the Connection String name in Web.Release.Config, this caused it to not match and transform/overwrite the value in Web.Config.