Skip to content

Instantly share code, notes, and snippets.

@margani
Last active December 6, 2021 05:24
Show Gist options
  • Save margani/47af52b2f8086fbe24f0a5ec38643778 to your computer and use it in GitHub Desktop.
Save margani/47af52b2f8086fbe24f0a5ec38643778 to your computer and use it in GitHub Desktop.
This gist has commands to enable/disable --vnet-route-all-enabled config in function apps #azure #functionapps #vnet
$subscriptionName = "<Your Subscription>"
$searchFunctionAppName = "<Your Search Name>"
$enableRouteAll = "false"
az login
az account set -s $subscriptionName
# Getting the status of the config
az functionapp list --query "[?contains(name, '$searchFunctionAppName')].{Name: name, RG: resourceGroup}" | ConvertFrom-Json | ForEach-Object { az functionapp config show -n $_.Name -g $_.RG --query vnetRouteAllEnabled }
# Setting the config --vnet-route-all-enabled to true or false
az functionapp list --query "[?contains(name, '$searchFunctionAppName')].{Name: name, RG: resourceGroup}" | ConvertFrom-Json | ForEach-Object { az functionapp config set --vnet-route-all-enabled $enableRouteAll -n $_.Name -g $_.RG }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment