-
Notifications
You must be signed in to change notification settings - Fork 469
Emit diagnostic warning for deprecated Azure Functions Proxies usage #11405
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
base: dev
Are you sure you want to change the base?
Conversation
Co-authored-by: brettsam <[email protected]>
_scriptOptions = scriptOptions; | ||
_environment = environment; | ||
_logger = loggerFactory.CreateLogger(LogCategories.Startup); | ||
if (_environment.IsProxiesEnabled()) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in commit da5c682 to only emit the warning when actual proxy files exist and are loaded, not just when the feature flag is enabled. The warning now appears in the ReadProxyMetadata
method after confirming that proxies have been successfully loaded from the proxies.json file.
public const string WorkerRuntimeDoesNotMatchWithFunctionMetadataHelpLink = "https://aka.ms/functions-invalid-worker-runtime"; | ||
|
||
public const string DeprecatedProxiesErrorCode = "AZFD0014"; | ||
public const string DeprecatedProxiesHelpLink = "https://azure.microsoft.com/en-us/updates?id=community-support-for-azure-functions-proxies-will-end-on-30-september-2025"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot -- update this url to be https://aka.ms/functions-deprecated-proxies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to https://aka.ms/functions-deprecated-proxies in commit da5c682.
_logger = loggerFactory.CreateLogger(LogCategories.Startup); | ||
if (_environment.IsProxiesEnabled()) | ||
{ | ||
_logger.LogDiagnosticEventWarning(DiagnosticEventConstants.DeprecatedProxiesErrorCode, "Azure Functions Proxies are deprecated and community support will end on September 30, 2025. Please migrate to Azure API Management or Azure Container Apps. See https://azure.microsoft.com/en-us/updates?id=community-support-for-azure-functions-proxies-will-end-on-30-september-2025 for more information.", DiagnosticEventConstants.DeprecatedProxiesHelpLink, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot -- update this url to be https://aka.ms/functions-deprecated-proxies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to https://aka.ms/functions-deprecated-proxies in commit da5c682.
Co-authored-by: brettsam <[email protected]>
Summary
This PR implements a diagnostic warning event that alerts users when Azure Functions Proxies files are loaded, 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 in use and users need to be proactively notified.
Changes
Diagnostic Event Constants
Added new diagnostic event constant
AZFD0014
inDiagnosticEventConstants.cs
with a help link (https://aka.ms/functions-deprecated-proxies
) pointing to the official Azure deprecation announcement.ProxyFunctionProvider Enhancement
Modified the
ReadProxyMetadata
method inProxyFunctionProvider
to emit a diagnostic warning event when proxy files are loaded. The warning is only emitted when:proxies.json
file existsThe warning message includes:
Test Coverage
Added a new unit test
ProxyFunctionProvider_WhenProxiesEnabled_EmitsDiagnosticWarning
that verifies:AZFD0014
) is usedBehavior
When an Azure Functions host starts up and loads proxies:
ProxyFunctionProvider
reads theproxies.json
fileAZFD0014
Impact
MissingFunctionsWorkerRuntime
,WorkerRuntimeDoesNotMatchWithFunctionMetadata
)Fixes #11395
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.