From 2495282b338a83e1247efcb7e5646286e2925fd1 Mon Sep 17 00:00:00 2001 From: B3B29F67 <60800049+B3B29F67@users.noreply.github.com> Date: Fri, 18 Mar 2022 14:49:46 -0600 Subject: [PATCH] Script clean up * Removed duplicate getSubscriptions function. * Removed legacy subscription "Access to Azure Active Directory" which leads to errors (see https://www.jasonfritts.me/2020/04/07/what-is-the-access-to-azure-active-directory-subscription-for/ for more information). --- 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..42cda81 100755 --- a/bash/lw_azure_inventory.sh +++ b/bash/lw_azure_inventory.sh @@ -12,7 +12,7 @@ LOAD_BALANCERS=0 GATEWAYS=0 function getSubscriptions { - az account list | jq -r '.[] | .id' + az account list --query "[?name != 'Access to Azure Active Directory']" | jq -r '.[] | .id' } function setSubscription { @@ -45,10 +45,6 @@ function getGateways { az network vnet-gateway list --resource-group $RG | jq length } -function getSubscriptions { - az account list | jq -r '.[] | .id' -} - originalsub=$(az account show | jq -r '.id') echo "Starting inventory check."