Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 20, 2025

Core Tools now warns when publishing function apps using deprecated extension bundle versions, matching VS Code extension behavior.

Issue describing the changes in this PR

resolves #4700

Changes

ExtensionBundleHelper.cs

  • Added GetDeprecatedExtensionBundleWarning() to detect deprecated bundles by comparing local host.json version against Azure's recommended range from https://aka.ms/funcStaticProperties
  • Implemented custom version range parsing and intersection logic (ParseVersionRange, VersionRangesIntersect, CompareVersions)
  • Extended support for exact version format [X.Y.Z] in addition to range formats [X.*, Y.Y.Y) and [X.Y.Z, A.B.C)
  • Uses static HttpClient with 10s timeout; all errors handled gracefully to never block publish

PublishFunctionAppAction.cs

  • Integrated deprecation check in ValidateFunctionAppPublish() after existing validations
  • Displays warning in DarkYellow: "Your app is using a deprecated version [X.X.X, X.X.X) of extension bundles. Upgrade to [X.*, X.X.X)."

ExtensionBundleHelperTests.cs

  • Added unit tests for version range parsing and intersection logic
  • Added test cases for exact version format [3.40.0] and [4.28.0]
  • Covers deprecated and current version scenarios

Version Format Support

The implementation supports three formats:

  1. Range with wildcard: [4.*, 5.0.0) → parsed as (4.0.0, 5.0.0)
  2. Exact range: [3.3.0, 4.0.0) → parsed as (3.3.0, 4.0.0)
  3. Exact version: [4.28.0] → parsed as (4.28.0, 4.28.1) (treated as point range)

Example

// Deprecated: [3.3.0, 4.0.0) vs [4.*, 5.0.0) → no overlap → warning shown
// Deprecated: [3.40.0] vs [4.*, 5.0.0) → no overlap → warning shown
// Current: [4.*, 5.0.0) vs [4.*, 5.0.0) → overlap → no warning
// Current: [4.28.0] vs [4.*, 5.0.0) → overlap → no warning

During publish with deprecated bundle:

$ func azure functionapp publish my-app
...
⚠️  Your app is using a deprecated version [3.3.0, 4.0.0) of extension bundles. Upgrade to [4.*, 5.0.0).
...

Pull request checklist

  • My changes do not require documentation changes
  • My changes do not need to be backported to a previous version
  • My changes should not be added to the release notes for the next release
  • I have added all required tests (Unit tests, E2E tests)

Additional information

The warning message format and behavior matches the VS Code Azure Functions extension to provide a consistent user experience across deployment tools.

Original prompt

This section details on the original issue you should resolve

<issue_title>Show warning/validation message for function apps publishing or using deprecated extension bundle</issue_title>
<issue_description>### Description

During publish of azure function app , core tools should show a warning that function app is using a deprecated extension bundle

Extension Bundle Deprecation policy - https://learn.microsoft.com/en-us/azure/azure-functions/extension-bundles#bundle-versions

Display similar message as already being displayed through VS Code publish task -

Image</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 20, 2025 22:04
Co-authored-by: liliankasem <2198905+liliankasem@users.noreply.github.com>
…dling

Co-authored-by: liliankasem <2198905+liliankasem@users.noreply.github.com>
Copilot AI changed the title [WIP] Show warning message for deprecated extension bundle on publish Add deprecation warning for extension bundles during publish Nov 20, 2025
Copilot AI requested a review from liliankasem November 20, 2025 22:19
Copilot finished work on behalf of liliankasem November 20, 2025 22:19
@liliankasem liliankasem requested a review from manvkaur November 21, 2025 17:30
Co-authored-by: manvkaur <67894494+manvkaur@users.noreply.github.com>
Copilot AI requested a review from manvkaur November 21, 2025 22:30
Copilot finished work on behalf of manvkaur November 21, 2025 22:30
Copy link

@manvkaur manvkaur left a comment

Choose a reason for hiding this comment

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

Looks good from bundle message perspective, please verify its working in core tools

@liliankasem liliankasem marked this pull request as ready for review November 24, 2025 23:29
@liliankasem liliankasem requested a review from a team as a code owner November 24, 2025 23:29
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.

Show warning/validation message for function apps publishing or using deprecated extension bundle

3 participants