Skip to content

Commit

Permalink
corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanHoey96 committed Sep 30, 2024
1 parent 6a8b86f commit 4f66cee
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/appgateway/appgw_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [[ "$MODE" != "start" && "$MODE" != "stop" ]]; then
exit 1
fi

APPLICATION_GATEWAYS=$(get_application_gateways "$2")
APPLICATION_GATEWAYS=$(get_application_gateways)

# For each App Gateway found in the function `get_application_gateways` start another loop
jq -c '.data[]' <<<$APPLICATION_GATEWAYS | while read application_gateway; do
Expand Down
4 changes: 2 additions & 2 deletions scripts/appgateway/common-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function get_application_gateways() {
| where type =~ 'microsoft.network/applicationgateways'
| where tags.autoShutdown == 'true'
$env_selector
| project name, resourceGroup, subscriptionId, ['tags'], properties.provisioningState, ['id']
| project name, resourceGroup, subscriptionId, ['tags'], properties.operationalState, ['id']
" --first 1000 -o json

log "az graph query complete"
Expand All @@ -32,7 +32,7 @@ function get_application_gateways_details() {
SUBSCRIPTION=$(jq -r '.subscriptionId' <<< $application_gateway)
BUSINESS_AREA=$( jq -r 'if (.tags.businessArea|ascii_downcase) == "ss" then "cross-cutting" else .tags.businessArea|ascii_downcase end' <<< $application_gateway)
STARTUP_MODE=$(jq -r '.tags.startupMode' <<< $application_gateway)
APPLICATION_GATEWAY_STATE=$(jq -r '.properties_provisioningState' <<< $application_gateway)
APPLICATION_GATEWAY_STATE=$(jq -r '.properties_operationalState' <<< $application_gateway)
}

function appgateway_state_messages() {
Expand Down
9 changes: 8 additions & 1 deletion scripts/sqlmi/sqlmistatus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ if [[ "$MODE" != "start" && "$MODE" != "stop" ]]; then
exit 1
fi

MI_SQL_SERVERS=$(get_sql_mi_servers "$2")
MI_SQL_SERVERS=$(get_sql_mi_servers)
mi_sql_server_count=$(jq -c -r '.count' <<< $MI_SQL_SERVERS)

#Cancel check process if there are no auto-shutdown resources
if [[ $mi_sql_server_count -eq 0 ]]; then
ts_echo_color RED "No SQL Managed Instances found, nothing to check"
exit 0
fi

# For each App Gateway found in the function `get_application_gateways` start another loop
jq -c '.[]' <<<$MI_SQL_SERVERS | while read server; do
Expand Down

0 comments on commit 4f66cee

Please sign in to comment.