Skip to content

Files

Latest commit

eaec008 · Dec 6, 2023

History

History
37 lines (24 loc) · 1.21 KB

File metadata and controls

37 lines (24 loc) · 1.21 KB

Open Azure SQL server firewall to your IP address

sql/open-firewall-to-your-ip/README.md

Prerequisites

This example assumes you have previously completed the following examples:

  1. Create an Azure Resource Group
  2. Create an Azure SQL Database
  3. Install curl

Open Azure SQL server firewall to your local IP address

To make it possible to communicate with your SQL server from your local IP address execute the following command lines:

  export LOCAL_IP=`curl -s whatismyip.akamai.com`

  az sql server firewall-rule create \
    --resource-group $RESOURCE_GROUP \
    --server $MSSQL_NAME \
    --name AllowMyLocalIP \
    --start-ip-address $LOCAL_IP \
    --end-ip-address $LOCAL_IP

Cleanup

Do NOT forget to remove the resources once you are done running the example.

1m