Subchapter 42.36
references/services/functions/consumption-to-flex/windows/automation/cleanup-and-rollback.mdMarkdown3 KBView on GitHub
Read the outcome and deferred work from <UPGRADE_DIR>/upgrade-status.md. Do not offer source deletion unless the outcome is production cutover complete.
Before offering deletion, verify and record that:
If any condition is not met, do not present a deletion prompt. Record cleanup as skipped — production cutover incomplete or deferred — source retained for later cleanup, matching the user’s intent.
Only after all conditions pass, use ask_user immediately before deletion:
Production cutover is complete and source app
<SOURCE_APP_NAME>is no longer processing production workloads. May I permanently delete it? This is irreversible and removes the rollback app.
Run only after that explicit approval:
az functionapp delete --name <SOURCE_APP_NAME> --resource-group <SOURCE_RESOURCE_GROUP>💡 No rush. The Consumption plan only charges for actual usage, so keeping the old app (with triggers disabled) costs very little. We recommend keeping it for a few days/weeks.
For a function-specific production cutover, use the rollback transaction already authorized in Step 6: disable and verify the target function first, then re-enable and verify the source function.
If the source app was previously stopped, use ask_user immediately before restarting it:
May I restart source app
<SOURCE_APP_NAME>in resource group<SOURCE_RESOURCE_GROUP>to restore processing?
Run the source command only after explicit approval:
az functionapp start --name <SOURCE_APP_NAME> --resource-group <SOURCE_RESOURCE_GROUP>After the source app or affected source functions are running, reverse each routing change made during cutover:
ask_user immediately before reverting each mapping to the source app.Do not delete target resources or target-specific dependencies merely because traffic has been rolled back. Retain them for diagnosis or a later retry unless the user separately approves their deletion.
Deleting the new Flex app does not modify the source app, but still requires confirmation under the global destructive-action policy:
az functionapp delete --name <NEW_APP_NAME> --resource-group <RESOURCE_GROUP>