Last active
June 30, 2017 04:54
-
-
Save sjwaight/bbd71ca3f094abe5cf438c1b826b83fe to your computer and use it in GitHub Desktop.
bash script to set firewall rules for an Azure Database for MySQL instace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
azuresub=$1 | |
demoresourcegroup=$2 | |
mysqlservername=$3 | |
firstip=$4 | |
secondip=$5 | |
thirdip=$6 | |
fourthip=$7 | |
# uncomment to add local support and login to your Azure subscription | |
# az login | |
az account set --subscription $azuresub | |
az mysql server firewall-rule create --resource-group $demoresourcegroup --server-name $mysqlservername --name allowwebapp01 --start-ip-address $firstip --end-ip-address $firstip | |
az mysql server firewall-rule create --resource-group $demoresourcegroup --server-name $mysqlservername --name allowwebapp02 --start-ip-address $secondip --end-ip-address $secondip | |
az mysql server firewall-rule create --resource-group $demoresourcegroup --server-name $mysqlservername --name allowwebapp03 --start-ip-address $thirdip --end-ip-address $thirdip | |
az mysql server firewall-rule create --resource-group $demoresourcegroup --server-name $mysqlservername --name allowwebapp04 --start-ip-address $fourthip --end-ip-address $fourthip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment