Deploy an Azure App Service: support Flex Consumption plans via OneDeploy - #2077
Open
HuyPhanNguyen wants to merge 3 commits into
Open
Deploy an Azure App Service: support Flex Consumption plans via OneDeploy#2077HuyPhanNguyen wants to merge 3 commits into
HuyPhanNguyen wants to merge 3 commits into
Conversation
…plans Flex Consumption plans don't expose Kudu /api/zipdeploy (404). Detect the plan SKU tier and, when it's FlexConsumption, upload zip/nupkg packages via the OneDeploy /api/publish?type=zip endpoint with an application/zip content type.
- Wrap Flex detection in try/catch; fall back to ZipDeploy (with a warning naming serverfarms/read) so a plan-read 403 can't break non-Flex deploys. - Extract testable IsFlexConsumptionTier; also match SKU name 'FC1' so a null Tier doesn't silently route to the wrong endpoint. - CopyNupkgToZip: use Path.ChangeExtension and overwrite to survive retries. - Unit tests for tier detection and the nupkg->zip conversion.
… as success OneDeploy (/api/publish) returns 202 Accepted + a Location and processes the deployment asynchronously; the previous code treated the 202 as success. Poll the Location until complete and fail on a non-success Kudu status. Verified live: a package missing the .azurefunctions directory now fails the step (status 3) instead of reporting green.
wlthomson
marked this pull request as ready for review
July 23, 2026 00:03
HuyPhanNguyen
enabled auto-merge (squash)
July 23, 2026 05:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
The built-in "Deploy an Azure App Service" step fails with HTTP 404 when the target Function App runs on an Azure Flex Consumption plan. Calamari uploads the package by POSTing to the Kudu
/api/zipdeployendpoint, which Flex Consumption plans don't expose. Microsoft now recommends Flex Consumption over the classic Consumption plan and is deprecating the classic plan on 2028-09-30, so more customers will hit this over time.Results
Detects the App Service Plan SKU tier at deploy time and, when it's Flex Consumption, uploads zip/nupkg packages through the OneDeploy (
/api/publish?type=zip) endpoint with anapplication/zipcontent type instead of ZipDeploy.Fixes HPY-20.
Before
Deploying a zip/nupkg package to a Flex Consumption Function App POSTs to

https://<scm>/api/zipdeployand returns404 (Not Found), so the step fails.After (this PR)
The step resolves the plan tier (

App Service Plan '...' is on the 'FlexConsumption' tier (SKU 'FC1')), POSTs to/api/publish?type=zip, polls to completion, and the deployment succeeds. Non-Flex plans are unaffected and still use/api/zipdeploy.Both captured live against the same real Flex Consumption Function App, same package — only the Calamari build differs.
Testing
PackageProviderFactoryFixtureto assert the upload endpoint, sync/async mode, and content type for the Flex and non-Flex cases across.zip/.nupkg/.war/.jar.Octopus.Calamari.Executable:POST .../api/zipdeploy?isAsync=true→404 (Not Found), deployment fails.App Service Plan ... is on the 'FlexConsumption' tier (SKU 'FC1')→POST .../api/publish?type=zip→ deployment succeeds.Automated Tests
mainrelease/*branches only)Pre-requisites