Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 2, 2025

Summary

This PR implements a diagnostic warning event that alerts users when Azure Functions Proxies are enabled, informing them of the deprecation and upcoming end of community support.

Background

Azure Functions Proxies are officially deprecated, with community support ending on September 30, 2025 (official announcement). Despite this deprecation, a significant number of production applications still have proxies enabled and users need to be proactively notified.

Changes

Diagnostic Event Constants

Added new diagnostic event constant AZFD0014 in DiagnosticEventConstants.cs with a help link pointing to the official Azure deprecation announcement.

ProxyFunctionProvider Enhancement

Modified the ProxyFunctionProvider constructor to emit a diagnostic warning event when proxies are enabled. The warning message includes:

  • Clear deprecation notice
  • End of support date (September 30, 2025)
  • Migration guidance recommending Azure API Management or Azure Container Apps
  • Link to the official deprecation announcement

Test Coverage

Added a new unit test ProxyFunctionProvider_WhenProxiesEnabled_EmitsDiagnosticWarning that verifies:

  • The diagnostic event is properly emitted when proxies are enabled
  • The correct error code (AZFD0014) is used
  • The warning message contains the expected deprecation information

Behavior

When an Azure Functions host starts up with proxies enabled:

  1. The ProxyFunctionProvider constructor detects proxies are enabled
  2. A diagnostic warning event is emitted with error code AZFD0014
  3. The event is captured by Azure Monitor and appears in diagnostic logs
  4. Proxies continue to function normally (non-breaking change)

Impact

  • User Notification: Users with proxies enabled will now see actionable warnings in their Azure Monitor diagnostic logs
  • Non-Breaking: This is a warning-only change; proxy functionality remains unchanged
  • Minimal Footprint: Only 3 files modified with 37 lines added
  • Consistent Pattern: Follows existing diagnostic event patterns used throughout the codebase (e.g., MissingFunctionsWorkerRuntime, WorkerRuntimeDoesNotMatchWithFunctionMetadata)

Fixes #[issue number]

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • azfunc.pkgs.visualstudio.com
    • Triggering command: dotnet build src/WebJobs.Script/WebJobs.Script.csproj --configuration Release (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
    • Triggering command: dotnet restore src/WebJobs.Script/WebJobs.Script.csproj (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Emit diagnostic event for deprecated Proxy usage</issue_title>
<issue_description>Proxies are now officially deprecated: https://azure.microsoft.com/en-us/updates?id=community-support-for-azure-functions-proxies-will-end-on-30-september-2025

We should emit a diagnostic warning on startup to alert users of this. It still looks like we have a decent number of apps that still have this enabled in prod.</issue_description>

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

Fixes #11395

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: brettsam <1089915+brettsam@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Emit diagnostic event for deprecated Proxy usage Emit diagnostic warning for deprecated Azure Functions Proxies usage Oct 2, 2025
@Copilot Copilot AI requested a review from brettsam October 2, 2025 21:11
Copilot finished work on behalf of brettsam October 2, 2025 21:11
_scriptOptions = scriptOptions;
_environment = environment;
_logger = loggerFactory.CreateLogger(LogCategories.Startup);
if (_environment.IsProxiesEnabled())
Copy link
Member

Choose a reason for hiding this comment

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

Are there other places in the host we do this check?

Copy link
Member

Choose a reason for hiding this comment

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

The warning here will be emitted simply if proxies feature flag is enabled. We may need to only emit warning if there are actual files with proxies. Otherwise, customers might be confused why the warning is generated. If we do want the warning here we also should provide instructions to remove feature flag.

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.

Emit diagnostic event for deprecated Proxy usage
4 participants