From 4e18bf5cc47a0ec53518d54597186317c3054904 Mon Sep 17 00:00:00 2001 From: face Date: Wed, 20 Jul 2022 12:44:20 +1000 Subject: [PATCH] Update lw_azure_inventory.sh Filter legacy Azure AD subscription from scope as it cannot be queried. Removed duplicate getSubscriptions function definition. --- bash/lw_azure_inventory.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bash/lw_azure_inventory.sh b/bash/lw_azure_inventory.sh index 22e106a..835f88a 100755 --- a/bash/lw_azure_inventory.sh +++ b/bash/lw_azure_inventory.sh @@ -11,10 +11,6 @@ SQL_SERVERS=0 LOAD_BALANCERS=0 GATEWAYS=0 -function getSubscriptions { - az account list | jq -r '.[] | .id' -} - function setSubscription { SUB=$1 az account set --subscription $SUB @@ -46,7 +42,7 @@ function getGateways { } function getSubscriptions { - az account list | jq -r '.[] | .id' + az account list --query "[?name != 'Access to Azure Active Directory']" | jq -r '.[] | .id' } originalsub=$(az account show | jq -r '.id')