Skip to content

Commit 6bc1d88

Browse files
authored
Add Source Gen Logging for Worker Config (#9746)
* changes * changes * addressing comments * updating deps.json * versioning * logging changes * changes
1 parent b0e811a commit 6bc1d88

File tree

3 files changed

+82
-54
lines changed

3 files changed

+82
-54
lines changed

src/WebJobs.Script/WebJobs.Script.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@
8383
<PackageReference Include="System.Reactive.Linq" Version="5.0.0" />
8484
<PackageReference Include="System.Reactive.Core" Version="5.0.0" />
8585
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
86+
<!--
87+
Explicitly referencing version 6.0.9 of System.Text.Json to get two bug fixes for the Source Generator. Without this, the 6.0.0 version
88+
of the Source Generator is used, which causes issues. This reference can be removed in future framework versions.
89+
90+
https://github.com/dotnet/runtime/issues/62354
91+
https://github.com/dotnet/runtime/issues/62082
92+
-->
93+
<PackageReference Include="System.Text.Json" Version="6.0.9" />
8694
</ItemGroup>
8795

8896
<ItemGroup>
Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
2-
// Licensed under the MIT License. See License.txt in the project root for license information.
1+
// Licensed under the MIT License. See License.txt in the project root for license information.
32

43
using System.Collections.Generic;
4+
using System.Text.Json;
5+
using System.Text.Json.Serialization;
6+
using Microsoft.Azure.WebJobs.Hosting;
57

68
namespace Microsoft.Azure.WebJobs.Script.Workers.Rpc
79
{
8-
public class LanguageWorkerOptions
10+
public class LanguageWorkerOptions : IOptionsFormatter
911
{
1012
public IList<RpcWorkerConfig> WorkerConfigs { get; set; }
13+
14+
public string Format()
15+
{
16+
return JsonSerializer.Serialize(this, typeof(LanguageWorkerOptions), LanguageWorkerOptionsJsonSerializerContext.Default);
17+
}
18+
}
19+
20+
[JsonSourceGenerationOptions(WriteIndented = true)]
21+
[JsonSerializable(typeof(LanguageWorkerOptions))]
22+
internal partial class LanguageWorkerOptionsJsonSerializerContext : JsonSerializerContext
23+
{
1124
}
12-
}
25+
}

test/WebJobs.Script.Tests/Microsoft.Azure.WebJobs.Script.WebHost.deps.json

