Created
August 6, 2020 19:00
-
-
Save terasaka/ac499618c7f5ac7eebd8195f0f5fc713 to your computer and use it in GitHub Desktop.
AZURE AppService - Aplicando restrição de origem em AppService
This file contains hidden or 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/bash | |
# AZURE AppService | |
# Restringindo acesso a appservice definindo blocos de origens | |
# | |
# Informar os ranges linha a linha | |
ips=( \ | |
x.x.x.x/x \ | |
y.y.y.y/y \ | |
) | |
# Inicio das regras | |
rule=100 | |
# Nome da Appservice | |
appname=myAppName | |
# Nome do resource group | |
rgname=rg-myAppName | |
# Nome da regra | |
ruleName=myAppNameruleName | |
# Aplicando regras | |
for ip in ${ips[@]}; do | |
az webapp config access-restriction add --resource-group $rgname --name $appname --rule-name $ruleName --action Allow --ip-address $ip --priority $rule | |
rule=$((rule+1)) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment