Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,4 @@
<!-- Please add your release notes in the following format:
- My change description (#PR)
-->
- Emit diagnostic warning for deprecated Azure Functions Proxies usage (#11405)
- Update Python Worker Version to [4.40.2](https://github.com/Azure/azure-functions-python-worker/releases/tag/4.40.2)
- Add JitTrace Files for v4.1044
- Send `TelemetryHealthCheckPublisher` logs to ScriptHost `ILogger` (#11398)
- Implementing a resolver that resolves worker configurations from specified probing paths (#11258)
- Remove duplicate function names from sync triggers payload(#11371)
- Avoid emitting empty tag values for health check metrics (#11393)
- Run health checks from the active ScriptHost (#11410)
- Publish health check metrics to legacy AppInsights SDK (#11365)
- Fix tag filter for health check live & ready endpoints (#11363)
- Functions host to take a customer specified port in Custom Handler scenario (#11408)
- Updated to version 1.5.8 of Microsoft.Azure.AppService.Middleware.Functions (#11416)
- Enabling worker indexing for Logic Apps app kind behind an enviornment setting
- Adding HttpWorkerFunctionProvider functions to synctrigger payload (#11430)
- Remove the Flex-only AzureMonitorDiagnosticLoggerProvider filter (#11431)
- Add TraceContext attributes for OTel (#11429)
- Add JitTrace Files for v4.1045
- Adding empty remote message check in the SystemLogger (#11473)
2 changes: 1 addition & 1 deletion src/Directory.Version.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>4.1045.100</VersionPrefix>
<VersionPrefix>4.1045.200</VersionPrefix>
<UpdateBuildNumber>true</UpdateBuildNumber>
</PropertyGroup>
</Project>
12 changes: 7 additions & 5 deletions src/WebJobs.Script.WebHost/Extensions/ExceptionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,17 @@ public static (string InnerExceptionType, string InnerExceptionMessage, string D
var formattedDetails = exception.ToFormattedString();

if (exception is FunctionInvocationException && baseException is RpcException { RemoteMessage: var remoteMsg }
&& remoteMsg is not null)
&& !string.IsNullOrWhiteSpace(remoteMsg))
{
var redacted = GetRedactedExceptionMessage(remoteMsg);

var innerExceptionMessage = Sanitizer.Sanitize(
originalMessage.Replace(remoteMsg, redacted, StringComparison.Ordinal));
var innerExceptionMessage = string.IsNullOrWhiteSpace(originalMessage)
? string.Empty
: Sanitizer.Sanitize(originalMessage.Replace(remoteMsg, redacted, StringComparison.Ordinal));

var detailsSanitized = Sanitizer.Sanitize(
formattedDetails.Replace(remoteMsg, redacted, StringComparison.Ordinal));
var detailsSanitized = string.IsNullOrWhiteSpace(formattedDetails)
? string.Empty
: Sanitizer.Sanitize(formattedDetails.Replace(remoteMsg, redacted, StringComparison.Ordinal));

return (innerType, innerExceptionMessage, detailsSanitized, formattedMessage);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Azure.WebJobs.Script.Workers.Rpc;
using Xunit;

namespace Microsoft.Azure.WebJobs.Script.Tests.Extensions
Expand Down Expand Up @@ -31,7 +33,55 @@ public void GetExceptionDetails_ReturnsExpectedResult()
Assert.Contains("System.Exception : some outer exception ---> System.InvalidOperationException : Some inner exception", exceptionDetails);
Assert.Contains("End of inner exception", exceptionDetails);
Assert.Contains("at Microsoft.Azure.WebJobs.Script.Tests.Extensions.ExceptionExtensionsTests.GetExceptionDetails_ReturnsExpectedResult()", exceptionDetails);
Assert.Contains("ExceptionExtensionsTests.cs : 20", exceptionDetails);
Assert.Contains("ExceptionExtensionsTests.cs", exceptionDetails);
}

[Fact]
public void GetExceptionDetails_Rpc()
{
string rpcMessage = "rpcMessage";
Exception innerException = new RpcException("result", rpcMessage, "stack");
Exception outerException = new FunctionInvocationException("message", innerException);
Exception fullException;

try
{
throw outerException;
}
catch (Exception e)
{
fullException = e;
}

(string exceptionType, string exceptionMessage, string exceptionDetails, string formattedText) = fullException.GetSanitizedExceptionDetails("safe text");

Assert.Equal("Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcException", exceptionType);
Assert.DoesNotContain(rpcMessage, exceptionMessage);
Assert.DoesNotContain(rpcMessage, exceptionDetails);
Assert.Contains("safe text", formattedText);
}

[Fact]
public void GetExceptionDetails_Rpc_Empty()
{
Exception innerException = new RpcException(string.Empty, string.Empty, string.Empty);
Exception outerException = new FunctionInvocationException(string.Empty, innerException);
Exception fullException;

try
{
throw outerException;
}
catch (Exception e)
{
fullException = e;
}

(string exceptionType, string exceptionMessage, _, string formattedText) = fullException.GetSanitizedExceptionDetails("safe text");

Assert.Equal("Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcException", exceptionType);
Assert.Equal("Result: \nType: \nException: \nStack: ", exceptionMessage);
Assert.Contains("safe text", formattedText);
}
}
}
Loading