Skip to content

Instantly share code, notes, and snippets.

@terasaka
Created August 6, 2020 19:00
Show Gist options
  • Save terasaka/ac499618c7f5ac7eebd8195f0f5fc713 to your computer and use it in GitHub Desktop.
Save terasaka/ac499618c7f5ac7eebd8195f0f5fc713 to your computer and use it in GitHub Desktop.
AZURE AppService - Aplicando restrição de origem em AppService
#!/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