Skip to content

Commit

Permalink
updated stop slot to include migration function
Browse files Browse the repository at this point in the history
Jira ticket: CAMS-461
  • Loading branch information
amorrow-flexion committed Dec 10, 2024
1 parent 359779a commit 488acb8
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions ops/scripts/pipeline/slots/az-slot-start-stop-operations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Prerequisite:
# - curl
# - Azure CLI
# Usage: az-slot-lifecycle.sh -g <resource_group_name:str> --apiName <apiName:str> --webappName <webapp_name:str> --slotName <slot_name:str> --operation <start|stop>
# Usage: az-slot-start-stop-operations.sh -g <resource_group_name:str> --apiFunctionName <apiFunctionName:str> --migrationFunctionName <migrationFunctionName:str> --webappName <webapp_name:str> --slotName <slot_name:str> --operation <start|stop>

set -euo pipefail # ensure job step fails in CI pipeline when error occurs

Expand All @@ -18,8 +18,13 @@ while [[ $# -gt 0 ]]; do
shift 2
;;

--apiName)
api_name="${2}"
--apiFunctionName)
api_function_name="${2}"
shift 2
;;

--migrationFunctionName)
migration_function_name="${2}"
shift 2
;;

Expand All @@ -46,13 +51,15 @@ done

if [[ ${operation} == 'stop' ]]; then
echo "Stopping Node API ${slot_name} slot..."
az functionapp stop -g "${app_rg}" --name "${api_name}" --slot "${slot_name}"
az functionapp stop -g "${app_rg}" --name "${api_function_name}" --slot "${slot_name}"
echo "Stopping Migration Function ${slot_name} slot..."
az functionapp stop -g "${app_rg}" --name "${migration_function_name}" --slot "${slot_name}"
echo "Stopping Webapp ${slot_name} slot..."
az webapp stop -g "${app_rg}" --name "${webapp_name}" --slot "${slot_name}"

elif [[ ${operation} == 'start' ]]; then
echo "Starting Node API ${slot_name} slot..."
az functionapp start -g "${app_rg}" --name "${api_name}" --slot "${slot_name}"
az functionapp start -g "${app_rg}" --name "${api_function_name}" --slot "${slot_name}"
echo "Starting Webapp ${slot_name} slot..."
az webapp start -g "${app_rg}" --name "${webapp_name}" --slot "${slot_name}"

Expand Down

0 comments on commit 488acb8

Please sign in to comment.