Skip to content

Latest commit

 

History

History
75 lines (50 loc) · 4.56 KB

sql-database-get-started-portal-firewall.md

File metadata and controls

75 lines (50 loc) · 4.56 KB
title description services ms.service ms.subservice ms.custom ms.devlang ms.topic author ms.author ms.reviewer manager ms.date
Azure portal: Create a SQL Database firwall rule| Microsoft Docs
Create a SQL Database server-level firewall rule
sql-database
sql-database
security
quickstart
sachinpMSFT
sachinp
vanto, carlrab
craigg
12/01/2018

Quickstart: Create a server-level firewall rule for your SQL database using the Azure portal

This quickstart walks through how to create a server-level firewall rule for an Azure SQL database to enable you to connect to it from an on-premises resource.

Prerequisites

This quickstart uses the resources created in Create an Azure SQL database in the Azure portal as its starting point.

Sign in to the Azure portal

Sign in to the Azure portal.

Create a server-level firewall rule

The SQL Database service creates a firewall at the server level. This firewall prevents applications and tools from connecting to the server or any server databases unless you create a firewall rule to open the firewall. For a connection from an IP address outside Azure, create a firewall rule for a specific IP address or range of addresses. For more information about firewall rules, see SQL Database server-level firewall rule.

Note

SQL Database communicates over port 1433. If you're trying to connect from within a corporate network, outbound traffic over port 1433 might not be allowed by your network's firewall. If so, you can't connect to your Azure SQL Database server unless your IT department opens port 1433.

Follow these steps to create a server-level firewall rule for your client's IP address and enable external connectivity through the SQL Database firewall for your IP address only.

  1. After the prerequisite Azure SQL database deployment completes, select SQL databases from the left-hand menu and then choose mySampleDatabase on the SQL databases page. The overview page for your database opens, showing you the fully qualified server name (such as mynewserver-20170824.database.windows.net) and provides options for further configuration.

  2. Copy this fully qualified server name to use when connecting to your server and its databases in other quickstarts.

    server name

  3. Select Set server firewall on the toolbar. The Firewall settings page for the SQL Database server opens.

    server firewall rule

  4. Choose Add client IP on the toolbar to add your current IP address to a new firewall rule. A firewall rule can open port 1433 for a single IP address or a range of IP addresses.

    [!IMPORTANT] By default, access through the SQL Database firewall is enabled for all Azure services. Choose OFF on this page to disable for all Azure services.

  5. Select Save. A server-level firewall rule is created for your current IP address opening port 1433 on the logical server.

  6. Close the Firewall settings page.

Using SQL Server Management Studio or another tool of your choice, you can now connect to the SQL Database server and its databases from this IP address using the server admin account created previously.

Clean up resources

Save these resources if you want to go to Next steps and learn how to connect and query your database using a number of different methods. If, however, you want to delete the resources that you created in this quickstart, use the following steps.

  1. From the left-hand menu in the Azure portal, select Resource groups and then select myResourceGroup.
  2. On your resource group page, select Delete, type myResourceGroup in the text box, and then select Delete.

Next steps