Skip to content

[App Service] Fix #31394: az functionapp deployment source config-zip: Never ending loop on flex function app health check - #33388

Merged
Julie Zhu (yanzhudd) merged 2 commits into
Azure:devfrom
dylan8902:flex-functionapp-loop-fix
May 26, 2026
Merged

Julie Zhu (yanzhudd) merged 2 commits into
Azure:devfrom
dylan8902:flex-functionapp-loop-fix

Conversation

@dylan8902

@dylan8902 Dylan Jones (dylan8902) commented May 17, 2026

Copy link
Copy Markdown
Contributor

Related command

az functionapp deployment source config-zip

Description

The check_flex_app_after_deployment function called after a deployment had a never ending re-try loop for non-2xx response status codes. This PR adds the missing num_trials increment. It also breaks out of the health check when an IP restriction is found preventing the client from calling the health check.

Fixes #31394

Testing Guide

An existing function app with a default network rule of Deny has no access from the client to the app. Run the deployment command:

az functionapp deployment source config-zip \
 --resource-group MyResourceGroup  \
 --name MyUniqueAppName \
 --src funcapp.zip

Before it would hang forever, but now transient errors are handled and retries are done up the the limit. An IP restriction will complete successfully with a message saying the health check was not possible


This checklist is used to make sure that common guidelines for a pull request are followed.

Adds missing tries count
Breaks out if IP restriction in place
@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented May 17, 2026

Copy link
Copy Markdown
️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented May 17, 2026

Copy link
Copy Markdown
️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions

Copy link
Copy Markdown

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@dylan8902 Dylan Jones (dylan8902) changed the title [Appservice] Fix #31394: az functionapp deployment source config-zip - never ending loop on flex function app health check [Appservice] Fix #31394: az functionapp deployment source config-zip: never ending loop on flex function app health check May 17, 2026
@dylan8902
Dylan Jones (dylan8902) marked this pull request as ready for review May 17, 2026 03:20
Copilot AI review requested due to automatic review settings May 17, 2026 03:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a hang in the App Service module’s post-deployment health check for Flex Function Apps invoked by az functionapp deployment source config-zip, by ensuring the retry loop terminates and by short-circuiting when the health check is blocked by IP restrictions.

Changes:

  • Increment num_trials for non-2xx health-check responses to prevent an infinite retry loop.
  • Exit the health-check loop early when a 403 response indicates IP-based access restriction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/azure-cli/azure/cli/command_modules/appservice/custom.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/appservice/custom.py
@dylan8902 Dylan Jones (dylan8902) changed the title [Appservice] Fix #31394: az functionapp deployment source config-zip: never ending loop on flex function app health check [Appservice] Fix #31394: az functionapp deployment source config-zip: Never ending loop on flex function app health check May 17, 2026
@dylan8902

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 33388 in repo Azure/azure-cli

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@yanzhudd Julie Zhu (yanzhudd) changed the title [Appservice] Fix #31394: az functionapp deployment source config-zip: Never ending loop on flex function app health check [App Service] Fix #31394: az functionapp deployment source config-zip: Never ending loop on flex function app health check May 25, 2026
@yanzhudd

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@yanzhudd

Copy link
Copy Markdown
Contributor

Hi Dylan Jones (@dylan8902)
is this PR ready to review/merge?

@dylan8902

Copy link
Copy Markdown
Contributor Author

Hi Dylan Jones (@dylan8902)
is this PR ready to review/merge?

Julie Zhu (@yanzhudd) Yes please

@yanzhudd
Julie Zhu (yanzhudd) merged commit e700213 into Azure:dev May 26, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Functionapp deploy health check fails when no public network access

4 participants