Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Azure/azure-functions-dotnet-worker
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.18.0
Choose a base ref
...
head repository: Azure/azure-functions-dotnet-worker
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.19.0
Choose a head ref
Loading
Showing with 12,540 additions and 2,060 deletions.
  1. +8 −1 DotNetWorker.sln
  2. +1 −1 NuGet.Config
  3. +12 −12 build/install-dotnet.yml
  4. +26 −0 docs/analyzer-rules/AZFW0009.md
  5. +42 −0 docs/analyzer-rules/AZFW0010.md
  6. +25 −0 docs/analyzer-rules/AZFW0011.md
  7. +2 −2 extensions/Worker.Extensions.Abstractions/release_notes.md
  8. +2 −2 extensions/Worker.Extensions.CosmosDB/release_notes.md
  9. +62 −0 extensions/Worker.Extensions.CosmosDB/src/Config/CosmosDBBindingOptions.cs
  10. +58 −0 extensions/Worker.Extensions.CosmosDB/src/Config/CosmosDBBindingOptionsSetup.cs
  11. +15 −0 extensions/Worker.Extensions.CosmosDB/src/Constants.cs
  12. +198 −0 extensions/Worker.Extensions.CosmosDB/src/CosmosDBConverter.cs
  13. +35 −1 extensions/Worker.Extensions.CosmosDB/src/CosmosDBInputAttribute.cs
  14. +37 −0 extensions/Worker.Extensions.CosmosDB/src/CosmosExtensionStartup.cs
  15. +3 −0 extensions/Worker.Extensions.CosmosDB/src/Properties/AssemblyInfo.cs
  16. +25 −0 extensions/Worker.Extensions.CosmosDB/src/Utilities.cs
  17. +11 −1 extensions/Worker.Extensions.CosmosDB/src/Worker.Extensions.CosmosDB.csproj
  18. +61 −0 extensions/Worker.Extensions.CosmosDB/src/WorkerCosmosSerializer.cs
  19. +1 −1 extensions/Worker.Extensions.EventGrid/release_notes.md
  20. +20 −1 extensions/Worker.Extensions.EventGrid/src/EventGridTriggerAttribute.cs
  21. +4 −2 extensions/Worker.Extensions.EventGrid/src/Properties/AssemblyInfo.cs
  22. +44 −0 extensions/Worker.Extensions.EventGrid/src/TypeConverters/EventGridBinaryDataConverter.cs
  23. +30 −0 extensions/Worker.Extensions.EventGrid/src/TypeConverters/EventGridCloudEventConverter.cs
  24. +50 −0 extensions/Worker.Extensions.EventGrid/src/TypeConverters/EventGridConverterBase.cs
  25. +30 −0 extensions/Worker.Extensions.EventGrid/src/TypeConverters/EventGridEventConverter.cs
  26. +31 −0 extensions/Worker.Extensions.EventGrid/src/TypeConverters/EventGridStringArrayConverter.cs
  27. +6 −1 extensions/Worker.Extensions.EventGrid/src/Worker.Extensions.EventGrid.csproj
  28. +1 −1 extensions/Worker.Extensions.EventHubs/release_notes.md
  29. +12 −0 extensions/Worker.Extensions.EventHubs/src/Constants.cs
  30. +65 −0 extensions/Worker.Extensions.EventHubs/src/EventDataConverter.cs
  31. +4 −1 extensions/Worker.Extensions.EventHubs/src/EventHubTriggerAttribute.cs
  32. +2 −0 extensions/Worker.Extensions.EventHubs/src/Properties/AssemblyInfo.cs
  33. +11 −1 extensions/Worker.Extensions.EventHubs/src/Worker.Extensions.EventHubs.csproj
  34. +100 −0 extensions/Worker.Extensions.Http.AspNetCore/src/FromBodyConverstionFeature.cs
  35. +4 −0 ...ions/Worker.Extensions.Http.AspNetCore/src/FunctionsMiddleware/FunctionsHttpProxyingMiddleware.cs
  36. +1 −0 extensions/Worker.Extensions.Http.AspNetCore/src/Worker.Extensions.Http.AspNetCore.csproj
  37. 0 ...nsions/Worker.Extensions.Http/src/{IFromBodyConversionHandler.cs → IFromBodyConversionFeature.cs}
  38. +3 −1 extensions/Worker.Extensions.Kafka/release_notes.md
  39. +9 −0 extensions/Worker.Extensions.Kafka/src/KafkaTriggerAttribute.cs
  40. +1 −1 extensions/Worker.Extensions.Kafka/src/Properties/AssemblyInfo.cs
  41. +1 −1 extensions/Worker.Extensions.Kafka/src/Worker.Extensions.Kafka.csproj
  42. +1 −1 extensions/Worker.Extensions.ServiceBus/release_notes.md
  43. +12 −0 extensions/Worker.Extensions.ServiceBus/src/Constants.cs
  44. +3 −1 extensions/Worker.Extensions.ServiceBus/src/Properties/AssemblyInfo.cs
  45. +72 −0 extensions/Worker.Extensions.ServiceBus/src/ServiceBusReceivedMessageConverter.cs
  46. +6 −1 extensions/Worker.Extensions.ServiceBus/src/ServiceBusTriggerAttribute.cs
  47. +11 −1 extensions/Worker.Extensions.ServiceBus/src/Worker.Extensions.ServiceBus.csproj
  48. +42 −1 extensions/Worker.Extensions.Shared/Configuration/ConfigurationExtensions.cs
  49. +32 −0 extensions/Worker.Extensions.Shared/Exceptions/InvalidBindingSourceException.cs
  50. +32 −0 extensions/Worker.Extensions.Shared/Exceptions/InvalidContentTypeException.cs
  51. +0 −9 extensions/Worker.Extensions.Storage.Blobs/release_notes.md
  52. +3 −12 extensions/Worker.Extensions.Storage.Blobs/src/BlobInputAttribute.cs
  53. +286 −0 extensions/Worker.Extensions.Storage.Blobs/src/BlobStorageConverter.cs
  54. +3 −0 extensions/Worker.Extensions.Storage.Blobs/src/BlobTriggerAttribute.cs
  55. +14 −3 extensions/Worker.Extensions.Storage.Blobs/src/Config/BlobStorageBindingOptions.cs
  56. +2 −36 extensions/Worker.Extensions.Storage.Blobs/src/Config/BlobStorageBindingOptionsSetup.cs
  57. +1 −4 extensions/Worker.Extensions.Storage.Blobs/src/Constants.cs
  58. +5 −1 extensions/Worker.Extensions.Storage.Blobs/src/Properties/AssemblyInfo.cs
  59. +3 −4 extensions/Worker.Extensions.Storage.Blobs/src/Worker.Extensions.Storage.Blobs.csproj
  60. +0 −9 extensions/Worker.Extensions.Storage.Queues/release_notes.md
  61. +14 −0 extensions/Worker.Extensions.Storage.Queues/src/Constants.cs
  62. +91 −0 extensions/Worker.Extensions.Storage.Queues/src/JsonConverters/QueueMessageJsonConverter.cs
  63. +4 −2 extensions/Worker.Extensions.Storage.Queues/src/Properties/AssemblyInfo.cs
  64. +5 −1 extensions/Worker.Extensions.Storage.Queues/src/QueueTriggerAttribute.cs
  65. +76 −0 extensions/Worker.Extensions.Storage.Queues/src/TypeConverters/QueueConverterBase.cs
  66. +45 −0 extensions/Worker.Extensions.Storage.Queues/src/TypeConverters/QueueMessageBinaryDataConverter.cs
  67. +44 −0 extensions/Worker.Extensions.Storage.Queues/src/TypeConverters/QueueMessageConverter.cs
  68. +10 −1 extensions/Worker.Extensions.Storage.Queues/src/Worker.Extensions.Storage.Queues.csproj
  69. +6 −5 extensions/Worker.Extensions.Storage/release_notes.md
  70. +1 −1 extensions/Worker.Extensions.Storage/src/Worker.Extensions.Storage.csproj
  71. +10 −0 global.json
  72. +125 −37 host/azure-pipelines.yml
  73. +0 −2 host/src/.clang-format
  74. +0 −28 host/src/CMakeLists.txt
  75. +0 −64 host/src/CMakePresets.json
  76. +25 −0 host/src/FunctionsNetHost.sln
  77. +107 −0 host/src/FunctionsNetHost/AppLoader/AppLoader.cs
  78. +50 −0 host/src/FunctionsNetHost/AppLoader/HostFxr.cs
  79. +31 −0 host/src/FunctionsNetHost/AppLoader/NetHost.cs
  80. +19 −0 host/src/FunctionsNetHost/AppLoader/WorkerLoadStatusSignalManager.cs
  81. +0 −20 host/src/FunctionsNetHost/CMakeLists.txt
  82. +12 −0 host/src/FunctionsNetHost/Environment/EnvironmentSettingNames.cs
  83. +37 −0 host/src/FunctionsNetHost/Environment/EnvironmentUtils.cs
  84. +39 −0 host/src/FunctionsNetHost/FunctionsNetHost.csproj
  85. +134 −0 host/src/FunctionsNetHost/Grpc/GrpcClient.cs
  86. +18 −0 host/src/FunctionsNetHost/Grpc/GrpcWorkerStartupOptions.cs
  87. +101 −0 host/src/FunctionsNetHost/Grpc/IncomingGrpcMessageHandler.cs
  88. +61 −0 host/src/FunctionsNetHost/Grpc/MessageChannel.cs
  89. +53 −0 host/src/FunctionsNetHost/Grpc/PathUtils.cs
  90. +46 −0 host/src/FunctionsNetHost/Logger.cs
  91. +71 −0 host/src/FunctionsNetHost/Native/NativeExports.cs
  92. +32 −0 host/src/FunctionsNetHost/Native/NativeHostApplication.cs
  93. +9 −0 host/src/FunctionsNetHost/Native/NativeHostData.cs
  94. +66 −0 host/src/FunctionsNetHost/Program.cs
  95. +8 −0 host/src/FunctionsNetHost/Properties/launchSettings.json
  96. +4 −0 host/src/FunctionsNetHost/exports.def
  97. +7 −0 host/src/FunctionsNetHost/global.json
  98. +0 −89 host/src/FunctionsNetHost/main.cpp
  99. +0 −58 host/src/FunctionsNetHost/managedexports.cpp
  100. +0 −44 host/src/Protos/CMakeLists.txt
  101. +4 −8 host/src/README.md
  102. +0 −41 host/src/funcgrpc/CMakeLists.txt
  103. +0 −49 host/src/funcgrpc/byte_buffer_helper.cpp
  104. +0 −23 host/src/funcgrpc/byte_buffer_helper.h
  105. +0 −201 host/src/funcgrpc/func_bidi_reactor.cpp
  106. +0 −110 host/src/funcgrpc/func_bidi_reactor.h
  107. +0 −22 host/src/funcgrpc/func_log.cpp
  108. +0 −35 host/src/funcgrpc/func_log.h
  109. +0 −35 host/src/funcgrpc/func_perf_marker.h
  110. +0 −29 host/src/funcgrpc/funcgrpc.h
  111. +0 −28 host/src/funcgrpc/funcgrpc_handlers.h
  112. +0 −52 host/src/funcgrpc/funcgrpc_worker_config_handle.cpp
  113. +0 −27 host/src/funcgrpc/funcgrpc_worker_config_handle.h
  114. +0 −114 host/src/funcgrpc/handlers/funcgrpc_native_handler.cpp
  115. +0 −38 host/src/funcgrpc/handlers/funcgrpc_native_handler.h
  116. +0 −27 host/src/funcgrpc/messaging_channel.cpp
  117. +0 −51 host/src/funcgrpc/messaging_channel.h
  118. +0 −119 host/src/funcgrpc/nativehostapplication.cpp
  119. +0 −70 host/src/funcgrpc/nativehostapplication.h
  120. +0 −14 host/src/vcpkg.json
  121. +3 −2 host/tools/build/Microsoft.Azure.Functions.DotnetIsolatedNativeHost.nuspec
  122. +17 −1 host/tools/build/worker.config.json
  123. +11 −0 protos/azure-functions-language-worker-protobuf/src/proto/FunctionRpc.proto
  124. +10 −8 release_notes.md
  125. +36 −0 samples/AspNetIntegration/AspNetIntegration.csproj
  126. +22 −0 samples/AspNetIntegration/BodyBindingHttpTrigger.cs
  127. +32 −0 samples/AspNetIntegration/Program.cs
  128. +32 −0 samples/AspNetIntegration/RoutingMiddleware.cs
  129. +20 −0 samples/AspNetIntegration/SimpleHttpTrigger/SimpleHttpTrigger.cs
  130. +11 −0 samples/AspNetIntegration/host.json
  131. +8 −0 samples/AspNetIntegration/local.settings.json
  132. +1 −1 samples/FunctionApp/NuGet.Config
  133. +78 −53 samples/WorkerBindingSamples/Blob/BlobInputBindingSamples.cs
  134. +30 −0 samples/WorkerBindingSamples/Blob/BlobTriggerBindingSamples.cs
  135. 0 samples/WorkerBindingSamples/{ → Blob}/Book.cs
  136. +0 −28 samples/WorkerBindingSamples/Blob/ExpressionFunction.cs
  137. +271 −0 samples/WorkerBindingSamples/Cosmos/CosmosInputBindingFunctions.cs
  138. +42 −0 samples/WorkerBindingSamples/Cosmos/CosmosTriggerFunction.cs
  139. +11 −0 samples/WorkerBindingSamples/Cosmos/ToDoItem.cs
  140. +48 −0 samples/WorkerBindingSamples/EventGrid/CloudEventSamples.cs
  141. +48 −0 samples/WorkerBindingSamples/EventGrid/EventGridEventSamples.cs
  142. +68 −0 samples/WorkerBindingSamples/EventHubs/EventDataSamples.cs
  143. +5 −0 samples/WorkerBindingSamples/Program.cs
  144. +40 −0 samples/WorkerBindingSamples/Queue/QueueSamples.cs
  145. +70 −0 samples/WorkerBindingSamples/ServiceBus/ServiceBusReceivedMessageBindingSamples.cs
  146. +10 −4 samples/WorkerBindingSamples/WorkerBindingSamples.csproj
  147. +4 −1 samples/WorkerBindingSamples/local.settings.json
  148. +3 −3 sdk/Sdk.Analyzers/AsyncVoidAnalyzer.cs
  149. +1 −1 sdk/Sdk.Analyzers/AsyncVoidCodeFixProvider.cs
  150. +129 −0 sdk/Sdk.Analyzers/BindingTypeCodeRefactoringProvider.cs
  151. +129 −0 sdk/Sdk.Analyzers/BindingTypeNotSupported.cs
  152. +7 −1 sdk/Sdk.Analyzers/Constants.cs
  153. +44 −0 sdk/Sdk.Analyzers/DeferredBindingAttributeNotSupported.cs
  154. +13 −5 sdk/Sdk.Analyzers/DiagnosticDescriptors.cs
  155. +18 −1 sdk/Sdk.Analyzers/{ → Extensions}/AttributeDataExtensions.cs
  156. 0 sdk/Sdk.Analyzers/{ → Extensions}/MethodSymbolExtensions.cs
  157. +24 −0 sdk/Sdk.Analyzers/Extensions/NamedSymbolExtensions.cs
  158. 0 sdk/Sdk.Analyzers/{ → Extensions}/ParameterSymbolExtensions.cs
  159. +147 −0 sdk/Sdk.Analyzers/Extensions/TypeSymbolExtensions.cs
  160. +101 −0 sdk/Sdk.Analyzers/IterableBindingTypeExpectedForBlobContainerPath.cs
  161. +3 −3 sdk/Sdk.Analyzers/Sdk.Analyzers.csproj
  162. +0 −42 sdk/Sdk.Analyzers/TypeSymbolExtensions.cs
  163. +2 −2 sdk/Sdk.Analyzers/WebJobsAttributesNotSupported.cs
  164. +2 −0 sdk/Sdk.Generators/Constants.cs
  165. +23 −2 sdk/Sdk.Generators/FunctionExecutor/FunctionExecutorGenerator.Emitter.cs
  166. +15 −2 sdk/Sdk.Generators/FunctionExecutor/FunctionExecutorGenerator.cs
  167. +21 −3 sdk/Sdk.Generators/FunctionMetadataProviderGenerator/FunctionMetadataProviderGenerator.Emitter.cs
  168. +1 −1 sdk/Sdk.Generators/FunctionMetadataProviderGenerator/FunctionMetadataProviderGenerator.Parser.cs
  169. +14 −1 sdk/Sdk.Generators/FunctionMetadataProviderGenerator/FunctionMetadataProviderGenerator.cs
  170. +1 −1 sdk/Sdk.Generators/Sdk.Generators.csproj
  171. +1 −1 sdk/Sdk/Sdk.csproj
  172. +2 −0 sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.props
  173. +4 −0 sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets
  174. +6 −6 sdk/release_notes.md
  175. +1 −1 src/DotNetWorker.ApplicationInsights/DotNetWorker.ApplicationInsights.csproj
  176. +22 −0 src/DotNetWorker.ApplicationInsights/FunctionsApplicationInsightsExtensions.cs
  177. +34 −0 src/DotNetWorker.ApplicationInsights/FunctionsRoleInstanceProvider.cs
  178. +0 −42 src/DotNetWorker.ApplicationInsights/FunctionsTelemetryInitializer.cs
  179. +84 −0 src/DotNetWorker.ApplicationInsights/Initializers/FunctionsRoleEnvironmentTelmetryInitializer.cs
  180. +77 −0 src/DotNetWorker.ApplicationInsights/Initializers/FunctionsTelemetryInitializer.cs
  181. +2 −2 src/DotNetWorker.ApplicationInsights/README.md
  182. 0 src/DotNetWorker.Core/Diagnostics/{FunctionActivitySource.cs → FunctionActivitySourceFactory.cs}
  183. +1 −1 src/DotNetWorker.Core/DotNetWorker.Core.csproj
  184. +26 −0 src/DotNetWorker.Core/Hosting/CoreWorkerHostBuilderExtensions.cs
  185. +22 −0 src/DotNetWorker.Core/Hosting/IAutoConfigureStartup.cs
  186. +3 −6 src/DotNetWorker.Grpc/DotNetWorker.Grpc.csproj
  187. +1 −2 src/DotNetWorker.Grpc/Handlers/InvocationHandler.cs
  188. +40 −6 src/DotNetWorker.Grpc/NativeHostIntegration/NativeMethods.cs
  189. +49 −0 src/DotNetWorker.Grpc/NativeHostIntegration/Shim/NativeLibrary.Linux.cs
  190. +1 −1 src/DotNetWorker.Grpc/Properties/AssemblyInfo.cs
  191. +2 −2 src/DotNetWorker/DotNetWorker.csproj
  192. +3 −0 src/DotNetWorker/Hosting/WorkerHostBuilderExtensions.cs
  193. +1 −0 test/DotNetWorkerTests/ApplicationInsights/ApplicationInsightsConfigurationTests.cs
  194. +50 −4 test/DotNetWorkerTests/ApplicationInsights/FunctionsTelemetryInitializerTests.cs
  195. +1 −0 test/DotNetWorkerTests/DotNetWorkerTests.csproj
  196. +2 −2 test/DotNetWorkerTests/Features/DefaultInputConversionFeatureTests.cs
  197. +130 −0 test/DotNetWorkerTests/GrpcFunctionDefinitionTests.cs
  198. +1 −1 test/DotNetWorkerTests/Properties/AssemblyInfo.cs
  199. +420 −0 test/E2ETests/E2EApps/E2EApp/Blob/BlobInputBindingFunctions.cs
  200. +31 −9 test/E2ETests/E2EApps/E2EApp/Blob/{BlobTestFunctions.cs → BlobTriggerBindingFunctions.cs}
  201. +11 −0 test/E2ETests/E2EApps/E2EApp/Blob/Book.cs
  202. +132 −10 test/E2ETests/E2EApps/E2EApp/Cosmos/CosmosFunction.cs
  203. +4 −5 test/E2ETests/E2EApps/E2EApp/E2EApp.csproj
  204. +1 −1 test/E2ETests/E2EApps/E2EApp/NuGet.Config
  205. +24 −3 test/E2ETests/E2EApps/E2EApp/Queue/QueueTestFunctions.cs
  206. +15 −7 test/E2ETests/E2ETests/Constants.cs
  207. +161 −0 test/E2ETests/E2ETests/Cosmos/CosmosDBEndToEndTests.cs
  208. +0 −48 test/E2ETests/E2ETests/CosmosDBEndToEndTests.cs
  209. +1 −1 test/E2ETests/E2ETests/E2ETests.csproj
  210. +7 −0 test/E2ETests/E2ETests/Fixtures/FunctionAppFixture.cs
  211. +7 −9 test/E2ETests/E2ETests/Helpers/CosmosDBHelpers.cs
  212. +1 −1 test/E2ETests/E2ETests/Helpers/HttpHelpers.cs
  213. +17 −1 test/E2ETests/E2ETests/Helpers/StorageHelpers.cs
  214. +5 −5 test/E2ETests/E2ETests/HttpEndToEndTests.cs
  215. +352 −0 test/E2ETests/E2ETests/Storage/BlobEndToEndTests.cs
  216. +29 −48 test/E2ETests/E2ETests/{StorageEndToEndTests.cs → Storage/QueueEndToEndTests.cs}
  217. +1 −1 test/E2ETests/NuGet.Config
  218. +490 −14 test/FunctionMetadataGeneratorTests/FunctionMetadataGeneratorTests.cs
  219. +3 −2 test/FunctionMetadataGeneratorTests/SdkTests.csproj
  220. +6 −6 test/Sdk.Analyzers.Tests/{Sdk.Analyzers.Tests → }/AsyncVoidAnalyzerTests.cs
  221. +199 −0 test/Sdk.Analyzers.Tests/BindingTypeCodeRefactoringProviderTests.cs
  222. +159 −0 test/Sdk.Analyzers.Tests/BindingTypeNotSupportedTests.cs
  223. +134 −0 test/Sdk.Analyzers.Tests/DeferredBindingAttributeNotSupportedTests.cs
  224. +337 −0 test/Sdk.Analyzers.Tests/IterableBindingTypeExpectedForBlobContainerPathTests.cs
  225. +6 −3 test/Sdk.Analyzers.Tests/{Sdk.Analyzers.Tests → }/Sdk.Analyzers.Tests.csproj
  226. +7 −7 test/Sdk.Analyzers.Tests/{Sdk.Analyzers.Tests → }/WebJobsAttributesNotSupportedTests.cs
  227. +127 −17 test/Sdk.Generator.Tests/FunctionExecutor/FunctionExecutorGeneratorTests.cs
  228. +162 −0 test/Sdk.Generator.Tests/FunctionMetadataProviderGeneratorTests/AutoConfigureStartupTypeTests.cs
  229. +1 −1 .../Sdk.Generator.Tests/FunctionMetadataProviderGeneratorTests/IntegratedTriggersAndBindingsTests.cs
  230. +4 −49 test/Sdk.Generator.Tests/FunctionMetadataProviderGeneratorTests/StorageBindingTests.cs
  231. +13 −1 test/Sdk.Generator.Tests/TestHelpers.cs
  232. +925 −0 test/SdkE2ETests/Contents/WorkerBindingSamplesOutput/functions.metadata
  233. +6 −6 test/SdkE2ETests/Contents/functions.metadata
  234. +73 −3 test/SdkE2ETests/PublishTests.cs
  235. +2 −0 test/SdkE2ETests/SdkE2ETests.csproj
  236. +222 −0 test/Worker.Extensions.Tests/Blob/BlobClientTests.cs
  237. +149 −0 test/Worker.Extensions.Tests/Blob/BlobContainerClientTests.cs
  238. +191 −0 test/Worker.Extensions.Tests/Blob/BlobStorageConverterCoreTests.cs
  239. +21 −0 test/Worker.Extensions.Tests/Blob/BlobTestHelper.cs
  240. +319 −0 test/Worker.Extensions.Tests/Blob/ByteArrayTests.cs
  241. +368 −0 test/Worker.Extensions.Tests/Blob/POCOTests.cs
  242. +279 −0 test/Worker.Extensions.Tests/Blob/StreamTests.cs
  243. +268 −0 test/Worker.Extensions.Tests/Blob/StringTests.cs
  244. +411 −0 test/Worker.Extensions.Tests/Cosmos/CosmosDBConverterTests.cs
  245. +46 −0 test/Worker.Extensions.Tests/Cosmos/UtilitiesTests.cs
  246. +159 −0 test/Worker.Extensions.Tests/Cosmos/WorkerCosmosSerializerTests.cs
  247. +89 −0 test/Worker.Extensions.Tests/EventGrid/EventGridBinaryDataConverterTests.cs
  248. +92 −0 test/Worker.Extensions.Tests/EventGrid/EventGridCloudEventConverterTests.cs
  249. +92 −0 test/Worker.Extensions.Tests/EventGrid/EventGridEventConverterTests.cs
  250. +77 −0 test/Worker.Extensions.Tests/EventGrid/EventGridStringArrayConverterTests.cs
  251. +54 −0 test/Worker.Extensions.Tests/EventGrid/EventGridTestHelper.cs
  252. +193 −0 test/Worker.Extensions.Tests/EventHubs/EventDataConverterTests.cs
  253. +25 −0 test/Worker.Extensions.Tests/GrpcTestHelper.cs
  254. +84 −0 test/Worker.Extensions.Tests/Queue/QueueMessageBinaryDataConverterTests.cs
  255. +83 −0 test/Worker.Extensions.Tests/Queue/QueueMessageConverterTests.cs
  256. +41 −0 test/Worker.Extensions.Tests/Queue/QueueMessageJsonConverterTests.cs
  257. +26 −0 test/Worker.Extensions.Tests/Queue/QueuesTestHelper.cs
  258. +231 −0 test/Worker.Extensions.Tests/ServiceBus/ServiceBusReceivedMessageConverterTests.cs
  259. +9 −0 test/Worker.Extensions.Tests/Worker.Extensions.Tests.csproj
9 changes: 8 additions & 1 deletion DotNetWorker.sln
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker.Extensions.Kafka", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sdk.Analyzers", "sdk\Sdk.Analyzers\Sdk.Analyzers.csproj", "{055D602D-D2B3-416B-AC59-1972D832032A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sdk.Analyzers.Tests", "test\Sdk.Analyzers.Tests\Sdk.Analyzers.Tests\Sdk.Analyzers.Tests.csproj", "{A75EA1E1-2801-460C-87C0-DE6A82D30851}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sdk.Analyzers.Tests", "test\Sdk.Analyzers.Tests\Sdk.Analyzers.Tests.csproj", "{A75EA1E1-2801-460C-87C0-DE6A82D30851}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{083592CA-7DAB-44CE-8979-44FAFA46AEC3}"
EndProject
@@ -132,6 +132,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker.Extensions.SignalRSe
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker.Extensions.Tests", "test\Worker.Extensions.Tests\Worker.Extensions.Tests.csproj", "{17BDCE12-6964-4B87-B2AC-68CE270A3E9A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetIntegration", "samples\AspNetIntegration\AspNetIntegration.csproj", "{D2F67410-9933-42E8-B04A-E17634D83A30}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -326,6 +328,10 @@ Global
{17BDCE12-6964-4B87-B2AC-68CE270A3E9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{17BDCE12-6964-4B87-B2AC-68CE270A3E9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{17BDCE12-6964-4B87-B2AC-68CE270A3E9A}.Release|Any CPU.Build.0 = Release|Any CPU
{D2F67410-9933-42E8-B04A-E17634D83A30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D2F67410-9933-42E8-B04A-E17634D83A30}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2F67410-9933-42E8-B04A-E17634D83A30}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2F67410-9933-42E8-B04A-E17634D83A30}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -383,6 +389,7 @@ Global
{1F6B7CF6-0CC8-4C7F-825F-74B0BEC1CF0A} = {A7B4FF1E-3DF7-4F28-9333-D0961CDDF702}
{286F9EE3-00AE-4EFA-BFD8-A2E58BC809D2} = {FD7243E4-BF18-43F8-8744-BA1D17ACF378}
{17BDCE12-6964-4B87-B2AC-68CE270A3E9A} = {FD7243E4-BF18-43F8-8744-BA1D17ACF378}
{D2F67410-9933-42E8-B04A-E17634D83A30} = {9D6603BD-7EA2-4D11-A69C-0D9E01317FD6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {497D2ED4-A13E-4BCA-8D29-F30CA7D0EA4A}
2 changes: 1 addition & 1 deletion NuGet.Config
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="azure_app_service" value="https://www.myget.org/F/azure-appservice/api/v2" />
<add key="AzureFunctionsTempStaging" value="https://azfunc.pkgs.visualstudio.com/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/AzureFunctionsTempStaging/nuget/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json"/>
</packageSources>
</configuration>
24 changes: 12 additions & 12 deletions build/install-dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
steps:
- pwsh: |
Invoke-WebRequest 'https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1' -OutFile 'dotnet-install.ps1'
./dotnet-install.ps1 -InstallDir "$env:ProgramFiles/dotnet" -Version "6.0.100" -Channel 'release'
dotnet --info
displayName: 'Install the .Net version used by the Core Tools for Windows'
condition: and(eq( variables['Agent.OS'], 'Windows_NT' ), eq(variables['FUNCTIONSRUNTIMEVERSION'], '4'))
# Some tests rely on 6.0.412 existing
- task: UseDotNet@2
displayName: 'Install .NET6 SDK'
inputs:
packageType: 'sdk'
version: "6.0.412"

- bash: |
curl -sSL https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh | bash /dev/stdin -v '6.0.100' -c 'release' --install-dir /usr/share/dotnet
dotnet --info
displayName: 'Install the .Net version used by the Core Tools for Linux'
condition: and(eq( variables['Agent.OS'], 'Linux' ), eq(variables['FUNCTIONSRUNTIMEVERSION'], '4'))

# The SDK we use to build
- task: UseDotNet@2
displayName: 'Install current .NET SDK'
inputs:
packageType: 'sdk'
useGlobalJson: true
26 changes: 26 additions & 0 deletions docs/analyzer-rules/AZFW0009.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# AZFW0009: Invalid use of SupportsDeferredBinding attribute

| | Value |
|-|-|
| **Rule ID** |AZFW0009|
| **Category** |[Usage]|
| **Severity** |Error|

## Cause

This rule is triggered when the `SupportsDeferredBinding` attribute is used on any class other
than an input (`InputBindingAttribute`) or trigger (`TriggerBindingAttribute`) binding based class.

## Rule description

The `SupportsDeferredBinding` attribute is used to determine if a binding supports deferred binding.
Currently, this feature is only supported for input and trigger bindings. Output bindings are not supported
and this attribute should not be used on any other class type.

## How to fix violations

Remove the use of the `SupportsDeferredBinding` attribute from your class.

## When to suppress warnings

This rule should not be suppressed because this error may prevent your Azure Functions from running.
42 changes: 42 additions & 0 deletions docs/analyzer-rules/AZFW0010.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# AZFW0010: Invalid binding type

| | Value |
|-|-|
| **Rule ID** |AZFW00010|
| **Category** |[Usage]|
| **Severity** |Warning|

## Cause

This rule is triggered when a function is binding to a type that is not supported
by the binding attribute being used.

## Rule description

Some bindings advertise the types that they support. If a binding advertises supported types
and does not support falling back to built-in converters, then this rule will will be flagged.

For example if you're binding to a `QueueTrigger` and the only supported type is `string` and
your function is binding to a `bool`, then you will see this warning.

## How to fix violations

Change the binding type to a type that is supported by the binding your function is using.

### Supported Types

You can refer to the [public documentation](https://learn.microsoft.com/azure/azure-functions/functions-bindings-storage-blob?tabs=in-process%2Cextensionv5%2Cextensionv3&pivots=programming-language-csharp) to see which types are supported.

| Binding | Supported Types |
| ------- | --------------- |
| BlobTrigger | POCO, String, Stream, Byte[], BlobClient*, BlobContainerClient |
| BlobInput | POCO, IEnumerable*<POCO>, String, IEnumberable<String>, Stream, IEnumberable<Stream>, Byte[], BlobClient, IEnumerable<BlobClient>, BlobContainerClient |
| CosmosDBTrigger | POCO, IEnumerable<POCO> |
| CosmosDBInput | POCO, IEnumerable<POCO>, CosmosClient, Database, Container |
| EventGridTrigger | String, IEnumerable<String>, CloudEvent, IEnumerable<CloudEvent>, EventGridEvent, IEnumerable<EventGridEvent> |
| EventHubTrigger | POCO, POCO[], String, String[] |
| QueueTrigger | POCO, String, BinaryData, QueueMessage |
| ServiceBusTrigger | String, String[], ServiceBusReceivedMessage, ServiceBusReceivedMessage[] |
| TableInput | POCO, IEnumerable<POCO>, TableEntity, IEnumerable<TableEntity>, TableClient |

> \* Where `BlobClient` is supported AppendBlobClient, BaseBlobClient, BlockBlobClient and PageBlobClient are also supported
25 changes: 25 additions & 0 deletions docs/analyzer-rules/AZFW0011.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# AZFW0011: Invalid binding type

| | Value |
|-|-|
| **Rule ID** |AZFW00011|
| **Category** |[Usage]|
| **Severity** |Error|

## Cause

This rule is triggered when a function is binding to a non-iterable type for a blob container path.

## Rule description

When using the `BlobInputAttribute` with a container path, the target parameter must be of iterable type such as `IEnumerable<T>` except when binding to `BlobContainerClient`.

Example, if your function uses `BlobInput("<container path>")` and it is binding to a `string`, this rule will be violated.

## How to fix violations

Change the binding type to an iterable type such as `IEnumerable<T>` or provide blob path `container/blob` instead of a container path when using a non-iterable binding type is desired.

### Supported Types

You can refer to the [public documentation](https://learn.microsoft.com/azure/azure-functions/functions-bindings-storage-blob?tabs=in-process%2Cextensionv5%2Cextensionv3&pivots=programming-language-csharp) to see which types are supported for blob container.
4 changes: 2 additions & 2 deletions extensions/Worker.Extensions.Abstractions/release_notes.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,6 @@
- My change description (#PR/#issue)
-->

### Microsoft.Azure.Functions.Worker.Extensions.Abstractions 1.3.0
### Microsoft.Azure.Functions.Worker.Extensions.Abstractions <version>

- Add SupportsDeferredBinding attribute
- <entry>
4 changes: 2 additions & 2 deletions extensions/Worker.Extensions.CosmosDB/release_notes.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,6 @@
- My change description (#PR/#issue)
-->

### Microsoft.Azure.Functions.Worker.Extensions.CosmosDB <version>
### Microsoft.Azure.Functions.Worker.Extensions.CosmosDB 4.4.1

- Add BindingCapabilities attribute to CosmosDb trigger to express function-level retry capabilities. (#1457)
- [Bug] Update CosmosOptions from using IOptionsSnapshot to IOptionsMonitor to avoid DI scoping issues
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// 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 System.Collections.Concurrent;
using Azure.Core;
using Microsoft.Azure.Cosmos;
using Microsoft.Azure.Functions.Worker.Extensions.CosmosDB;

namespace Microsoft.Azure.Functions.Worker
{
internal class CosmosDBBindingOptions
{
public string? ConnectionName { get; set; }

public string? ConnectionString { get; set; }

public string? AccountEndpoint { get; set; }

public TokenCredential? Credential { get; set; }

public CosmosSerializer? Serializer { get; set; }

internal string BuildCacheKey(string connection, string region) => $"{connection}|{region}";

internal ConcurrentDictionary<string, CosmosClient> ClientCache { get; } = new ConcurrentDictionary<string, CosmosClient>();

internal virtual CosmosClient GetClient(string preferredLocations = "")
{
if (string.IsNullOrEmpty(ConnectionName))
{
throw new ArgumentNullException(nameof(ConnectionName));
}

string cacheKey = BuildCacheKey(ConnectionName!, preferredLocations);

CosmosClientOptions cosmosClientOptions = new ()
{
ConnectionMode = ConnectionMode.Gateway
};

if (!string.IsNullOrEmpty(preferredLocations))
{
cosmosClientOptions.ApplicationPreferredRegions = Utilities.ParsePreferredLocations(preferredLocations);
}

if (Serializer is not null)
{
cosmosClientOptions.Serializer = Serializer;
}

return ClientCache.GetOrAdd(cacheKey, (c) => CreateService(cosmosClientOptions));
}

private CosmosClient CreateService(CosmosClientOptions cosmosClientOptions)
{
return string.IsNullOrEmpty(ConnectionString)
? new CosmosClient(AccountEndpoint, Credential, cosmosClientOptions) // AAD auth
: new CosmosClient(ConnectionString, cosmosClientOptions); // Connection string based auth
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// 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.Functions.Worker.Extensions;
using Microsoft.Azure.Functions.Worker.Extensions.CosmosDB;
using Microsoft.Extensions.Azure;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;

namespace Microsoft.Azure.Functions.Worker
{
internal class CosmosDBBindingOptionsSetup : IConfigureNamedOptions<CosmosDBBindingOptions>
{
private readonly IConfiguration _configuration;
private readonly AzureComponentFactory _componentFactory;

public CosmosDBBindingOptionsSetup(IConfiguration configuration, AzureComponentFactory componentFactory)
{
_configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
_componentFactory = componentFactory ?? throw new ArgumentNullException(nameof(componentFactory));
}

public void Configure(CosmosDBBindingOptions options)
{
Configure(Options.DefaultName, options);
}

public void Configure(string connectionName, CosmosDBBindingOptions options)
{
IConfigurationSection connectionSection = _configuration.GetWebJobsConnectionStringSection(connectionName);

if (!connectionSection.Exists())
{
throw new InvalidOperationException($"Cosmos DB connection configuration '{connectionName}' does not exist. " +
"Make sure that it is a defined App Setting.");
}

options.ConnectionName = connectionName;

if (!string.IsNullOrWhiteSpace(connectionSection.Value))
{
options.ConnectionString = connectionSection.Value;
}
else
{
options.AccountEndpoint = connectionSection[Constants.AccountEndpoint];
if (string.IsNullOrWhiteSpace(options.AccountEndpoint))
{
throw new InvalidOperationException($"Connection should have an '{Constants.AccountEndpoint}' property or be a " +
$"string representing a connection string.");
}

options.Credential = _componentFactory.CreateTokenCredential(connectionSection);
}
}
}
}
15 changes: 15 additions & 0 deletions extensions/Worker.Extensions.CosmosDB/src/Constants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

namespace Microsoft.Azure.Functions.Worker.Extensions.CosmosDB
{
internal static class Constants
{
internal const string CosmosExtensionName = "CosmosDB";
internal const string ConfigurationSectionName = "AzureWebJobs";
internal const string ConnectionStringsSectionName = "ConnectionStrings";
internal const string AccountEndpoint = "accountEndpoint";
internal const string JsonContentType = "application/json";
}
}
Loading