Search code examples
sql-serverazureweb-application-firewall

Azure App Accessing Azure SQL Db IP Range


I have an azure web app. Within the app there is a webform that performs a call to an azure sql database. Essentially a lookup table.

My problem is that when the app is published, the app fails because others users are not in the azure sql database firewall ip range.

The app is open on the web. I do not know the IP range of users except that they are UK only.

My question is:

Do I just add the range 0 to 255 in the range or is there a more appropriate method of managing this issue. It must be fairly common. I am very grateful for any advice. Thanks a million. Billson3000


Solution

  • You should not open a range of IP addresses, that would be a huge security risk.

    Your users IP addresses does not matter from the Azure SQL point of view, because your users won't connect to the DB directly, they will use your web application, and the application will connect to the SQL Azure. The only important thing here that you have to "Allow access to Azure services" under the "Firewall and virtual networks" in your SQL Azure, this way your web app will have access to your SQL server, but this is turned on by default if you create a new Azure SQL server.

    There are tutorials on Microsoft docs about hot to build your first web app, based on this you'll be able to do your own: https://learn.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-dotnet-sqldatabase