Monday, January 4, 2021

Setting up an Azure Sql Database - Firewall settings

 I've been working on an update to my golf game application.  I'm going to get it running with ASP.NET Core 5, aka .NET 5.  I've been digging through a lot of little changes, and it's been making me quite crazy at times.  I started working on it locally, then added an azure sql db, and would run my local system off of the azure db.  It was starting to all work great.  I then created an azure web app, deployed the new code, and nothing database oriented worked.  I was going crazy because I wasn't getting anything beyond an http 500 error.

I had some other issues to work on, so I created an azure vm last week to get get some things done quicker than running over the interwebz.  I noticed I had to add the vm to the azure firewall.  Did that, and handled the database work.

I came back around to this today.  I stepped into the code.  The first error was in calling the password manager's signin method.  Poof, no good error, just boom.  I noticed that the error took a number of seconds to actually generate the error.  It seems that the problem was the communication wasn't actually getting to the database.  I went back to the azure portal and decided to look at the sql server firewall settings.  I noticed the option of allowing azure services to access the database.  I set that to true, and the problem was resolved.  


No comments: