Skip to content

add warning log for end of support extension bundles versions #11075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 39 commits into
base: dev
Choose a base branch
from

Conversation

manvkaur
Copy link

@manvkaur manvkaur commented May 22, 2025

Issue describing the changes in this PR

resolves #https://github.com/Azure/azure-functions-pyfx-planning/issues/713
screenshot of working log in app insights -
image

Pull request checklist

IMPORTANT: Currently, changes must be backported to the in-proc branch to be included in Core Tools and non-Flex deployments.

  • Backporting to the in-proc branch is not required
    • Otherwise: Link to backporting PR
  • My changes do not require documentation changes
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • My changes do not require diagnostic events changes
    • Otherwise: I have added/updated all related diagnostic events and their documentation (Documentation issue linked to PR)
  • I have added all required tests (Unit tests, E2E tests)

Additional information

This pull request introduces changes to enhance validation mechanisms for function apps, improve logging for outdated extension bundles.

Validation Enhancements:

  • Added the IFunctionAppValidator interface to support modular validation logic for function apps. (src/WebJobs.Script/Host/IFunctionAppValidator.cs)
  • Introduced ExtensionBundleManagerValidator and MissingAzureFunctionsFolderValidator classes to validate outdated extension bundles and improper folder structures, respectively. (src/WebJobs.Script/Host/ExtensionBundleManagerValidator.cs, src/WebJobs.Script/Host/MissingAzureFunctionsFolderValidator.cs) [1] [2]
  • Updated FunctionAppValidationService to use a collection of validators for streamlined validation and improved error handling. (src/WebJobs.Script/Host/FunctionAppValidationService.cs) [1] [2]

Logging Improvements:

  • Added a warning log for outdated extension bundles, including localized messages for future and past deprecation dates. (src/WebJobs.Script/Diagnostics/Extensions/LoggerExtension.cs, src/WebJobs.Script/Properties/Resources.Designer.cs, src/WebJobs.Script/Properties/Resources.resx) [1] [2] [3]
  • Registered the new logging functionality in the ExtensionBundleManager class to generate warnings based on bundle version and deprecation timelines. (src/WebJobs.Script/ExtensionBundle/ExtensionBundleManager.cs)

Platform Configuration Updates:

  • Corrected the x86 bitness mapping in New-PrivateSiteExtension.ps1 to reflect "32bit" instead of "64bit." (src/WebJobs.Script.SiteExtension/New-PrivateSiteExtension.ps1)

Test Suite Updates:

  • Modified test classes to accommodate new validation logic and ensure compatibility with the updated FunctionAppValidationService. (test/WebJobs.Script.Tests.Integration/TestFunctionHost.cs, test/WebJobs.Script.Tests/Description/FunctionAppValidationServiceTests.cs) [1] [2]

Miscellaneous:

  • Added a warning log entry for outdated extension bundles in the release notes. (release_notes.md)

@manvkaur manvkaur marked this pull request as ready for review June 2, 2025 23:56
@manvkaur manvkaur requested a review from a team as a code owner June 2, 2025 23:56
@manvkaur manvkaur changed the title add diagnostics warning log for deprecating extension bundles add warning log for end of support extension bundles versions Jun 5, 2025
@manvkaur manvkaur requested review from jviau and kshyju June 25, 2025 18:35
@manvkaur manvkaur requested a review from kshyju June 26, 2025 02:00
var manager = new ExtensionBundleManager(options, env, _loggerFactory, config);

// Set the private _extensionBundleVersion field using reflection
typeof(ExtensionBundleManager)
Copy link
Member

Choose a reason for hiding this comment

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

You may also consider mocking the http client. Ex:

var httpclient = new HttpClient(new MockHttpHandler(statusCodeForIndexJson: HttpStatusCode.OK, statusCodeForZipFile: HttpStatusCode.OK, "2.0.0"));

{
_scriptOptions = scriptOptions ?? throw new ArgumentNullException(nameof(scriptOptions));
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_logger = loggerFactory.CreateLogger(ScriptConstants.LogCategoryHostGeneral) ?? throw new ArgumentNullException(nameof(loggerFactory));
Copy link
Author

Choose a reason for hiding this comment

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

@surgupta-msft , changing the category of logger to ScriptConstants.LogCategoryHostGeneral as per @RohitRanjanMS 's recommendation.
Let me know if you have any concerns.

Copy link
Contributor

Choose a reason for hiding this comment

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

No concerns

@manvkaur manvkaur requested a review from RohitRanjanMS July 2, 2025 00:41
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.

5 participants