Skip to content

Commit ed60f35

Browse files
authored
Merge branch 'dev' into shkr/placeholder_start
2 parents e7d65a2 + 649c38e commit ed60f35

File tree

65 files changed

+3853
-2510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+3853
-2510
lines changed

eng/build/Workers.Java.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<ItemGroup>
4-
<PackageReference Include="Microsoft.Azure.Functions.JavaWorker" Version="2.19.1" />
4+
<PackageReference Include="Microsoft.Azure.Functions.JavaWorker" Version="2.19.2" />
55
</ItemGroup>
66

77
</Project>

release_notes.md

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
1+
### Release notes
2+
13
<!-- Please add your release notes in the following format:
24
- My change description (#PR)
35
-->
4-
- Memory allocation optimizations in `ScriptStartupTypeLocator.GetExtensionsStartupTypesAsync` (#11012)
5-
- Fix invocation timeout when incoming request contains "x-ms-invocation-id" header (#10980)
6-
- Warn if .azurefunctions folder does not exist (#10967)
7-
- Memory allocation & CPU optimizations in `GrpcMessageExtensionUtilities.ConvertFromHttpMessageToExpando` (#11054)
8-
- Replace `Timer` with `while`-loop in `FlexConsumptionMetricsPublisher` (#11071)
9-
- Memory allocation optimizations in `ReadLanguageWorkerFile` by reading files in buffered chunks, preventing LOH allocations (#11069)
10-
- Enhancing the capability to send startup failure logs to AppInsights/Otel. (#11055)
11-
- Added support for collecting cross-platform perf traces and generating PGO JIT traces (#11062)
12-
- Memory allocation optimizations in `DependencyHelper.GetExtensionRequirements` (#11022)
13-
- Fix Instance Manager for CV1 Migration (#11072)
14-
- Avoid setting up OTel and AzMon exporter in the placeholder mode. (#11090)
15-
- Update Java Worker Version to [2.19.1](https://github.com/Azure/azure-functions-java-worker/releases/tag/2.19.1)
16-
- Memory allocation optimizations in `FeatureFlags.IsEnabled` by adopting zero-allocation `ContainsToken` for efficient delimited token search (#11075)
17-
- Improvements to coldstart pipeline (#11102).
18-
- Update Python Worker Version to [4.38.0](https://github.com/Azure/azure-functions-python-worker/releases/tag/4.38.0)
19-
- Only start the Diagnostic Events flush logs timer when events are present, preventing unnecessary flush attempts (#11100).
206
- Improved metadata binding validation (#11101)
7+
- Adding activity sources for Durable and WebJobs (Kafka and RabbitMQ) (#11137)
8+
- Add JitTrace Files for v4.1041
9+
- Fix startup deadlock on transient exceptions (#11142)

src/Directory.Version.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<VersionPrefix>4.1041.100</VersionPrefix>
3+
<VersionPrefix>4.1042.100</VersionPrefix>
44
<UpdateBuildNumber>true</UpdateBuildNumber>
55
</PropertyGroup>
66
</Project>

src/WebJobs.Script.Grpc/Channel/GrpcWorkerChannel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
using Microsoft.Azure.WebJobs.Script.Grpc.Eventing;
2727
using Microsoft.Azure.WebJobs.Script.Grpc.Extensions;
2828
using Microsoft.Azure.WebJobs.Script.Grpc.Messages;
29+
using Microsoft.Azure.WebJobs.Script.Http;
2930
using Microsoft.Azure.WebJobs.Script.ManagedDependencies;
3031
using Microsoft.Azure.WebJobs.Script.Workers;
3132
using Microsoft.Azure.WebJobs.Script.Workers.Rpc;

src/WebJobs.Script.Grpc/Channel/GrpcWorkerChannelFactory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Microsoft.Azure.WebJobs.Script.Diagnostics;
99
using Microsoft.Azure.WebJobs.Script.Eventing;
1010
using Microsoft.Azure.WebJobs.Script.Grpc.Eventing;
11+
using Microsoft.Azure.WebJobs.Script.Http;
1112
using Microsoft.Azure.WebJobs.Script.Workers;
1213
using Microsoft.Azure.WebJobs.Script.Workers.Rpc;
1314
using Microsoft.Azure.WebJobs.Script.Workers.SharedMemoryDataTransfer;

src/WebJobs.Script.Grpc/GrpcServiceCollectionsExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

44
using Microsoft.Azure.WebJobs.Script.Grpc.Messages;
5+
using Microsoft.Azure.WebJobs.Script.Http;
56
using Microsoft.Azure.WebJobs.Script.Workers.Rpc;
67
using Microsoft.Extensions.DependencyInjection;
78

src/WebJobs.Script.Grpc/WebJobs.Script.Grpc.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
1919
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="all" />
2020
<PackageReference Include="System.Threading.Channels" Version="8.0.0" />
21-
<PackageReference Include="Yarp.ReverseProxy" Version="2.0.1" />
2221
</ItemGroup>
2322

2423
<ItemGroup>

src/WebJobs.Script.SiteExtension/New-PrivateSiteExtension.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ if (-not (Join-Path $InputPath "extension.xml" | Test-Path))
6565
exit 1
6666
}
6767

68-
if ($AppendOutputName || !$OutputPath)
68+
if ($AppendOutputName -or !$OutputPath)
6969
{
7070
$runtime = $Bitness -eq '32bit' ? 'win-x86' : 'win-x64'
7171
$leaf = (Split-Path $InputPath -Leaf)

src/WebJobs.Script.WebHost/Diagnostics/AzureMonitorDiagnosticLogger.cs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public class AzureMonitorDiagnosticLogger : ILogger
2929
private readonly IEventGenerator _eventGenerator;
3030
private readonly IEnvironment _environment;
3131
private readonly IExternalScopeProvider _scopeProvider;
32-
private AppServiceOptions _appServiceOptions;
32+
private bool _isAzureMonitorLoggingEnabled;
33+
private IOptionsMonitor<AppServiceOptions> _appServiceOptionsMonitor;
3334

3435
public AzureMonitorDiagnosticLogger(string category, string hostInstanceId, IEventGenerator eventGenerator, IEnvironment environment, IExternalScopeProvider scopeProvider,
3536
HostNameProvider hostNameProvider, IOptionsMonitor<AppServiceOptions> appServiceOptionsMonitor)
@@ -40,10 +41,9 @@ public AzureMonitorDiagnosticLogger(string category, string hostInstanceId, IEve
4041
_environment = environment ?? throw new ArgumentNullException(nameof(environment));
4142
_scopeProvider = scopeProvider ?? throw new ArgumentNullException(nameof(scopeProvider));
4243
_hostNameProvider = hostNameProvider ?? throw new ArgumentNullException(nameof(hostNameProvider));
43-
_ = appServiceOptionsMonitor ?? throw new ArgumentNullException(nameof(appServiceOptionsMonitor));
44-
45-
appServiceOptionsMonitor.OnChange(newOptions => _appServiceOptions = newOptions);
46-
_appServiceOptions = appServiceOptionsMonitor.CurrentValue;
44+
_appServiceOptionsMonitor = appServiceOptionsMonitor ?? throw new ArgumentNullException(nameof(appServiceOptionsMonitor));
45+
UpdateAppServiceOptions(_appServiceOptionsMonitor.CurrentValue);
46+
_appServiceOptionsMonitor.OnChange(UpdateAppServiceOptions);
4747

4848
_roleInstance = _environment.GetInstanceId();
4949

@@ -55,7 +55,7 @@ public AzureMonitorDiagnosticLogger(string category, string hostInstanceId, IEve
5555
public bool IsEnabled(LogLevel logLevel)
5656
{
5757
// We want to instantiate this Logger in placeholder mode to warm it up, but do not want to log anything.
58-
return !string.IsNullOrEmpty(_hostNameProvider.Value) && !_environment.IsPlaceholderModeEnabled();
58+
return _isAzureMonitorLoggingEnabled && !string.IsNullOrEmpty(_hostNameProvider.Value) && !_environment.IsPlaceholderModeEnabled();
5959
}
6060

6161
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
@@ -107,7 +107,7 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
107107
using (JsonTextWriter writer = new JsonTextWriter(sw) { Formatting = Formatting.None })
108108
{
109109
writer.WriteStartObject();
110-
WritePropertyIfNotNull(writer, "appName", _appServiceOptions.AppName);
110+
WritePropertyIfNotNull(writer, "appName", _appServiceOptionsMonitor.CurrentValue.AppName);
111111
WritePropertyIfNotNull(writer, "roleInstance", _roleInstance);
112112
WritePropertyIfNotNull(writer, "message", formattedMessage);
113113
WritePropertyIfNotNull(writer, "category", _category);
@@ -136,6 +136,11 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
136136
_eventGenerator.LogAzureMonitorDiagnosticLogEvent(logLevel, _hostNameProvider.Value, AzureMonitorOperationName, AzureMonitorCategoryName, _regionName, sw.ToString());
137137
}
138138

139+
private void UpdateAppServiceOptions(AppServiceOptions appServiceOptions)
140+
{
141+
_isAzureMonitorLoggingEnabled = !(_environment.IsConsumptionOnLegion() && !_appServiceOptionsMonitor.CurrentValue.IsAzureMonitorLoggingEnabled);
142+
}
143+
139144
private static void WritePropertyIfNotNull<T>(JsonTextWriter writer, string propertyName, T propertyValue)
140145
{
141146
if (propertyValue != null)

src/WebJobs.Script.WebHost/Management/FunctionsSyncManager.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ internal HttpRequestMessage BuildSetTriggersRequest()
729729
}
730730

731731
// This function will call POST https://{app}.azurewebsites.net/operation/settriggers with the content
732-
// of triggers. It'll verify app ownership using a SWT token valid for 5 minutes. It should be plenty.
732+
// of triggers. It'll verify app ownership using a site token valid for 5 minutes. It should be plenty.
733733
private async Task<(bool Success, string ErrorMessage)> SetTriggersAsync(string content)
734734
{
735735
// sanitize the content before logging
@@ -747,12 +747,6 @@ internal HttpRequestMessage BuildSetTriggersRequest()
747747
request.Headers.Add("User-Agent", ScriptConstants.FunctionsUserAgent);
748748
request.Content = new StringContent(content, Encoding.UTF8, "application/json");
749749

750-
if (_hostingConfigOptions.Value.SwtIssuerEnabled)
751-
{
752-
string swtToken = SimpleWebTokenHelper.CreateToken(DateTime.UtcNow.AddMinutes(5));
753-
request.Headers.Add(ScriptConstants.SiteRestrictedTokenHeaderName, swtToken);
754-
}
755-
756750
string jwtToken = JwtTokenHelper.CreateToken(DateTime.UtcNow.AddMinutes(5));
757751
request.Headers.Add(ScriptConstants.SiteTokenHeaderName, jwtToken);
758752

0 commit comments

Comments
 (0)