Lines changed: 57 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"compilationOptions": {},
77
"targets": {
88
".NETCoreApp,Version=v6.0": {
9-
"Microsoft.Azure.WebJobs.Script.WebHost/4.28.0": {
9+
"Microsoft.Azure.WebJobs.Script.WebHost/4.29.0": {
1010
"dependencies": {
1111
"Azure.Identity": "1.10.2",
1212
"Azure.Security.KeyVault.Secrets": "4.2.0",
@@ -21,12 +21,12 @@
2121
"Microsoft.Azure.AppService.Middleware.Functions": "1.5.4",
2222
"Microsoft.Azure.AppService.Proxy.Client": "2.2.20220831.41",
2323
"Microsoft.Azure.Cosmos.Table": "1.0.8",
24-
"Microsoft.Azure.Functions.PythonWorker": "4.20.0",
24+
"Microsoft.Azure.Functions.PythonWorker": "4.22.0",
2525
"Microsoft.Azure.Storage.File": "11.1.7",
2626
"Microsoft.Azure.WebJobs": "3.0.39",
2727
"Microsoft.Azure.WebJobs.Host.Storage": "5.0.0-beta.2-11957",
28-
"Microsoft.Azure.WebJobs.Script": "4.28.0",
29-
"Microsoft.Azure.WebJobs.Script.Grpc": "4.28.0",
28+
"Microsoft.Azure.WebJobs.Script": "4.29.0",
29+
"Microsoft.Azure.WebJobs.Script.Grpc": "4.29.0",
3030
"Microsoft.Azure.WebSites.DataProtection": "2.1.91-alpha",
3131
"Microsoft.IdentityModel.Protocols.OpenIdConnect": "6.32.0",
3232
"Microsoft.IdentityModel.Tokens": "6.32.0",
@@ -38,8 +38,8 @@
3838
"System.Private.Uri": "4.3.2",
3939
"System.Security.Cryptography.Xml": "4.7.1",
4040
"System.Text.RegularExpressions": "4.3.1",
41-
"Microsoft.Azure.WebJobs.Script.Reference": "4.28.0.0",
42-
"Microsoft.Azure.WebJobs.Script.Grpc.Reference": "4.28.0.0"
41+
"Microsoft.Azure.WebJobs.Script.Reference": "4.29.0.0",
42+
"Microsoft.Azure.WebJobs.Script.Grpc.Reference": "4.29.0.0"
4343
},
4444
"runtime": {
4545
"Microsoft.Azure.WebJobs.Script.WebHost.dll": {}
@@ -64,7 +64,7 @@
6464
"System.Memory.Data": "1.0.2",
6565
"System.Numerics.Vectors": "4.5.0",
6666
"System.Text.Encodings.Web": "6.0.0",
67-
"System.Text.Json": "6.0.0",
67+
"System.Text.Json": "6.0.9",
6868
"System.Threading.Tasks.Extensions": "4.5.4"
6969
},
7070
"runtime": {
@@ -81,7 +81,7 @@
8181
"Microsoft.Identity.Client.Extensions.Msal": "2.31.0",
8282
"System.Memory": "4.5.4",
8383
"System.Security.Cryptography.ProtectedData": "4.7.0",
84-
"System.Text.Json": "6.0.0",
84+
"System.Text.Json": "6.0.9",
8585
"System.Threading.Tasks.Extensions": "4.5.4"
8686
},
8787
"runtime": {
@@ -95,7 +95,7 @@
9595
"dependencies": {
9696
"Azure.Core": "1.35.0",
9797
"System.Memory": "4.5.4",
98-
"System.Text.Json": "6.0.0",
98+
"System.Text.Json": "6.0.9",
9999
"System.Threading.Tasks.Extensions": "4.5.4"
100100
},
101101
"runtime": {
@@ -108,7 +108,7 @@
108108
"Azure.Storage.Blobs/12.13.0": {
109109
"dependencies": {
110110
"Azure.Storage.Common": "12.12.0",
111-
"System.Text.Json": "6.0.0"
111+
"System.Text.Json": "6.0.9"
112112
},
113113
"runtime": {
114114
"lib/netstandard2.1/Azure.Storage.Blobs.dll": {
@@ -845,13 +845,13 @@
845845
}
846846
}
847847
},
848-
"Microsoft.Azure.Functions.DotNetIsolatedNativeHost/1.0.2": {},
848+
"Microsoft.Azure.Functions.DotNetIsolatedNativeHost/1.0.3": {},
849849
"Microsoft.Azure.Functions.JavaWorker/2.13.0": {},
850850
"Microsoft.Azure.Functions.NodeJsWorker/3.9.0": {},
851851
"Microsoft.Azure.Functions.PowerShellWorker.PS7.0/4.0.2973": {},
852852
"Microsoft.Azure.Functions.PowerShellWorker.PS7.2/4.0.3070": {},
853-
"Microsoft.Azure.Functions.PowerShellWorker.PS7.4/4.0.3030": {},
854-
"Microsoft.Azure.Functions.PythonWorker/4.20.0": {},
853+
"Microsoft.Azure.Functions.PowerShellWorker.PS7.4/4.0.3085": {},
854+
"Microsoft.Azure.Functions.PythonWorker/4.22.0": {},
855855
"Microsoft.Azure.KeyVault.Core/2.0.4": {
856856
"dependencies": {
857857
"System.Runtime": "4.3.1",
@@ -1478,7 +1478,7 @@
14781478
"Microsoft.Extensions.Logging.Abstractions": "6.0.0",
14791479
"Microsoft.Extensions.Logging.Configuration": "6.0.0",
14801480
"Microsoft.Extensions.Options": "6.0.0",
1481-
"System.Text.Json": "6.0.0"
1481+
"System.Text.Json": "6.0.9"
14821482
}
14831483
},
14841484
"Microsoft.Extensions.ObjectPool/2.2.0": {},
@@ -1546,7 +1546,7 @@
15461546
"Microsoft.IdentityModel.Tokens": "6.32.0",
15471547
"System.Text.Encoding": "4.3.0",
15481548
"System.Text.Encodings.Web": "6.0.0",
1549-
"System.Text.Json": "6.0.0"
1549+
"System.Text.Json": "6.0.9"
15501550
},
15511551
"runtime": {
15521552
"lib/net6.0/Microsoft.IdentityModel.JsonWebTokens.dll": {
@@ -2312,7 +2312,7 @@
23122312
"System.Memory.Data/1.0.2": {
23132313
"dependencies": {
23142314
"System.Text.Encodings.Web": "6.0.0",
2315-
"System.Text.Json": "6.0.0"
2315+
"System.Text.Json": "6.0.9"
23162316
},
23172317
"runtime": {
23182318
"lib/netstandard2.0/System.Memory.Data.dll": {
@@ -2860,10 +2860,16 @@
28602860
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
28612861
}
28622862
},
2863-
"System.Text.Json/6.0.0": {
2863+
"System.Text.Json/6.0.9": {
28642864
"dependencies": {
28652865
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
28662866
"System.Text.Encodings.Web": "6.0.0"
2867+
},
2868+
"runtime": {
2869+
"lib/net6.0/System.Text.Json.dll": {
2870+
"assemblyVersion": "6.0.0.0",
2871+
"fileVersion": "6.0.2523.51912"
2872+
}
28672873
}
28682874
},
28692875
"System.Text.RegularExpressions/4.3.1": {
@@ -2990,7 +2996,7 @@
29902996
}
29912997
}
29922998
},
2993-
"Microsoft.Azure.WebJobs.Script/4.28.0": {
2999+
"Microsoft.Azure.WebJobs.Script/4.29.0": {
29943000
"dependencies": {
29953001
"Azure.Core": "1.35.0",
29963002
"Azure.Identity": "1.10.2",
@@ -3002,12 +3008,12 @@
30023008
"Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel": "2.21.0",
30033009
"Microsoft.AspNetCore.Mvc.WebApiCompatShim": "2.2.0",
30043010
"Microsoft.Azure.AppService.Proxy.Client": "2.2.20220831.41",
3005-
"Microsoft.Azure.Functions.DotNetIsolatedNativeHost": "1.0.2",
3011+
"Microsoft.Azure.Functions.DotNetIsolatedNativeHost": "1.0.3",
30063012
"Microsoft.Azure.Functions.JavaWorker": "2.13.0",
30073013
"Microsoft.Azure.Functions.NodeJsWorker": "3.9.0",
30083014
"Microsoft.Azure.Functions.PowerShellWorker.PS7.0": "4.0.2973",
30093015
"Microsoft.Azure.Functions.PowerShellWorker.PS7.2": "4.0.3070",
3010-
"Microsoft.Azure.Functions.PowerShellWorker.PS7.4": "4.0.3030",
3016+
"Microsoft.Azure.Functions.PowerShellWorker.PS7.4": "4.0.3085",
30113017
"Microsoft.Azure.WebJobs": "3.0.39",
30123018
"Microsoft.Azure.WebJobs.Extensions": "5.0.0-beta.2-10879",
30133019
"Microsoft.Azure.WebJobs.Extensions.Http": "3.2.0",
@@ -3026,13 +3032,14 @@
30263032
"System.IO.Abstractions": "2.1.0.227",
30273033
"System.Reactive.Core": "5.0.0",
30283034
"System.Reactive.Linq": "5.0.0",
3029-
"System.Runtime.Loader": "4.3.0"
3035+
"System.Runtime.Loader": "4.3.0",
3036+
"System.Text.Json": "6.0.9"
30303037
},
30313038
"runtime": {
30323039
"Microsoft.Azure.WebJobs.Script.dll": {}
30333040
}
30343041
},
3035-
"Microsoft.Azure.WebJobs.Script.Grpc/4.28.0": {
3042+
"Microsoft.Azure.WebJobs.Script.Grpc/4.29.0": {
30363043
"dependencies": {
30373044
"Grpc.AspNetCore": "2.55.0",
30383045
"Microsoft.ApplicationInsights": "2.21.0",
@@ -3041,7 +3048,7 @@
30413048
"Microsoft.ApplicationInsights.WindowsServer": "2.21.0",
30423049
"Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel": "2.21.0",
30433050
"Microsoft.Azure.WebJobs.Rpc.Core": "3.0.37",
3044-
"Microsoft.Azure.WebJobs.Script": "4.28.0",
3051+
"Microsoft.Azure.WebJobs.Script": "4.29.0",
30453052
"System.IO.FileSystem.Primitives": "4.3.0",
30463053
"System.Threading.Channels": "6.0.0",
30473054
"Yarp.ReverseProxy": "2.0.1"
@@ -3050,26 +3057,26 @@
30503057
"Microsoft.Azure.WebJobs.Script.Grpc.dll": {}
30513058
}
30523059
},
3053-
"Microsoft.Azure.WebJobs.Script.Reference/4.28.0.0": {
3060+
"Microsoft.Azure.WebJobs.Script.Reference/4.29.0.0": {
30543061
"runtime": {
30553062
"Microsoft.Azure.WebJobs.Script.dll": {
3056-
"assemblyVersion": "4.28.0.0",
3057-
"fileVersion": "4.28.0.0"
3063+
"assemblyVersion": "4.29.0.0",
3064+
"fileVersion": "4.29.0.0"
30583065
}
30593066
}
30603067
},
3061-
"Microsoft.Azure.WebJobs.Script.Grpc.Reference/4.28.0.0": {
3068+
"Microsoft.Azure.WebJobs.Script.Grpc.Reference/4.29.0.0": {
30623069
"runtime": {
30633070
"Microsoft.Azure.WebJobs.Script.Grpc.dll": {
3064-
"assemblyVersion": "4.28.0.0",
3065-
"fileVersion": "4.28.0.0"
3071+
"assemblyVersion": "4.29.0.0",
3072+
"fileVersion": "4.29.0.0"
30663073
}
30673074
}
30683075
}
30693076
}
30703077
},
30713078
"libraries": {
3072-
"Microsoft.Azure.WebJobs.Script.WebHost/4.28.0": {
3079+
"Microsoft.Azure.WebJobs.Script.WebHost/4.29.0": {
30733080
"type": "project",
30743081
"serviceable": false,
30753082
"sha512": ""
@@ -3613,12 +3620,12 @@
36133620
"path": "microsoft.azure.documentdb.core/2.11.2",
36143621
"hashPath": "microsoft.azure.documentdb.core.2.11.2.nupkg.sha512"
36153622
},
3616-
"Microsoft.Azure.Functions.DotNetIsolatedNativeHost/1.0.2": {
3623+
"Microsoft.Azure.Functions.DotNetIsolatedNativeHost/1.0.3": {
36173624
"type": "package",
36183625
"serviceable": true,
3619-
"sha512": "sha512-WF+pfzgfiyACL3yKUeV7p2zSJE3MyxfpOBFrUBtESFPEnM6qwf73YIjoFLxCsbqf6Co8JltNUvAzS9chWJV/Uw==",
3620-
"path": "microsoft.azure.functions.dotnetisolatednativehost/1.0.2",
3621-
"hashPath": "microsoft.azure.functions.dotnetisolatednativehost.1.0.2.nupkg.sha512"
3626+
"sha512": "sha512-VNbCoKeaLn7gFNcs9PQ2EOx1GSen8pGAmpv5ZUdnAtJ7jJQxhQ43RrnbT5gzdwklhI68D7EHZ4sSkqB689ZOFA==",
3627+
"path": "microsoft.azure.functions.dotnetisolatednativehost/1.0.3",
3628+
"hashPath": "microsoft.azure.functions.dotnetisolatednativehost.1.0.3.nupkg.sha512"
36223629
},
36233630
"Microsoft.Azure.Functions.JavaWorker/2.13.0": {
36243631
"type": "package",
@@ -3648,19 +3655,19 @@
36483655
"path": "microsoft.azure.functions.powershellworker.ps7.2/4.0.3070",
36493656
"hashPath": "microsoft.azure.functions.powershellworker.ps7.2.4.0.3070.nupkg.sha512"
36503657
},
3651-
"Microsoft.Azure.Functions.PowerShellWorker.PS7.4/4.0.3030": {
3658+
"Microsoft.Azure.Functions.PowerShellWorker.PS7.4/4.0.3085": {
36523659
"type": "package",
36533660
"serviceable": true,
3654-
"sha512": "sha512-N0O+tNUAz+3h8yg8zh/D88qpA6wpse3dsIPAFS+U6DRUtHopnbEKJkxt1ULdcEd+v/0UkEM5a6PoOlvywEgwmw==",
3655-
"path": "microsoft.azure.functions.powershellworker.ps7.4/4.0.3030",
3656-
"hashPath": "microsoft.azure.functions.powershellworker.ps7.4.4.0.3030.nupkg.sha512"
3661+
"sha512": "sha512-B9ZaaKRqDcCIhjHP7L/4F2P57zwyzRzPvDnPpihrq1eW+PrdfHbMnn6zQu0gamIXOq3P+SjAW00S5BO3xlZmYg==",
3662+
"path": "microsoft.azure.functions.powershellworker.ps7.4/4.0.3085",
3663+
"hashPath": "microsoft.azure.functions.powershellworker.ps7.4.4.0.3085.nupkg.sha512"
36573664
},
3658-
"Microsoft.Azure.Functions.PythonWorker/4.20.0": {
3665+
"Microsoft.Azure.Functions.PythonWorker/4.22.0": {
36593666
"type": "package",
36603667
"serviceable": true,
3661-
"sha512": "sha512-sZI1VFPIre5eIKJXWjZyDqLsIVxxzwk0MDCOM9vikpuVYsxRqunkdzDClFVaoVXeO1c48IAZQGVk6asCUXEp/Q==",
3662-
"path": "microsoft.azure.functions.pythonworker/4.20.0",
3663-
"hashPath": "microsoft.azure.functions.pythonworker.4.20.0.nupkg.sha512"
3668+
"sha512": "sha512-y4CIxlb458RVXPWddT6iL5p6dDgfGOIU+g4sMt7XEtw6raZjZT67B+AHsO2KAqk1r1SSM8JQfT3vOHlXS/yN/g==",
3669+
"path": "microsoft.azure.functions.pythonworker/4.22.0",
3670+
"hashPath": "microsoft.azure.functions.pythonworker.4.22.0.nupkg.sha512"
36643671
},
36653672
"Microsoft.Azure.KeyVault.Core/2.0.4": {
36663673
"type": "package",
@@ -5013,12 +5020,12 @@
50135020
"path": "system.text.encodings.web/6.0.0",
50145021
"hashPath": "system.text.encodings.web.6.0.0.nupkg.sha512"
50155022
},
5016-
"System.Text.Json/6.0.0": {
5023+
"System.Text.Json/6.0.9": {
50175024
"type": "package",
50185025
"serviceable": true,
5019-
"sha512": "sha512-zaJsHfESQvJ11vbXnNlkrR46IaMULk/gHxYsJphzSF+07kTjPHv+Oc14w6QEOfo3Q4hqLJgStUaYB9DBl0TmWg==",
5020-
"path": "system.text.json/6.0.0",
5021-
"hashPath": "system.text.json.6.0.0.nupkg.sha512"
5026+
"sha512": "sha512-2j16oUgtIzl7Xtk7demG0i/v5aU/ZvULcAnJvPb63U3ZhXJ494UYcxuEj5Fs49i3XDrk5kU/8I+6l9zRCw3cJw==",
5027+
"path": "system.text.json/6.0.9",
5028+
"hashPath": "system.text.json.6.0.9.nupkg.sha512"
50225029
},
50235030
"System.Text.RegularExpressions/4.3.1": {
50245031
"type": "package",
@@ -5118,22 +5125,22 @@
51185125
"path": "yarp.reverseproxy/2.0.1",
51195126
"hashPath": "yarp.reverseproxy.2.0.1.nupkg.sha512"
51205127
},
5121-
"Microsoft.Azure.WebJobs.Script/4.28.0": {
5128+
"Microsoft.Azure.WebJobs.Script/4.29.0": {
51225129
"type": "project",
51235130
"serviceable": false,
51245131
"sha512": ""
51255132
},
5126-
"Microsoft.Azure.WebJobs.Script.Grpc/4.28.0": {
5133+
"Microsoft.Azure.WebJobs.Script.Grpc/4.29.0": {
51275134
"type": "project",
51285135
"serviceable": false,
51295136
"sha512": ""
51305137
},
5131-
"Microsoft.Azure.WebJobs.Script.Reference/4.28.0.0": {
5138+
"Microsoft.Azure.WebJobs.Script.Reference/4.29.0.0": {
51325139
"type": "reference",
51335140
"serviceable": false,
51345141
"sha512": ""
51355142
},
5136-
"Microsoft.Azure.WebJobs.Script.Grpc.Reference/4.28.0.0": {
5143+
"Microsoft.Azure.WebJobs.Script.Grpc.Reference/4.29.0.0": {
51375144
"type": "reference",
51385145
"serviceable": false,
51395146
"sha512": ""

0 commit comments

Comments
 (0)