├── .editorconfig ├── .github ├── ISSUE_TEMPLATE │ ├── 01-bug-report.yml │ ├── 02-feature-request.yml │ ├── 03-migration-question-or-issue.yml │ └── config.yml ├── policies │ ├── issue.add-no-recent-activity.yml │ ├── issue.close-duplicate-issues.yml │ ├── issue.close-stale-issues.yml │ ├── issue.flag-for-triage.yml │ ├── issue.prevent-auto-close.yml │ ├── issue.remove-needs-author-feedback.yml │ ├── issue.remove-needs-triage.yml │ ├── issue.remove-no-recent-activity-with-comment.yml │ └── pullrequest.all.yml ├── pull_request_template.md └── workflows │ └── dependency-review.yml ├── .gitignore ├── .reporoot ├── .vscode ├── launch.json └── tasks.json ├── CHECKENFORCER ├── CODE_OF_CONDUCT.md ├── Directory.Build.props ├── Directory.Build.targets ├── DotNetWorker.Extensions.sln ├── DotNetWorker.Samples.sln ├── DotNetWorker.sln ├── LICENSE ├── NuGet.Config ├── README.md ├── SECURITY.md ├── build ├── AspNetCore.slnf ├── Common.props ├── DotNetWorker.Core.slnf ├── Extensions.props ├── Icon.props ├── PackageInfo.props ├── Sdk.slnf ├── SharedReferences.targets ├── icon.png └── install-dotnet.yml ├── docs ├── _config.yml └── analyzer-rules │ ├── AZFW0001.md │ ├── AZFW0002.md │ ├── AZFW0003.md │ ├── AZFW0004.md │ ├── AZFW0005.md │ ├── AZFW0006.md │ ├── AZFW0007.md │ ├── AZFW0008.md │ ├── AZFW0009.md │ ├── AZFW0010.md │ ├── AZFW0011.md │ ├── AZFW0012.md │ ├── AZFW0013.md │ ├── AZFW0014.md │ ├── AZFW0015.md │ ├── AZFW0016.md │ ├── RULE_TEMPLATE.md │ └── index.md ├── eng ├── build │ ├── RepositoryInfo.targets │ ├── WorkerExtensions.targets │ └── extensionValidationProjectTemplate.txt └── ci │ ├── code-mirror.yml │ ├── host │ ├── official-build.yml │ ├── official-release.yml │ └── public-build.yml │ ├── official-build.yml │ ├── official-release.yml │ ├── public-build.yml │ └── templates │ ├── jobs │ ├── build-net-host.yml │ ├── run-extension-tests.yml │ ├── run-integration-tests-linux.yml │ ├── run-integration-tests-windows.yml │ └── run-unit-tests.yml │ ├── official │ └── jobs │ │ ├── build-artifacts.yml │ │ ├── build-extension-artifacts.yml │ │ ├── build-host-artifacts-linux.yml │ │ ├── build-host-artifacts-windows.yml │ │ ├── build-host-prelaunch-artifacts.yml │ │ └── pack-host-artifacts.yml │ ├── pipelines │ └── release-extension-packages.yml │ ├── steps │ ├── build-extension-project.yml │ ├── install-dotnet.yml │ └── setup-e2e-tests.yml │ └── variables │ └── build.yml ├── extensions ├── Directory.Build.targets ├── Worker.Extensions.Abstractions │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ ├── release_notes.md │ └── src │ │ ├── BindingAttribute.cs │ │ ├── BindingCapabilitiesAttribute.cs │ │ ├── BindingPropertyNameAttribute.cs │ │ ├── DefaultValueAttribute.cs │ │ ├── ExponentialBackoffRetryAttribute.cs │ │ ├── ExtensionInformationAttribute.cs │ │ ├── FixedDelayRetryAttribute.cs │ │ ├── FunctionAttribute.cs │ │ ├── ISupportCardinality.cs │ │ ├── InputBindingAttribute.cs │ │ ├── KnownBindingCapabilities.cs │ │ ├── OutputBindingAttribute.cs │ │ ├── RetryAttribute.cs │ │ ├── SupportsDeferredBindingAttribute.cs │ │ ├── TriggerBindingAttribute.cs │ │ └── Worker.Extensions.Abstractions.csproj ├── Worker.Extensions.CosmosDB │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ ├── release_notes.md │ └── src │ │ ├── Config │ │ ├── CosmosDBBindingOptions.cs │ │ ├── CosmosDBBindingOptionsSetup.cs │ │ └── CosmosDBExtensionOptions.cs │ │ ├── Constants.cs │ │ ├── CosmosDBConverter.cs │ │ ├── CosmosDBInputAttribute.cs │ │ ├── CosmosDBOutputAttribute.cs │ │ ├── CosmosDBTriggerAttribute.cs │ │ ├── CosmosExtensionStartup.cs │ │ ├── Extensions │ │ ├── CloningExtensions.cs │ │ └── FunctionsWorkerApplicationBuilderExtensions.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Utilities.cs │ │ ├── Worker.Extensions.CosmosDB.csproj │ │ └── WorkerCosmosSerializer.cs ├── Worker.Extensions.EventGrid │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ ├── release_notes.md │ └── src │ │ ├── EventGridOutputAttribute.cs │ │ ├── EventGridTriggerAttribute.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── TypeConverters │ │ ├── EventGridBinaryDataConverter.cs │ │ ├── EventGridCloudEventConverter.cs │ │ ├── EventGridConverterBase.cs │ │ ├── EventGridEventConverter.cs │ │ └── EventGridStringArrayConverter.cs │ │ └── Worker.Extensions.EventGrid.csproj ├── Worker.Extensions.EventHubs │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ ├── release_notes.md │ └── src │ │ ├── Constants.cs │ │ ├── EventDataConverter.cs │ │ ├── EventHubOutputAttribute.cs │ │ ├── EventHubTriggerAttribute.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── Worker.Extensions.EventHubs.csproj ├── Worker.Extensions.Http.AspNetCore.Analyzers │ └── src │ │ ├── CodeFixForHttpResultAttributeExpected.cs │ │ ├── CodeFixForRegistrationInASPNetCoreIntegration.cs │ │ ├── DiagnosticDescriptors.cs │ │ ├── HttpResultAttributeExpectedAnalyzer.cs │ │ ├── ITypeSymbolExtensions.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── RegistrationExpectedInASPNetIntegration.cs │ │ ├── SymbolUtils.cs │ │ └── Worker.Extensions.Http.AspNetCore.Analyzers.csproj ├── Worker.Extensions.Http.AspNetCore │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ ├── release_notes.md │ └── src │ │ ├── AspNetMiddleware │ │ ├── FunctionHttpBinding.cs │ │ ├── FunctionsEndpointDataSource.cs │ │ ├── FunctionsHttpContextExtensions.cs │ │ ├── HostJsonModel.cs │ │ └── WorkerRequestServicesMiddleware.cs │ │ ├── Constants.cs │ │ ├── Coordinator │ │ ├── ContextReference.cs │ │ ├── DefaultHttpCoordinator.cs │ │ └── IHttpCoordinator.cs │ │ ├── FromBodyConversionFeature.cs │ │ ├── FunctionContext │ │ └── FunctionContextExtensions.cs │ │ ├── FunctionsApplicationBuilderAspNetCoreExtensions.cs │ │ ├── FunctionsHostBuilderExtensions.cs │ │ ├── FunctionsMiddleware │ │ └── FunctionsHttpProxyingMiddleware.cs │ │ ├── HttpContextConverter.cs │ │ ├── HttpDataModel │ │ ├── AspNetCoreHttpHeadersCollection.cs │ │ ├── AspNetCoreHttpRequestData.cs │ │ ├── AspNetCoreHttpRequestDataFeature.cs │ │ ├── AspNetCoreHttpResponseData.cs │ │ └── AspNetCoreResponseCookies.cs │ │ ├── HttpUriProvider.cs │ │ ├── Infrastructure │ │ ├── ExtensionTrace.General.cs │ │ └── ExtensionTrace.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Utilities.cs │ │ ├── Worker.Extensions.Http.AspNetCore.csproj │ │ └── WorkerBuilderExtensions.cs ├── Worker.Extensions.Http │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ ├── release_notes.md │ └── src │ │ ├── AuthorizationLevel.cs │ │ ├── DefaultFromBodyConversionFeature.cs │ │ ├── FromBodyAttribute.cs │ │ ├── FromBodyConverter.cs │ │ ├── HttpResultAttribute.cs │ │ ├── HttpTriggerAttribute.cs │ │ ├── IFromBodyConversionFeature.cs │ │ ├── KeyValuePairExtensions.cs │ │ └── Worker.Extensions.Http.csproj ├── Worker.Extensions.Kafka │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ ├── release_notes.md │ └── src │ │ ├── BrokerAuthenticationMode.cs │ │ ├── BrokerProtocol.cs │ │ ├── KafkaMessageKeyType.cs │ │ ├── KafkaOutputAttribute.cs │ │ ├── KafkaTriggerAttribute.cs │ │ ├── OAuthBearerMethod.cs │ │ └── Worker.Extensions.Kafka.csproj ├── Worker.Extensions.RabbitMQ │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ ├── release_notes.md │ └── src │ │ ├── RabbitMQOutputAttribute.cs │ │ ├── RabbitMQTriggerAttribute.cs │ │ └── Worker.Extensions.RabbitMQ.csproj ├── Worker.Extensions.Rpc │ ├── README.md │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ ├── release_notes.md │ └── src │ │ ├── ConfigurationExtensions.cs │ │ ├── FunctionsGrpcOptions.cs │ │ ├── GrpcHttpClientBuilderExtensions.cs │ │ ├── RpcServiceCollectionExtensions.NetApp.cs │ │ ├── RpcServiceCollectionExtensions.NetStandard.cs │ │ ├── RpcServiceCollectionExtensions.cs │ │ └── Worker.Extensions.Rpc.csproj ├── Worker.Extensions.SendGrid │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ ├── release_notes.md │ └── src │ │ ├── SendGridAttribute.cs │ │ └── Worker.Extensions.SendGrid.csproj ├── Worker.Extensions.ServiceBus │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ ├── release_notes.md │ └── src │ │ ├── Constants.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Proto │ │ └── settlement.proto │ │ ├── ServiceBusEntityType.cs │ │ ├── ServiceBusExtensionStartup.cs │ │ ├── ServiceBusMessageActions.cs │ │ ├── ServiceBusMessageActionsConverter.cs │ │ ├── ServiceBusOutputAttribute.cs │ │ ├── ServiceBusReceivedMessageConverter.cs │ │ ├── ServiceBusSessionMessageActions.cs │ │ ├── ServiceBusSessionMessageActionsConverter.cs │ │ ├── ServiceBusTriggerAttribute.cs │ │ └── Worker.Extensions.ServiceBus.csproj ├── Worker.Extensions.Shared │ ├── Configuration │ │ └── ConfigurationExtensions.cs │ ├── Exceptions │ │ ├── InvalidBindingSourceException.cs │ │ └── InvalidContentTypeException.cs │ ├── Reflection │ │ ├── ParameterBinder.cs │ │ └── TypeExtensions.cs │ ├── Worker.Extensions.Shared.csproj │ └── readme.md ├── Worker.Extensions.SignalRService │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ ├── release_notes.md │ └── src │ │ ├── Configuration │ │ ├── ConfigurationExtensions.cs │ │ └── ServiceManagerOptionsSetup.cs │ │ ├── Constants.cs │ │ ├── Converters │ │ └── HttpHeaderDictionaryConverter.cs │ │ ├── Hubs │ │ ├── HubContextProvider.cs │ │ ├── ServerlessHub.cs │ │ ├── ServerlessHubOfT.cs │ │ ├── ServiceHubContextInitializer.cs │ │ └── ServiceHubContextInitializerOfT.cs │ │ ├── Models │ │ ├── SignalRConnectionInfo.cs │ │ ├── SignalREndpoint.cs │ │ ├── SignalRGroupAction.cs │ │ ├── SignalRInvocationContext.cs │ │ ├── SignalRMessageAction.cs │ │ └── SignalRNegotiationContext.cs │ │ ├── SignalRConnectionInfoInputAttribute.cs │ │ ├── SignalREndpointsInputAttribute.cs │ │ ├── SignalRNegotiationInputAttribute.cs │ │ ├── SignalROutputAttribute.cs │ │ ├── SignalRServiceDependencyInjectionExtensions.cs │ │ ├── SignalRTriggerAttribute.cs │ │ └── Worker.Extensions.SignalRService.csproj ├── Worker.Extensions.Storage.Blobs │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ └── src │ │ ├── BlobInputAttribute.cs │ │ ├── BlobOutputAttribute.cs │ │ ├── BlobStorageConverter.cs │ │ ├── BlobStorageExtensionStartup.cs │ │ ├── BlobTriggerAttribute.cs │ │ ├── BlobTriggerSource.cs │ │ ├── Config │ │ ├── BlobStorageBindingOptions.cs │ │ └── BlobStorageBindingOptionsSetup.cs │ │ ├── Constants.cs │ │ ├── Extensions │ │ └── FunctionsWorkerApplicationBuilderExtensions.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── Worker.Extensions.Storage.Blobs.csproj ├── Worker.Extensions.Storage.Queues │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ └── src │ │ ├── Constants.cs │ │ ├── JsonConverters │ │ └── QueueMessageJsonConverter.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── QueueOutputAttribute.cs │ │ ├── QueueTriggerAttribute.cs │ │ ├── TypeConverters │ │ ├── QueueConverterBase.cs │ │ ├── QueueMessageBinaryDataConverter.cs │ │ └── QueueMessageConverter.cs │ │ └── Worker.Extensions.Storage.Queues.csproj ├── Worker.Extensions.Storage │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ ├── release_notes.md │ └── src │ │ └── Worker.Extensions.Storage.csproj ├── Worker.Extensions.Tables │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ ├── release_notes.md │ └── src │ │ ├── Config │ │ ├── TablesBindingOptions.cs │ │ └── TablesBindingOptionsSetup.cs │ │ ├── Constants.cs │ │ ├── Extensions │ │ └── FunctionsWorkerApplicationBuilderExtensions.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── TableExtensionStartup.cs │ │ ├── TableInputAttribute.cs │ │ ├── TableOutputAttribute.cs │ │ ├── TypeConverters │ │ ├── TableClientConverter.cs │ │ ├── TableConverterBase.cs │ │ ├── TableEntityConverter.cs │ │ ├── TableEntityEnumerableConverter.cs │ │ └── TablePocoConverter.cs │ │ └── Worker.Extensions.Tables.csproj ├── Worker.Extensions.Timer │ ├── ci │ │ ├── official-build.yml │ │ ├── official-release.yml │ │ └── public-build.yml │ ├── release_notes.md │ └── src │ │ ├── Converters │ │ └── TimerInfoConverter.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── ScheduleStatus.cs │ │ ├── TimerInfo.cs │ │ ├── TimerTriggerAttribute.cs │ │ └── Worker.Extensions.Timer.csproj └── Worker.Extensions.Warmup │ ├── ci │ ├── official-build.yml │ ├── official-release.yml │ └── public-build.yml │ ├── release_notes.md │ └── src │ ├── WarmupTrigger.cs │ └── Worker.Extensions.Warmup.csproj ├── global.json ├── host ├── .gitignore ├── README.md ├── docs │ └── build.md ├── src │ ├── FunctionsNetHost.sln │ ├── FunctionsNetHost │ │ ├── AppLoader │ │ │ ├── AppLoader.cs │ │ │ ├── HostFxr.cs │ │ │ ├── NetHost.cs │ │ │ └── WorkerLoadStatusSignalManager.cs │ │ ├── Configuration │ │ │ └── Configuration.cs │ │ ├── Environment │ │ │ ├── EnvironmentUtils.cs │ │ │ └── EnvironmentVariables.cs │ │ ├── FunctionsNetHost.csproj │ │ ├── Grpc │ │ │ ├── Exceptions │ │ │ │ ├── EnvironmentReloadNotSupportedException.cs │ │ │ │ └── FunctionAppPayloadNotFoundException.cs │ │ │ ├── GrpcClient.cs │ │ │ ├── GrpcWorkerStartupOptions.cs │ │ │ ├── IncomingGrpcMessageHandler.cs │ │ │ ├── MessageChannel.cs │ │ │ ├── WorkerCapabilities.cs │ │ │ └── WorkerConfig │ │ │ │ ├── WorkerConfig.cs │ │ │ │ ├── WorkerConfigSerializerContext.cs │ │ │ │ ├── WorkerConfigUtils.cs │ │ │ │ └── WorkerDescription.cs │ │ ├── Logger.cs │ │ ├── Native │ │ │ ├── NativeExports.cs │ │ │ ├── NativeHostApplication.cs │ │ │ └── NativeHostData.cs │ │ ├── Prelaunch │ │ │ └── Prelauncher.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── exports.def │ │ └── global.json │ ├── PrelaunchApp │ │ ├── App.csproj │ │ └── Program.cs │ └── README.md └── tools │ └── build │ ├── Microsoft.Azure.Functions.DotnetIsolatedNativeHost.nuspec │ └── worker.config.json ├── key.snk ├── protos └── azure-functions-language-worker-protobuf │ ├── .gitignore │ ├── CODEOWNERS │ ├── LICENSE │ ├── README.md │ └── src │ └── proto │ ├── FunctionRpc.proto │ ├── identity │ └── ClaimsIdentityRpc.proto │ └── shared │ └── NullableTypes.proto ├── release_notes.md ├── run-e2e-tests.ps1 ├── samples ├── AspNetIntegration │ ├── AspNetIntegration.csproj │ ├── BodyBindingHttpTrigger.cs │ ├── FileDownload.cs │ ├── MultipleOutputBindings.cs │ ├── Program.cs │ ├── RoutingMiddleware.cs │ ├── SimpleHttpTrigger │ │ └── SimpleHttpTrigger.cs │ ├── host.json │ └── local.settings.json ├── Configuration │ ├── Configuration.csproj │ ├── HttpFunction.cs │ ├── Program.cs │ ├── README.md │ ├── host.json │ └── local.settings.json ├── CustomMiddleware │ ├── CustomMiddleware.csproj │ ├── ExceptionHandlingMiddleware.cs │ ├── HttpFunction.cs │ ├── HttpTriggerWithMultipleOutputBindings.cs │ ├── MyCustomMiddleware.cs │ ├── Program.cs │ ├── README.md │ ├── StampHttpHeaderMiddleware.cs │ ├── host.json │ └── local.settings.json ├── Directory.Build.props ├── EntityFramework │ ├── EntityFramework.csproj │ ├── HttpTrigger.cs │ ├── Models.cs │ ├── Program.cs │ ├── README.md │ ├── host.json │ ├── local.settings.sample.json │ └── test.http ├── Extensions │ ├── Blob │ │ ├── BlobFunction.cs │ │ ├── BlobInputBindingSamples.cs │ │ ├── BlobTriggerBindingSamples.cs │ │ └── Book.cs │ ├── CosmosDB │ │ ├── CosmosDBFunction.cs │ │ └── CosmosInputBindingFunctions.cs │ ├── DependencyInjection │ │ └── DependencyInjectionFunction.cs │ ├── EventGrid │ │ ├── CloudEventSamples.cs │ │ ├── EventGridEventSamples.cs │ │ └── EventGridFunction.cs │ ├── EventHubs │ │ ├── EventHubsFunction.cs │ │ └── EventHubsTriggerMetadata.cs │ ├── Extensions.csproj │ ├── Http │ │ └── HttpFunction.cs │ ├── Kafka │ │ └── KafkaFunction.cs │ ├── MultiOutput │ │ └── MultiOutput.cs │ ├── Program.cs │ ├── Queue │ │ └── QueueFunction.cs │ ├── README.md │ ├── RabbitMQ │ │ └── RabbitMQFunction.cs │ ├── ServiceBus │ │ └── ServiceBusReceivedMessageFunctions.cs │ ├── SignalR │ │ ├── SignalRFunction.cs │ │ ├── SignalRNegotiationFunctions.cs │ │ ├── SignalROutputBindingFunctions.cs │ │ ├── SignalROutputBindingFunctions2.cs │ │ └── SignalRTriggerFunctions.cs │ ├── Table │ │ └── TableFunction.cs │ ├── Timer │ │ └── TimerFunction.cs │ ├── Warmup │ │ └── Warmup.cs │ ├── host.json │ └── local.settings.json ├── FunctionApp │ ├── FunctionApp.csproj │ ├── HttpTriggerSimple │ │ └── HttpTriggerSimple.cs │ ├── HttpTriggerWithBlobInput │ │ └── HttpTriggerWithBlobInput.cs │ ├── HttpTriggerWithCancellation │ │ └── HttpTriggerWithCancellation.cs │ ├── HttpTriggerWithDependencyInjection │ │ └── HttpTriggerWithDependencyInjection.cs │ ├── HttpTriggerWithMultipleOutputBindings │ │ └── HttpTriggerWithMultipleOutputBindings.cs │ ├── NuGet.Config │ ├── Program.cs │ ├── QueueTrigger │ │ └── QueueTrigger.cs │ ├── host.json │ └── local.settings.json ├── Net7Worker │ ├── EventHubCancellationToken.cs │ └── README.md ├── Net9FunctionApp │ ├── HelloHttp.cs │ ├── Net9FunctionApp.csproj │ ├── Program.cs │ ├── host.json │ └── local.settings.json ├── NetFxWorker │ ├── HttpFunction.cs │ ├── NetFxWorker.csproj │ ├── Program.cs │ ├── README.md │ ├── host.json │ └── local.settings.json └── README.md ├── sdk ├── FunctionMetadataLoaderExtension │ ├── FunctionMetadataJsonReader.cs │ ├── FunctionMetadataJsonReaderOptions.cs │ ├── FunctionMetadataLoaderExtension.csproj │ ├── JsonFunctionProvider.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Startup.cs ├── Sdk.Analyzers │ ├── AsyncVoidAnalyzer.cs │ ├── AsyncVoidCodeFixProvider.cs │ ├── BindingTypeCodeRefactoringProvider.cs │ ├── BindingTypeNotSupported.cs │ ├── Constants.cs │ ├── DeferredBindingAttributeNotSupported.cs │ ├── DiagnosticDescriptors.cs │ ├── Extensions │ │ ├── AttributeDataExtensions.cs │ │ ├── MethodSymbolExtensions.cs │ │ ├── NamedSymbolExtensions.cs │ │ ├── ParameterSymbolExtensions.cs │ │ └── TypeSymbolExtensions.cs │ ├── IterableBindingTypeExpectedForBlobContainerPath.cs │ ├── Sdk.Analyzers.csproj │ ├── WebJobsAttributesNotSupported.cs │ └── tools │ │ ├── install.ps1 │ │ └── uninstall.ps1 ├── Sdk.Generators │ ├── Constants.cs │ ├── DiagnosticDescriptors.cs │ ├── Enums │ │ ├── CardinalityEnum.cs │ │ ├── DataTypeEnum.cs │ │ └── RetryStrategy.cs │ ├── ExtensionStartupRunnerGenerator.cs │ ├── Extensions │ │ ├── GeneratorExecutionContextExtensions.cs │ │ ├── IMethodSymbolExtensions.cs │ │ ├── ISymbolExtensions.cs │ │ └── StringExtensions.cs │ ├── FunctionExecutor │ │ ├── FunctionExecutorGenerator.Emitter.cs │ │ ├── FunctionExecutorGenerator.ExecutableFunction.cs │ │ ├── FunctionExecutorGenerator.Parser.cs │ │ └── FunctionExecutorGenerator.cs │ ├── FunctionMetadataProviderGenerator │ │ ├── Abstractions │ │ │ ├── GeneratorFunctionMetadata.cs │ │ │ └── GeneratorRetryOptions.cs │ │ ├── FunctionMetadataProviderGenerator.CardinalityParser.cs │ │ ├── FunctionMetadataProviderGenerator.DataTypeParser.cs │ │ ├── FunctionMetadataProviderGenerator.Emitter.cs │ │ ├── FunctionMetadataProviderGenerator.Parser.cs │ │ ├── FunctionMetadataProviderGenerator.cs │ │ ├── FunctionsMetadataParsingContext.cs │ │ ├── KnownFunctionMetadataTypes.cs │ │ └── ReferencedAssemblyMethodVisitor.cs │ ├── FunctionMethodSyntaxReceiver.cs │ ├── FunctionMethodVisibility.cs │ ├── FunctionsUtil.cs │ ├── KnownTypes.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── launchSettings.json │ └── Sdk.Generators.csproj ├── Sdk │ ├── Abstractions │ │ ├── SdkFunctionMetadata.cs │ │ └── SdkRetryOptions.cs │ ├── Constants.cs │ ├── DataTypeEnum.cs │ ├── ExtensionReference.cs │ ├── Extensions │ │ ├── CustomAttributeExtensions.cs │ │ ├── StringExtensions.cs │ │ └── TypeReferenceExtensions.cs │ ├── ExtensionsCsprojGenerator.cs │ ├── ExtensionsMetadata.cs │ ├── ExtensionsMetadataEnhancer.cs │ ├── FunctionMetadataGenerator.cs │ ├── FunctionMetadataJsonWriter.cs │ ├── FunctionsMetadataGenerationException.cs │ ├── IndentableLogger.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Sdk.csproj │ ├── Targets │ │ ├── Microsoft.Azure.Functions.Worker.Sdk.Publish.ZipDeploy.targets │ │ ├── Microsoft.Azure.Functions.Worker.Sdk.Publish.props │ │ ├── Microsoft.Azure.Functions.Worker.Sdk.Publish.targets │ │ ├── Microsoft.Azure.Functions.Worker.Sdk.props │ │ └── Microsoft.Azure.Functions.Worker.Sdk.targets │ ├── Tasks │ │ ├── EnhanceExtensionsMetadata.cs │ │ ├── GenerateFunctionMetadata.cs │ │ └── ZipDeploy │ │ │ ├── CreateZipFileTask.cs │ │ │ ├── DeployStatus.cs │ │ │ ├── Http │ │ │ ├── DefaultHttpClient.cs │ │ │ ├── HttpClientHelpers.cs │ │ │ ├── HttpResponseMessageForStatusCode.cs │ │ │ ├── HttpResponseMessageWrapper.cs │ │ │ ├── IHttpClient.cs │ │ │ └── IHttpResponse.cs │ │ │ ├── StringMessages.cs │ │ │ ├── ZipDeployTask.cs │ │ │ └── ZipDeploymentStatus.cs │ ├── WorkerNamingPolicy.cs │ └── worker.config.json └── release_notes.md ├── setup-e2e-tests.ps1 ├── src ├── DotNetWorker.ApplicationInsights │ ├── DotNetWorker.ApplicationInsights.csproj │ ├── FunctionsApplicationInsightsExtensions.cs │ ├── FunctionsRoleInstanceProvider.cs │ ├── FunctionsTelemetryModule.cs │ ├── Initializers │ │ ├── AppServiceEnvironmentVariableMonitor.cs │ │ ├── AppServiceOptions.cs │ │ ├── AppServiceOptionsInitializer.cs │ │ ├── FunctionsRoleEnvironmentTelmetryInitializer.cs │ │ ├── FunctionsTelemetryInitializer.cs │ │ ├── TelemetryConfigurationSetup.cs │ │ └── TokenCredentialOptions.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── README.md │ ├── TraceConstants.cs │ └── release_notes.md ├── DotNetWorker.Core │ ├── CollectionModelBindingData.cs │ ├── Context │ │ ├── BindingContext.cs │ │ ├── DefaultBindingCache.cs │ │ ├── DefaultBindingContext.cs │ │ ├── DefaultFunctionContext.cs │ │ ├── DefaultFunctionContextFactory.cs │ │ ├── DefaultTraceContext.cs │ │ ├── Features │ │ │ ├── DefaultBindingFeatureProvider.cs │ │ │ ├── DefaultFunctionInputBindingFeature.cs │ │ │ ├── DefaultInputConversionFeature.cs │ │ │ ├── DefaultInputConversionFeatureProvider.cs │ │ │ ├── DefaultInvocationFeaturesFactory.cs │ │ │ ├── FunctionInputBindingResult.cs │ │ │ ├── IDictionaryExtensions.cs │ │ │ ├── IExecutionRetryFeature.cs │ │ │ ├── IFunctionBindingsFeature.cs │ │ │ ├── IFunctionInputBindingFeature.cs │ │ │ ├── IInputConversionFeature.cs │ │ │ ├── IInputConversionFeatureProvider.cs │ │ │ ├── IInvocationFeatureProvider.cs │ │ │ ├── IInvocationFeatures.cs │ │ │ ├── IInvocationFeaturesFactory.cs │ │ │ ├── InvocationFeatures.cs │ │ │ └── InvocationFeaturesExtensions.cs │ │ ├── FunctionContext.cs │ │ ├── FunctionContextBindingFeatureExtensions.cs │ │ ├── FunctionContextFunctionBindingExtensions.cs │ │ ├── FunctionContextHttpRequestExtensions.cs │ │ ├── FunctionContextLoggerExtensions.cs │ │ ├── FunctionInvocation.cs │ │ ├── IBindingCache.cs │ │ ├── RetryContext.cs │ │ └── TraceContext.cs │ ├── Converters │ │ ├── ArrayConverter.cs │ │ ├── CancellationTokenConverter.cs │ │ ├── Converter │ │ │ ├── ConversionResult.cs │ │ │ ├── ConversionStatus.cs │ │ │ ├── ConverterContext.cs │ │ │ ├── ConverterContextExtensions.cs │ │ │ ├── ConverterFallbackBehavior.cs │ │ │ ├── ConverterFallbackBehaviorAttribute.cs │ │ │ ├── DefaultConverterContext.cs │ │ │ ├── DefaultConverterContextFactory.cs │ │ │ ├── DefaultInputConverterProvider.cs │ │ │ ├── IConverterContextFactory.cs │ │ │ ├── IInputConverter.cs │ │ │ ├── IInputConverterProvider.cs │ │ │ ├── InputConverterAttribute.cs │ │ │ ├── PropertyBagKeys.cs │ │ │ └── SupportedTargetTypeAttribute.cs │ │ ├── DateTimeConverter.cs │ │ ├── FunctionContextConverter.cs │ │ ├── GuidConverter.cs │ │ ├── JsonPocoConverter.cs │ │ ├── MemoryConverter.cs │ │ ├── StringToByteConverter.cs │ │ └── TypeConverter.cs │ ├── Definition │ │ ├── BindingDirection.cs │ │ ├── BindingMetadata.cs │ │ ├── FunctionDefinition.cs │ │ └── FunctionParameter.cs │ ├── Diagnostics │ │ ├── ActivityExtensions.cs │ │ ├── Exceptions │ │ │ ├── FunctionInputConverterException.cs │ │ │ └── FunctionWorkerException.cs │ │ ├── FunctionActivitySourceFactory.cs │ │ ├── FunctionInvocationScope.cs │ │ ├── IWorkerDiagnostics.cs │ │ ├── OpenTelemetrySchemaVersion.cs │ │ ├── TraceConstants.cs │ │ └── WorkerMessage.cs │ ├── DotNetWorker.Core.csproj │ ├── ExceptionExtensions.cs │ ├── ExtensionStartup │ │ ├── WorkerExtensionStartup.cs │ │ ├── WorkerExtensionStartupAttribute.cs │ │ └── WorkerExtensionStartupCodeExecutorInfoAttribute.cs │ ├── FunctionMetadata │ │ ├── DefaultFunctionMetadata.cs │ │ ├── DefaultRetryOptions.cs │ │ ├── IFunctionMetadata.cs │ │ ├── IFunctionMetadataProvider.cs │ │ ├── IRetryOptions.cs │ │ └── RetryStrategy.cs │ ├── FunctionsApplication.Log.cs │ ├── FunctionsApplication.cs │ ├── FunctionsDebugger.cs │ ├── Helpers │ │ └── ThrowHelpers │ │ │ └── ObjectDisposedThrowHelper.cs │ ├── Hosting │ │ ├── CoreWorkerHostBuilderExtensions.cs │ │ ├── DefaultInputConverterInitializer.cs │ │ ├── FunctionsWorkerApplicationBuilder.cs │ │ ├── IAutoConfigureStartup.cs │ │ ├── IFunctionsWorkerApplicationBuilder.cs │ │ ├── InputConverterCollection.cs │ │ ├── ServiceCollectionExtensions.cs │ │ ├── WorkerCapabilities.cs │ │ ├── WorkerMiddlewareWorkerApplicationBuilderExtensions.cs │ │ └── WorkerOptions.cs │ ├── Http │ │ ├── DefaultHttpRequestDataFeature.cs │ │ ├── HttpCookie.cs │ │ ├── HttpCookies.cs │ │ ├── HttpHeadersCollection.cs │ │ ├── HttpRequestData.cs │ │ ├── HttpRequestDataExtensions.cs │ │ ├── HttpResponseData.cs │ │ ├── HttpResponseDataExtensions.cs │ │ ├── IHttpCookie.cs │ │ ├── IHttpRequestDataFeature.cs │ │ └── SameSite.cs │ ├── IFunctionsApplication.cs │ ├── IWorker.cs │ ├── InitializationResponse.cs │ ├── Invocation │ │ ├── DefaultFunctionActivator.cs │ │ ├── DefaultFunctionExecutor.Log.cs │ │ ├── DefaultFunctionExecutor.cs │ │ ├── DefaultFunctionInvoker.cs │ │ ├── DefaultFunctionInvokerFactory.cs │ │ ├── DefaultInvocationResult.cs │ │ ├── DefaultMethodInfoLocator.cs │ │ ├── DefaultMethodInvokerFactory.cs │ │ ├── FunctionActivatorExtensions.cs │ │ ├── IFunctionActivator.cs │ │ ├── IFunctionExecutor.cs │ │ ├── IFunctionInvoker.cs │ │ ├── IFunctionInvokerFactory.cs │ │ ├── IMethodInvoker.cs │ │ ├── IMethodInvokerFactory.cs │ │ ├── IMethodLocator.cs │ │ ├── InvocationResult.cs │ │ ├── MethodInvokerWithReturnValue.cs │ │ ├── TaskMethodInvoker.cs │ │ ├── VoidMethodInvoker.cs │ │ └── VoidTaskMethodInvoker.cs │ ├── Logging │ │ ├── FunctionsLoggerExtensions.cs │ │ ├── ISystemLogWriter.cs │ │ ├── IUserLogWriter.cs │ │ ├── IUserMetricWriter.cs │ │ ├── LogConstants.cs │ │ ├── NullLogWriter.cs │ │ ├── WorkerLogger.cs │ │ └── WorkerLoggerProvider.cs │ ├── ModelBindingData.cs │ ├── NullFunctionActivator.cs │ ├── OutputBindings │ │ ├── DefaultInputBindingData.cs │ │ ├── DefaultOutputBindingData.cs │ │ ├── DefaultOutputBindingsInfoProvider.cs │ │ ├── EmptyOutputBindingsInfo.cs │ │ ├── IOutputBindingsInfoProvider.cs │ │ ├── InputBindingData.cs │ │ ├── MethodReturnOutputBindingsInfo.cs │ │ ├── OutputBindingData.cs │ │ ├── OutputBindingsConstants.cs │ │ ├── OutputBindingsInfo.cs │ │ ├── OutputBindingsMiddleware.cs │ │ └── PropertyOutputBindingsInfo.cs │ ├── Pipeline │ │ ├── DefaultInvocationPipelineBuilder.cs │ │ ├── FunctionExecutionDelegate.cs │ │ ├── FunctionExecutionMiddleware.cs │ │ ├── IFunctionContextFactory.cs │ │ ├── IFunctionsWorkerMiddleware.cs │ │ └── IInvocationPipelineBuilder.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── launchSettings.json │ ├── StartupHook.cs │ ├── WorkerHostedService.cs │ └── WorkerInformation.cs ├── DotNetWorker.Grpc │ ├── ChannelReaderExtensions.cs │ ├── Definition │ │ ├── GrpcBindingMetadata.cs │ │ └── GrpcFunctionDefinition.cs │ ├── DotNetWorker.Grpc.csproj │ ├── Features │ │ └── GrpcFunctionBindingsFeature.cs │ ├── FunctionMetadata │ │ ├── DefaultFunctionMetadataProvider.cs │ │ ├── FunctionMetadataRpcExtensions.cs │ │ ├── RpcFunctionMetadata.cs │ │ └── RpcRetryOptions.cs │ ├── GrpcCollectionModelBindingData.cs │ ├── GrpcFunctionInvocation.cs │ ├── GrpcFunctionsHostLogWriter.cs │ ├── GrpcHostChannel.cs │ ├── GrpcModelBindingData.cs │ ├── GrpcRetryContext.cs │ ├── GrpcServiceCollectionExtensions.cs │ ├── GrpcStartupOptions.cs │ ├── GrpcWorker.cs │ ├── GrpcWorkerClientFactory.cs │ ├── Handlers │ │ ├── IInvocationHandler.cs │ │ └── InvocationHandler.cs │ ├── Hosting │ │ └── GrpcWorkerApplicationBuilderExtensions.cs │ ├── Http │ │ ├── GrpcHttpCookies.cs │ │ ├── GrpcHttpRequestData.cs │ │ ├── GrpcHttpResponseData.cs │ │ ├── GrpcWorkerDiagnostics.cs │ │ └── RpcHttpCookie.cs │ ├── IGrpcRequestHandler.cs │ ├── IWorkerClient.cs │ ├── IWorkerClientFactory.cs │ ├── NativeHostIntegration │ │ ├── NativeMethods.cs │ │ ├── NativeSafeHandle.cs │ │ ├── NativeWorkerClient.cs │ │ ├── NativeWorkerClientFactory.cs │ │ └── Shim │ │ │ └── NativeLibrary.Linux.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── RpcExtensions.cs │ └── StatusResult.cs ├── DotNetWorker.OpenTelemetry │ ├── ConfigureFunctionsOpenTelemetry.cs │ ├── DotNetWorker.OpenTelemetry.csproj │ ├── FunctionsResourceDetector.cs │ ├── OpenTelemetryConstants.cs │ ├── README.md │ ├── ResourceSemanticConventions.cs │ └── release_notes.md └── DotNetWorker │ ├── Builder │ ├── BootstrapHostBuilder.cs │ ├── FunctionsApplication.cs │ └── FunctionsApplicationBuilder.cs │ ├── DotNetWorker.csproj │ ├── Hosting │ ├── FunctionsWorkerHost.cs │ ├── ServiceCollectionExtensions.cs │ └── WorkerHostBuilderExtensions.cs │ └── Properties │ ├── AssemblyInfo.cs │ └── launchSettings.json ├── test ├── DependentAssemblyWithFunctions.NetStandard │ ├── DependentAssemblyWithFunctions.NetStandard.csproj │ └── NetStandardClassLibraryClass1.cs ├── DependentAssemblyWithFunctions │ ├── DependencyFunction.cs │ ├── DependentAssemblyWithFunctions.csproj │ ├── InternalFunction.cs │ ├── NestedNamespaceFunction.cs │ ├── NestedTypesFunction.cs │ └── StaticFunction.cs ├── DotNetWorker.OpenTelemetry.Tests │ ├── DotNetWorker.OpenTelemetry.Tests.csproj │ └── EndToEndTests.cs ├── DotNetWorkerTests │ ├── ApplicationInsights │ │ ├── ApplicationInsightsConfigurationTests.cs │ │ ├── EndToEndTests.cs │ │ ├── FunctionsTelemetryInitializerTests.cs │ │ ├── TestTelemetryChannel.cs │ │ └── TokenCredentialOptionsTests.cs │ ├── BindingNameAttributeTest.cs │ ├── Book.cs │ ├── Builder │ │ └── FunctionsApplicationBuilderTests.cs │ ├── Converters │ │ ├── ArrayConverterTests.cs │ │ ├── CancellationTokenConverterTests.cs │ │ ├── ConversionResultTests.cs │ │ ├── DateTimeConverterTests.cs │ │ ├── GuidConverterTests.cs │ │ ├── JsonPocoConverterTests.cs │ │ ├── MemoryConverterTests.cs │ │ └── TestConverterContext.cs │ ├── DefaultFunctionContextTests.cs │ ├── DefaultFunctionInvokerTests.cs │ ├── DefaultInvocationPipelineBuilderTests.cs │ ├── DefaultModelBindingFeatureTests.cs │ ├── Diagnostics │ │ ├── GrpcHostLoggerTests.cs │ │ └── WorkerLoggerTests.cs │ ├── DotNetWorkerTests.csproj │ ├── ExceptionExtensionTests.cs │ ├── Executors │ │ ├── DefaultFunctionInvokerFactoryTests.cs │ │ ├── DefaultMethodInvokerFactoryTests.cs │ │ ├── NullInstanceFactoryTests.cs │ │ ├── TaskMethodInvokerTests.cs │ │ └── VoidMethodInvokerTests.cs │ ├── Features │ │ ├── DefaultInputConversionFeatureTests.cs │ │ └── InvocationFeaturesTests.cs │ ├── FunctionContextExtensionTests.cs │ ├── FunctionContextHttpExtensionTests.cs │ ├── FunctionMetadata │ │ └── DefaultFunctionMetadataTests.cs │ ├── FunctionsApplicationTests.cs │ ├── FunctionsWorkerApplicationBuilderTests.cs │ ├── GrpcFunctionBindingsFeatureTests.cs │ ├── GrpcFunctionDefinitionTests.cs │ ├── GrpcHttpRequestDataTests.cs │ ├── GrpcServiceCollectionExtensionsTests.cs │ ├── GrpcWorkerTests.cs │ ├── Handlers │ │ └── InvocationHandlerTests.cs │ ├── Helpers │ │ ├── LogMessage.cs │ │ ├── TestLogger.cs │ │ ├── TestLoggerProvider.cs │ │ └── TestLoggerT.cs │ ├── Http │ │ ├── HttpHeadersCollectionTests.cs │ │ ├── HttpRequestDataExtensionsTests.cs │ │ └── HttpResponseDataExtensionsTests.cs │ ├── OutputBindings │ │ └── OutputBindingsMiddlewareTests.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ServiceCollectionExtensionsTestUtility.cs │ ├── ServiceCollectionExtensionsTests.cs │ ├── StartupHookTests.cs │ ├── TaskExtensions.cs │ ├── TestUtility.cs │ ├── WorkerHostBuilderExtensionsTests.cs │ └── WorkerServiceCollectionExtensionsTests.cs ├── E2ETests │ ├── E2EApps │ │ ├── E2EApp │ │ │ ├── Blob │ │ │ │ ├── BlobInputBindingFunctions.cs │ │ │ │ ├── BlobTriggerBindingFunctions.cs │ │ │ │ └── Book.cs │ │ │ ├── Cosmos │ │ │ │ └── CosmosFunction.cs │ │ │ ├── E2EApp.csproj │ │ │ ├── EventHubs │ │ │ │ ├── EventHubsEnumerableFunctions.cs │ │ │ │ ├── EventHubsObjectFunctions.cs │ │ │ │ ├── EventHubsStringFunctions.cs │ │ │ │ └── TestData.cs │ │ │ ├── Http │ │ │ │ ├── BasicHttpFunctions.cs │ │ │ │ └── FailingHttpFunctions.cs │ │ │ ├── NuGet.Config │ │ │ ├── Program.cs │ │ │ ├── Queue │ │ │ │ └── QueueTestFunctions.cs │ │ │ ├── Table │ │ │ │ └── TableInputBindingFunctions.cs │ │ │ ├── Timer │ │ │ │ └── TimerTestFunctions.cs │ │ │ ├── host.json │ │ │ ├── local.settings.json │ │ │ └── proxies.json │ │ └── E2EAspNetCoreApp │ │ │ ├── CancellationHttpFunctions.cs │ │ │ ├── E2EAspNetCoreApp.csproj │ │ │ ├── NuGet.Config │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ └── launchSettings.json │ │ │ ├── host.json │ │ │ └── local.settings.json │ ├── E2ETests.slnf │ ├── E2ETests │ │ ├── AspNetCore │ │ │ └── CancellationEndToEndTests.cs │ │ ├── Constants.cs │ │ ├── Cosmos │ │ │ └── CosmosDBEndToEndTests.cs │ │ ├── E2ETests.csproj │ │ ├── Fixtures │ │ │ ├── FixtureHelpers.cs │ │ │ └── FunctionAppFixture.cs │ │ ├── Helpers │ │ │ ├── CosmosDBHelpers.cs │ │ │ ├── FactAttributes │ │ │ │ └── IgnoreOnNetFxTestRunTheory.cs │ │ │ ├── HttpHelpers.cs │ │ │ ├── StorageHelpers.cs │ │ │ ├── TableHelpers.cs │ │ │ └── TestLoggerProvider.cs │ │ ├── HttpEndToEndTests.cs │ │ ├── JobObjectRegistry.cs │ │ ├── Storage │ │ │ ├── BlobEndToEndTests.cs │ │ │ └── QueueEndToEndTests.cs │ │ ├── Tables │ │ │ └── TablesEndToEndTests.cs │ │ ├── TimerEndToEndTests.cs │ │ └── xunit.runner.json │ └── NuGet.Config ├── Resources │ └── Projects │ │ ├── FunctionApp01 │ │ ├── FunctionApp01.csproj │ │ ├── HttpFunction.cs │ │ └── Program.cs │ │ ├── FunctionExt01 │ │ └── FunctionExt01.csproj │ │ └── FunctionLib01 │ │ ├── FunctionLib01.csproj │ │ └── HttpFunction.cs ├── Sdk.Analyzers.Tests │ ├── AsyncVoidAnalyzerTests.cs │ ├── BindingTypeCodeRefactoringProviderTests.cs │ ├── BindingTypeNotSupportedTests.cs │ ├── DeferredBindingAttributeNotSupportedTests.cs │ ├── IterableBindingTypeExpectedForBlobContainerPathTests.cs │ ├── Sdk.Analyzers.Tests.csproj │ └── WebJobsAttributesNotSupportedTests.cs ├── Sdk.E2ETests │ ├── Contents │ │ └── functions.metadata │ ├── InnerBuildTests.cs │ ├── ProcessWrapper.cs │ ├── PublishTests.cs │ ├── Sdk.E2ETests.csproj │ ├── Sdk.E2ETests_default.runsettings │ ├── Sdk.E2ETests_dockertests.runsettings │ ├── TestUtility.cs │ ├── ZipDeployTests.cs │ └── xunit.runner.json ├── Sdk.Generator.Tests │ ├── ExtensionStartupRunner │ │ ├── ExtensionStartupRunnerGeneratorTests.cs │ │ └── NotGeneratedTests.cs │ ├── FunctionExecutor │ │ ├── DependentAssemblyTest.cs │ │ ├── FunctionExecutorGeneratorTests.cs │ │ └── NotGeneratedTests.cs │ ├── FunctionMetadata │ │ ├── CustomAttributeExtensionsTests.cs │ │ ├── ExtensionsCsProjGeneratorTests.cs │ │ ├── ExtensionsMetadataEnhancerTests.cs │ │ ├── FunctionMetadataGeneratorTests.cs │ │ ├── StringExtensionsTests.cs │ │ ├── TypeHelpers.cs │ │ ├── ZipDeployTaskTests.cs │ │ └── ZipDeploymentStatusTests.cs │ ├── FunctionMetadataProvider │ │ ├── AmbiguousNamespaceTests.cs │ │ ├── AutoConfigureStartupTypeTests.cs │ │ ├── DependentAssemblyTest.NetFx.cs │ │ ├── DependentAssemblyTest.cs │ │ ├── DiagnosticResultTests.cs │ │ ├── EventHubsBindingsTests.cs │ │ ├── ExtensionsTests.cs │ │ ├── HttpTriggerTests.cs │ │ ├── IntegratedTriggersAndBindingsTests.cs │ │ ├── KafkaTests.cs │ │ ├── NestedTypesTest.cs │ │ ├── NotGeneratedTests.cs │ │ ├── RetryOptionsTests.cs │ │ ├── ServiceBustTests.cs │ │ ├── SignalRTest.cs │ │ └── StorageBindingTests.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Resources │ │ └── TestPublishContents.zip │ ├── Sdk.Generator.Tests.csproj │ ├── SymbolExtensionsTest.cs │ └── TestHelpers.cs ├── TestUtility │ ├── ExternalPoco.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── TestBindingMetadata.cs │ ├── TestFunctionBindingsFeature.cs │ ├── TestFunctionContext.cs │ ├── TestFunctionDefinition.cs │ ├── TestFunctionInvocation.cs │ ├── TestScopedEnvironmentVariable.cs │ ├── TestUtility.cs │ └── TestUtility.csproj ├── Worker.ApplicationInsights.Tests │ ├── ApplicationInsightsConfigurationTests.cs │ ├── EndToEndTests.cs │ ├── FunctionsTelemetryInitializerTests.cs │ ├── TestAppBuilder.cs │ ├── TestTelemetryChannel.cs │ └── Worker.ApplicationInsights.Tests.csproj ├── Worker.Extensions.Rpc.Tests │ ├── GrpcHttpClientBuilderExtensionsTests.cs │ ├── RpcServiceCollectionExtensionsTests.cs │ └── Worker.Extensions.Rpc.Tests.csproj ├── Worker.Extensions.Sample-IncorrectImplementation │ ├── SampleIncorrectExtensionStartup.cs │ └── Worker.Extensions.Sample-IncorrectImplementation.csproj ├── Worker.Extensions.Sample │ ├── SampleExtensionStartup.cs │ └── Worker.Extensions.Sample.csproj ├── Worker.Extensions.Shared.Tests │ ├── Reflection │ │ ├── ParameterBinderTests.cs │ │ └── TypeExtensionsTests.cs │ └── Worker.Extensions.Shared.Tests.csproj ├── Worker.Extensions.SignalRService.Tests │ ├── MockServerlessHubTests.cs │ ├── ServerlessHubDependencyInjectionTests.cs │ ├── Usings.cs │ └── Worker.Extensions.SignalRService.Tests.csproj ├── Worker.Extensions.Tests │ ├── AspNetCore │ │ ├── FunctionsEndpointDataSourceTests.cs │ │ ├── FunctionsHttpProxyingMiddlewareTests.cs │ │ └── WorkerRequestServicesMiddlewareTests.cs │ ├── Blob │ │ ├── BlobClientTests.cs │ │ ├── BlobContainerClientTests.cs │ │ ├── BlobStorageConverterCoreTests.cs │ │ ├── BlobTestHelper.cs │ │ ├── ByteArrayTests.cs │ │ ├── POCOTests.cs │ │ ├── StreamTests.cs │ │ └── StringTests.cs │ ├── Cosmos │ │ ├── CosmosDBConverterTests.cs │ │ ├── UtilitiesTests.cs │ │ └── WorkerCosmosSerializerTests.cs │ ├── EventGrid │ │ ├── EventGridBinaryDataConverterTests.cs │ │ ├── EventGridCloudEventConverterTests.cs │ │ ├── EventGridEventConverterTests.cs │ │ ├── EventGridStringArrayConverterTests.cs │ │ └── EventGridTestHelper.cs │ ├── EventHubs │ │ └── EventDataConverterTests.cs │ ├── GrpcTestHelper.cs │ ├── Queue │ │ ├── QueueMessageBinaryDataConverterTests.cs │ │ ├── QueueMessageConverterTests.cs │ │ ├── QueueMessageJsonConverterTests.cs │ │ └── QueuesTestHelper.cs │ ├── ServiceBus │ │ ├── ServiceBusMessageActionsTests.cs │ │ ├── ServiceBusReceivedMessageConverterTests.cs │ │ ├── ServiceBusSessionMessageActionsTests.cs │ │ └── ServiceBusSessionMessageConverterTests.cs │ ├── Table │ │ ├── TableClientConverterTests.cs │ │ ├── TableEntityConverterTests.cs │ │ ├── TableEntityEnumerableConverterTests.cs │ │ ├── TablePocoConverterTests.cs │ │ ├── TableTestHelper.cs │ │ └── TablesBindingOptionsSetupTest.cs │ ├── TestConverterContext.cs │ └── Worker.Extensions.Tests.csproj └── extensions │ ├── Worker.Extensions.Http.AspNetCore.Tests │ ├── AspNetCoreHttpRequestDataTests.cs │ ├── CookiesCollection.cs │ ├── FunctionsHostBuilderExtensionsTests.cs │ ├── GlobalUsings.cs │ ├── HttpResultAttributeExpectedTests.cs │ ├── RegistrationExpectedInAspNetIntegrationTests.cs │ └── Worker.Extensions.Http.AspNetCore.Tests.csproj │ └── Worker.Extensions.Timer.Tests │ ├── TimerInfoConverterTests.cs │ └── Worker.Extensions.Timer.Tests.csproj └── tools ├── devpack.ps1 └── start-emulators.ps1 /.github/ISSUE_TEMPLATE/01-bug-report.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: Create a report to help us improve 3 | labels: ["potential-bug"] 4 | body: 5 | - id: description 6 | type: textarea 7 | attributes: 8 | label: Description 9 | placeholder: Please provide a succinct description of the issue. 10 | validations: 11 | required: true 12 | - id: repro 13 | type: textarea 14 | attributes: 15 | label: Steps to reproduce 16 | placeholder: Please provide the steps required to reproduce the problem. 17 | validations: 18 | required: true 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/02-feature-request.yml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | description: Make a feature request 3 | labels: ["enhancement"] 4 | body: 5 | - id: description 6 | type: textarea 7 | attributes: 8 | label: Description 9 | placeholder: Please provide a succinct description of the feature you would like to see. 10 | validations: 11 | required: true -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true -------------------------------------------------------------------------------- /.github/policies/issue.close-duplicate-issues.yml: -------------------------------------------------------------------------------- 1 | name: Close duplicate issues 2 | description: Close duplicate issues 3 | resource: repository 4 | configuration: 5 | resourceManagementConfiguration: 6 | scheduledSearches: 7 | - description: Close duplicate issues 8 | frequencies: 9 | - hourly: 10 | hour: 3 11 | filters: 12 | - isIssue 13 | - isOpen 14 | - hasLabel: 15 | label: duplicate 16 | - noActivitySince: 17 | days: 3 18 | actions: 19 | - addReply: 20 | reply: This issue has been marked as duplicate and has not had any activity for **3 days**. It will be closed for housekeeping purposes. 21 | - closeIssue 22 | onFailure: 23 | onSuccess: -------------------------------------------------------------------------------- /.github/policies/issue.close-stale-issues.yml: -------------------------------------------------------------------------------- 1 | name: Close stale issues 2 | description: Action to handle stale issues 3 | resource: repository 4 | configuration: 5 | resourceManagementConfiguration: 6 | scheduledSearches: 7 | - description: Close stale issues 8 | frequencies: 9 | - hourly: 10 | hour: 3 11 | filters: 12 | - isIssue 13 | - isOpen 14 | - hasLabel: 15 | label: 'Needs: Author Feedback' 16 | - hasLabel: 17 | label: no-recent-activity 18 | - noActivitySince: 19 | days: 3 20 | - isNotLabeledWith: 21 | label: 'bot: do not close' 22 | actions: 23 | - closeIssue 24 | onFailure: 25 | onSuccess: -------------------------------------------------------------------------------- /.github/policies/issue.remove-needs-author-feedback.yml: -------------------------------------------------------------------------------- 1 | name: Remove needs author feedback label. 2 | description: Remove needs author feedback label and adds needs attention 3 | resource: repository 4 | configuration: 5 | resourceManagementConfiguration: 6 | eventResponderTasks: 7 | - description: Remove needs author feedback label. Add needs attention 8 | if: 9 | - payloadType: Issue_Comment 10 | - isAction: 11 | action: Created 12 | - isActivitySender: 13 | issueAuthor: True 14 | - hasLabel: 15 | label: 'Needs: Author Feedback' 16 | then: 17 | - if: 18 | - isOpen 19 | then: 20 | - addLabel: 21 | label: 'Needs: Attention :wave:' 22 | - removeLabel: 23 | label: 'Needs: Author Feedback' 24 | onFailure: 25 | onSuccess: 26 | -------------------------------------------------------------------------------- /.github/policies/issue.remove-no-recent-activity-with-comment.yml: -------------------------------------------------------------------------------- 1 | name: Remove no recent activity label 2 | description: Remove no recent activity label when issue is commented on 3 | resource: repository 4 | configuration: 5 | resourceManagementConfiguration: 6 | eventResponderTasks: 7 | - description: Remove no recent activity label when issue is commented on 8 | if: 9 | - payloadType: Issue_Comment 10 | - isAction: 11 | action: Created 12 | - hasLabel: 13 | label: no-recent-activity 14 | then: 15 | - removeLabel: 16 | label: no-recent-activity 17 | onFailure: 18 | onSuccess: -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### Issue describing the changes in this PR 4 | 5 | resolves #issue_for_this_pr 6 | 7 | ### Pull request checklist 8 | 9 | * [ ] My changes **do not** require documentation changes 10 | * [ ] Otherwise: Documentation issue linked to PR 11 | * [ ] My changes **should not** be added to the release notes for the next release 12 | * [ ] Otherwise: I've added my notes to `release_notes.md` 13 | * [ ] My changes **do not** need to be backported to a previous version 14 | * [ ] Otherwise: Backport tracked by issue/PR #issue_or_pr 15 | * [ ] I have added all required tests (Unit tests, E2E tests) 16 | 17 | 18 | ### Additional information 19 | 20 | Additional PR information 21 | -------------------------------------------------------------------------------- /.github/workflows/dependency-review.yml: -------------------------------------------------------------------------------- 1 | name: Dependency Review 2 | on: [pull_request] 3 | 4 | permissions: 5 | contents: read 6 | pull-requests: write 7 | 8 | jobs: 9 | dependency-review: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout Repository 13 | uses: actions/checkout@v4 14 | - name: Dependency Review 15 | uses: actions/dependency-review-action@v4 16 | with: 17 | comment-summary-in-pr: on-failure 18 | -------------------------------------------------------------------------------- /.reporoot: -------------------------------------------------------------------------------- 1 | File to mark repo root. Do not edit. -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Attach to .NET Functions", 6 | "type": "coreclr", 7 | "request": "attach", 8 | "processId": "${command:azureFunctions.pickProcess}" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /CHECKENFORCER: -------------------------------------------------------------------------------- 1 | format: v0.1-alpha 2 | minimumCheckRuns: 1 3 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /build/AspNetCore.slnf: -------------------------------------------------------------------------------- 1 | { 2 | "solution": { 3 | "path": "..\\DotNetWorker.sln", 4 | "projects": [ 5 | "extensions\\Worker.Extensions.Http.AspNetCore\\src\\Worker.Extensions.Http.AspNetCore.csproj", 6 | "extensions\\Worker.Extensions.Http.AspNetCore.Analyzers\\Worker.Extensions.Http.AspNetCore.Analyzers.csproj" 7 | ] 8 | } 9 | } -------------------------------------------------------------------------------- /build/DotNetWorker.Core.slnf: -------------------------------------------------------------------------------- 1 | { 2 | "solution": { 3 | "path": "..\\DotNetWorker.sln", 4 | "projects": [ 5 | "sdk\\Sdk.Analyzers\\Sdk.Analyzers.csproj", 6 | "sdk\\Sdk.Generators\\Sdk.Generators.csproj", 7 | "sdk\\Sdk\\Sdk.csproj", 8 | "src\\DotNetWorker.ApplicationInsights\\DotNetWorker.ApplicationInsights.csproj", 9 | "src\\DotNetWorker.Core\\DotNetWorker.Core.csproj", 10 | "src\\DotNetWorker.Grpc\\DotNetWorker.Grpc.csproj", 11 | "src\\DotNetWorker\\DotNetWorker.csproj", 12 | "src\\DotNetWorker.OpenTelemetry\\DotNetWorker.OpenTelemetry.csproj" 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /build/Extensions.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | true 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /build/Icon.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | icon.png 5 | https://aka.ms/azure-functions-package-icon 6 | 7 | 8 | 9 | 10 | false 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /build/PackageInfo.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Microsoft 6 | Microsoft 7 | © Microsoft Corporation. All rights reserved. 8 | https://github.com/Azure/azure-functions-dotnet-worker 9 | git 10 | True 11 | https://github.com/Azure/azure-functions-dotnet-worker 12 | MIT 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /build/Sdk.slnf: -------------------------------------------------------------------------------- 1 | { 2 | "solution": { 3 | "path": "..\\DotNetWorker.sln", 4 | "projects": [ 5 | "sdk\\Sdk.Analyzers\\Sdk.Analyzers.csproj", 6 | "sdk\\Sdk.Generators\\Sdk.Generators.csproj", 7 | "sdk\\Sdk\\Sdk.csproj" 8 | ] 9 | } 10 | } -------------------------------------------------------------------------------- /build/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-functions-dotnet-worker/9ed7ece0564d9db3a30b87d5eea8324a6e7c3d10/build/icon.png -------------------------------------------------------------------------------- /build/install-dotnet.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | # Some tests rely on 6.0.412 existing 3 | - task: UseDotNet@2 4 | displayName: 'Install .NET6 SDK' 5 | inputs: 6 | packageType: 'sdk' 7 | version: "6.x" 8 | 9 | - task: UseDotNet@2 10 | displayName: 'Install .NET7 SDK' 11 | inputs: 12 | packageType: 'sdk' 13 | version: "7.x" 14 | 15 | # The SDK we use to build 16 | - task: UseDotNet@2 17 | displayName: 'Install current .NET SDK' 18 | inputs: 19 | packageType: 'sdk' 20 | useGlobalJson: true 21 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | title: Azure Functions .NET Worker 2 | description: GitHub Documentation 3 | theme: jekyll-theme-tactile 4 | -------------------------------------------------------------------------------- /docs/analyzer-rules/AZFW0006.md: -------------------------------------------------------------------------------- 1 | # AZFW0006: Symbol Not Found 2 | 3 | | | Value | 4 | |-|-| 5 | | **Rule ID** |AZFW0006| 6 | | **Category** |[AzureFunctionsSyntax]| 7 | | **Severity** |Warning| 8 | 9 | ## Cause 10 | 11 | This rule is triggered when a Symbol necessary for Azure Function metadata generation cannot be found in the user compilation. 12 | 13 | ## Rule description 14 | 15 | Symbols are searched for and loaded from the user compilation to gather function metadata information. If the are not found, then the user's function will not run. 16 | 17 | ## How to fix violations 18 | 19 | Make sure you have added all necessary imports to your compilation. 20 | 21 | ## When to suppress warnings 22 | 23 | This rule should not be suppressed because this error will prevent your functions from running. 24 | -------------------------------------------------------------------------------- /docs/analyzer-rules/AZFW0007.md: -------------------------------------------------------------------------------- 1 | # AZFW0007: Multiple HTTP response binding types for Azure Function 2 | 3 | | | Value | 4 | |-|-| 5 | | **Rule ID** |AZFW0007| 6 | | **Category** |[AzureFunctionsSyntax]| 7 | | **Severity** |Error| 8 | 9 | ## Cause 10 | 11 | This rule is triggered when there are multiple HTTP response binding types associated with an Azure Function. 12 | 13 | ## Rule description 14 | 15 | Each Azure Function can have only one HTTP response binding type. 16 | 17 | ## How to fix violations 18 | 19 | Make sure you have only one HTTP response binding type associated with a function. If you have a custom return type, please check all of the properties to verify that there is only one HTTP response binding type. 20 | 21 | ## When to suppress warnings 22 | 23 | This rule should not be suppressed because this error will prevent your functions from running. 24 | -------------------------------------------------------------------------------- /docs/analyzer-rules/AZFW0013.md: -------------------------------------------------------------------------------- 1 | # AZFW0013: Unable to parse binding argument 2 | 3 | | | Value | 4 | |-|-| 5 | | **Rule ID** |AZFW0013| 6 | | **Category** |[AzureFunctionsSyntax]| 7 | | **Severity** |Error| 8 | 9 | ## Cause 10 | 11 | This rule is triggered when a binding attribute argument is an invalid or null value. 12 | 13 | ## Rule description 14 | 15 | [Attributes](https://learn.microsoft.com/en-us/dotnet/csharp/advanced-topics/reflection-and-attributes/) are used to define bindings, and the function metadata generator parses the arguments passed into these attributes to generate binding information during start up. 16 | 17 | If the arguments passed in are invalid for any reason (such as being null), this rule is enforced. 18 | 19 | ## How to fix violations 20 | 21 | Review the binding attribute. 22 | 23 | ## When to suppress warnings 24 | 25 | This rule should not be suppressed because this error will prevent your functions from running. 26 | -------------------------------------------------------------------------------- /docs/analyzer-rules/RULE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # AZFW0000: Rule title 2 | 3 | | | Value | 4 | |-|-| 5 | | **Rule ID** |AZFW0000| 6 | | **Category** |[Usage|Bindings|]| 7 | | **Severity** |Hidden/Info/Warning/Error| 8 | 9 | 10 | ## Cause 11 | 12 | Cause 13 | 14 | ## Rule description 15 | 16 | Description 17 | 18 | ## How to fix violations 19 | 20 | To fix violations, (describe fix) 21 | 22 | ## When to suppress warnings 23 | 24 | Add information on when to suppress warnings 25 | 26 | ## Configure code to analyze 27 | 28 | Use the following option to configure which parts of your codebase to run this rule on. 29 | -------------------------------------------------------------------------------- /docs/analyzer-rules/index.md: -------------------------------------------------------------------------------- 1 | Azure Functions .NET Worker Analyzer Rules 2 | -------------------------------------------------------------------------------- /eng/build/extensionValidationProjectTemplate.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | net8.0 4 | Library 5 | false 6 | false 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /eng/ci/code-mirror.yml: -------------------------------------------------------------------------------- 1 | trigger: 2 | branches: 3 | include: 4 | # Keep this set limited as appropriate (don't mirror individual user branches). 5 | - main 6 | - release/* 7 | 8 | resources: 9 | repositories: 10 | - repository: eng 11 | type: git 12 | name: engineering 13 | ref: refs/tags/release 14 | 15 | variables: 16 | - template: ci/variables/cfs.yml@eng 17 | 18 | extends: 19 | template: ci/code-mirror.yml@eng 20 | -------------------------------------------------------------------------------- /eng/ci/templates/jobs/build-net-host.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | 3 | - job: BuildFunctionsNetHostW 4 | displayName: '[Windows] Build FunctionsNetHost' 5 | 6 | steps: 7 | - task: UseDotNet@2 8 | displayName: Install .NET SDK from global.json 9 | inputs: 10 | useGlobalJson: true 11 | 12 | - task: DotnetCoreCLI@2 13 | displayName: Dotnet build 14 | inputs: 15 | command: build 16 | workingDirectory: $(Build.SourcesDirectory)/host/src/FunctionsNetHost 17 | -------------------------------------------------------------------------------- /eng/ci/templates/jobs/run-extension-tests.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: ExtensionProjectName 3 | type: string 4 | - name: HasOwnTestProject 5 | type: boolean 6 | default: false 7 | 8 | jobs: 9 | 10 | - job: RunTests 11 | displayName: 'Run tests' 12 | 13 | steps: 14 | 15 | - template: /eng/ci/templates/steps/install-dotnet.yml@self 16 | 17 | - ${{ if eq(parameters.HasOwnTestProject, true) }}: 18 | - task: DotNetCoreCLI@2 19 | displayName: 'Run tests' 20 | inputs: 21 | command: test 22 | arguments: -v n 23 | projects: | 24 | **/${{ parameters.ExtensionProjectName }}.Tests.csproj 25 | 26 | - ${{ if eq(parameters.HasOwnTestProject, false) }}: 27 | - task: DotNetCoreCLI@2 28 | displayName: 'Run tests' 29 | inputs: 30 | command: test 31 | arguments: -v n 32 | projects: | 33 | **/Worker.Extensions.Tests.csproj 34 | -------------------------------------------------------------------------------- /eng/ci/templates/steps/install-dotnet.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | 3 | - task: UseDotNet@2 # Needed by our projects and CI steps 4 | displayName: Install .NET 6 5 | inputs: 6 | packageType: sdk 7 | version: 6.x 8 | 9 | - task: UseDotNet@2 # Needed by our projects and CI steps 10 | displayName: Install .NET 7 11 | inputs: 12 | packageType: sdk 13 | version: 7.x 14 | 15 | - task: UseDotNet@2 # The pinned SDK we use to build 16 | displayName: Install .NET SDK from global.json 17 | inputs: 18 | packageType: sdk 19 | useGlobalJson: true 20 | -------------------------------------------------------------------------------- /eng/ci/templates/variables/build.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | DOTNET_NOLOGO: 1 3 | DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 4 | DOTNET_CLI_TELEMETRY_OPTOUT: 1 5 | -------------------------------------------------------------------------------- /extensions/Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Abstractions/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.abstractions.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Abstractions/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Extensions.Abstractions 8 | 9 | - 10 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Abstractions/src/BindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Extensions.Abstractions 7 | { 8 | [AttributeUsage(AttributeTargets.Method)] 9 | public abstract class BindingAttribute : Attribute 10 | { 11 | public BindingAttribute() 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Abstractions/src/FunctionAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Azure.Functions.Worker 7 | { 8 | [AttributeUsage(AttributeTargets.Method)] 9 | public class FunctionAttribute : Attribute 10 | { 11 | public FunctionAttribute(string name) 12 | { 13 | Name = name; 14 | } 15 | 16 | public string Name { get; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Abstractions/src/InputBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Extensions.Abstractions 7 | { 8 | [AttributeUsage(AttributeTargets.Parameter)] 9 | public abstract class InputBindingAttribute : BindingAttribute 10 | { 11 | public InputBindingAttribute() 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Abstractions/src/KnownBindingCapabilities.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Extensions.Abstractions 5 | { 6 | /// 7 | /// Class containing constant values representing known binding capabilities. 8 | /// 9 | public static class KnownBindingCapabilities 10 | { 11 | /// 12 | /// Signals that a binding has function level retry support. 13 | /// 14 | public const string FunctionLevelRetry = "FunctionLevelRetry"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Abstractions/src/OutputBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Extensions.Abstractions 7 | { 8 | [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property)] 9 | public abstract class OutputBindingAttribute : BindingAttribute 10 | { 11 | public OutputBindingAttribute() 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Abstractions/src/RetryAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Azure.Functions.Worker 7 | { 8 | [AttributeUsage(AttributeTargets.Method)] 9 | public abstract class RetryAttribute : Attribute 10 | { 11 | public RetryAttribute() 12 | { 13 | } 14 | 15 | /// 16 | /// The maximum number of retries allowed per function execution 17 | /// 18 | public int MaxRetryCount { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Abstractions/src/SupportsDeferredBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Extensions.Abstractions 7 | { 8 | /// 9 | /// Specifies if a converter supports deferred binding when generating function metadata. 10 | /// This is to be used on converters that support deferred binding. 11 | /// 12 | [AttributeUsage(AttributeTargets.Class)] 13 | public class SupportsDeferredBindingAttribute : Attribute 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Abstractions/src/TriggerBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Extensions.Abstractions 7 | { 8 | [AttributeUsage(AttributeTargets.Parameter)] 9 | public abstract class TriggerBindingAttribute : BindingAttribute 10 | { 11 | public TriggerBindingAttribute() 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Abstractions/src/Worker.Extensions.Abstractions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | preview 6 | Microsoft.Azure.Functions.Worker.Extensions.Abstractions 7 | Microsoft.Azure.Functions.Worker.Extensions.Abstractions 8 | Abstractions for Azure Functions .NET Worker 9 | 3 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.CosmosDB/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.cosmos.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.CosmosDB/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Extensions.CosmosDB 8 | 9 | - 10 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.CosmosDB/src/Config/CosmosDBExtensionOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Azure.Cosmos; 5 | 6 | namespace Microsoft.Azure.Functions.Worker 7 | { 8 | public class CosmosDBExtensionOptions 9 | { 10 | /// 11 | /// Gets or sets the CosmosClientOptions. 12 | /// 13 | public CosmosClientOptions ClientOptions { get; set; } = new() { ConnectionMode = ConnectionMode.Gateway }; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.CosmosDB/src/Constants.cs: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) .NET Foundation. All rights reserved. 3 | // Licensed under the MIT License. See License.txt in the project root for license information. 4 | 5 | namespace Microsoft.Azure.Functions.Worker.Extensions.CosmosDB 6 | { 7 | internal static class Constants 8 | { 9 | internal const string CosmosExtensionName = "CosmosDB"; 10 | internal const string ConfigurationSectionName = "AzureWebJobs"; 11 | internal const string ConnectionStringsSectionName = "ConnectionStrings"; 12 | internal const string AccountEndpoint = "accountEndpoint"; 13 | internal const string JsonContentType = "application/json"; 14 | } 15 | } -------------------------------------------------------------------------------- /extensions/Worker.Extensions.CosmosDB/src/CosmosExtensionStartup.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.Azure.Functions.Worker; 6 | using Microsoft.Azure.Functions.Worker.Core; 7 | 8 | [assembly: WorkerExtensionStartup(typeof(CosmosExtensionStartup))] 9 | 10 | namespace Microsoft.Azure.Functions.Worker 11 | { 12 | public class CosmosExtensionStartup : WorkerExtensionStartup 13 | { 14 | public override void Configure(IFunctionsWorkerApplicationBuilder applicationBuilder) 15 | { 16 | if (applicationBuilder == null) 17 | { 18 | throw new ArgumentNullException(nameof(applicationBuilder)); 19 | } 20 | 21 | applicationBuilder.ConfigureCosmosDBExtension(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.CosmosDB/src/Utilities.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Extensions.CosmosDB 8 | { 9 | internal class Utilities 10 | { 11 | internal static IReadOnlyList ParsePreferredLocations(string preferredRegions) 12 | { 13 | if (string.IsNullOrEmpty(preferredRegions)) 14 | { 15 | return Enumerable.Empty().ToList(); 16 | } 17 | 18 | return preferredRegions 19 | .Split(',') 20 | .Select((region) => region.Trim()) 21 | .Where((region) => !string.IsNullOrEmpty(region)) 22 | .ToList(); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /extensions/Worker.Extensions.EventGrid/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.eventgrid.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.EventGrid/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Extensions.EventGrid 8 | 9 | - -------------------------------------------------------------------------------- /extensions/Worker.Extensions.EventGrid/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | using Microsoft.Azure.Functions.Worker.Extensions.Abstractions; 6 | 7 | [assembly: InternalsVisibleTo("Microsoft.Azure.Functions.Worker.Extensions.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001005148be37ac1d9f58bd40a2e472c9d380d635b6048278f7d47480b08c928858f0f7fe17a6e4ce98da0e7a7f0b8c308aecd9e9b02d7e9680a5b5b75ac7773cec096fbbc64aebd429e77cb5f89a569a79b28e9c76426783f624b6b70327eb37341eb498a2c3918af97c4860db6cdca4732787150841e395a29cfacb959c1fd971c1")] 8 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.EventHubs/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.eventhubs.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.EventHubs/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Extensions.EventHubs 6.4.0 8 | 9 | - Updating `Microsoft.Azure.WebJobs.Extensions.EventHubs` reference to 6.5.1 10 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.EventHubs/src/Constants.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Extensions.EventHubs 5 | { 6 | internal static class Constants 7 | { 8 | internal const string BinaryContentType = "application/octet-stream"; 9 | 10 | internal const string BindingSource = "AzureEventHubsEventData"; 11 | } 12 | } -------------------------------------------------------------------------------- /extensions/Worker.Extensions.EventHubs/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Azure.Functions.Worker.Extensions.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001005148be37ac1d9f58bd40a2e472c9d380d635b6048278f7d47480b08c928858f0f7fe17a6e4ce98da0e7a7f0b8c308aecd9e9b02d7e9680a5b5b75ac7773cec096fbbc64aebd429e77cb5f89a569a79b28e9c76426783f624b6b70327eb37341eb498a2c3918af97c4860db6cdca4732787150841e395a29cfacb959c1fd971c1")] 7 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Http.AspNetCore.Analyzers/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001005148be37ac1d9f58bd40a2e472c9d380d635b6048278f7d47480b08c928858f0f7fe17a6e4ce98da0e7a7f0b8c308aecd9e9b02d7e9680a5b5b75ac7773cec096fbbc64aebd429e77cb5f89a569a79b28e9c76426783f624b6b70327eb37341eb498a2c3918af97c4860db6cdca4732787150841e395a29cfacb959c1fd971c1")] -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Http.AspNetCore/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.http.aspnetcore.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Http.AspNetCore/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore 8 | 9 | - 10 | 11 | ### Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.Analyzers 12 | 13 | - 14 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Http.AspNetCore/src/AspNetMiddleware/FunctionHttpBinding.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore 5 | { 6 | /// 7 | /// Represents an HttpTrigger binding. Internal class for deserializing raw binding info. 8 | /// 9 | internal class FunctionHttpBinding 10 | { 11 | public string Name { get; set; } = default!; 12 | 13 | public string Type { get; set; } = default!; 14 | 15 | public string Route { get; set; } = default!; 16 | 17 | public string[] Methods { get; set; } = default!; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Http.AspNetCore/src/AspNetMiddleware/HostJsonModel.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore 2 | { 3 | /// 4 | /// Represents host.json. Internal class for deserializing. 5 | /// 6 | internal class HostJsonModel 7 | { 8 | public HostJsonExtensionModel Extensions { get; set; } = default!; 9 | } 10 | 11 | internal class HostJsonExtensionModel 12 | { 13 | public HostJsonExtensionHttpModel Http { get; set; } = default!; 14 | } 15 | 16 | internal class HostJsonExtensionHttpModel 17 | { 18 | public string RoutePrefix { get; set; } = default!; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Http.AspNetCore/src/Constants.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore 5 | { 6 | internal static class Constants 7 | { 8 | // Rpc Constants 9 | internal const string HttpUriCapability = "HttpUri"; 10 | 11 | // Header constants 12 | internal const string CorrelationHeader = "x-ms-invocation-id"; 13 | 14 | internal const string HttpContextKey = "HttpRequestContext"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Http.AspNetCore/src/HttpUriProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore 7 | { 8 | internal static class HttpUriProvider 9 | { 10 | private static Lazy HttpUri = new Lazy(() => new Uri("http://localhost:" + Utilities.GetUnusedTcpPort().ToString())); 11 | 12 | public static string HttpUriString { get; } = HttpUri.Value.ToString(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Http.AspNetCore/src/Utilities.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Net; 5 | using System.Net.Sockets; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore 8 | { 9 | internal class Utilities 10 | { 11 | public static int GetUnusedTcpPort() 12 | { 13 | using (Socket tcpSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) 14 | { 15 | tcpSocket.Bind(new IPEndPoint(IPAddress.Loopback, 0)); 16 | int port = ((IPEndPoint)tcpSocket.LocalEndPoint!).Port; 17 | return port; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Http/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.http.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Http/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Extensions.Http 3.3.0 8 | 9 | - 10 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Http/src/FromBodyAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Azure.Functions.Worker.Converters; 5 | using Microsoft.Azure.Functions.Worker.Extensions.Http.Converters; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Http 8 | { 9 | /// 10 | /// Specifies that a parameter should be bound using the HTTP request body when using the . 11 | /// 12 | public class FromBodyAttribute : InputConverterAttribute 13 | { 14 | /// 15 | /// Creates an instance of the . 16 | /// 17 | public FromBodyAttribute() 18 | : base(typeof(FromBodyConverter)) 19 | { 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Http/src/HttpResultAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.Azure.Functions.Worker.Extensions.Abstractions; 6 | 7 | namespace Microsoft.Azure.Functions.Worker 8 | { 9 | /// 10 | /// Attribute used to mark an HTTP Response on an HTTP Trigger function with multiple output bindings. 11 | /// 12 | [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] 13 | public sealed class HttpResultAttribute : OutputBindingAttribute 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Http/src/KeyValuePairExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Extensions.Http 7 | { 8 | internal static class KeyValuePairExtensions 9 | { 10 | internal static void Deconstruct(this KeyValuePair kvp, out TKey key, out TValue value) 11 | { 12 | key = kvp.Key; 13 | value = kvp.Value; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Http/src/Worker.Extensions.Http.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Microsoft.Azure.Functions.Worker.Extensions.Http 5 | Microsoft.Azure.Functions.Worker.Extensions.Http 6 | HTTP extensions for .NET isolated functions 7 | 8 | 9 | 3.3.0 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Kafka/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.kafka.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Kafka/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Extensions.Kafka 8 | 9 | - 10 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Kafka/src/BrokerAuthenticationMode.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker 5 | { 6 | /// 7 | /// Defines the broker authentication modes 8 | /// 9 | public enum BrokerAuthenticationMode 10 | { 11 | // Force that 0 starts like the one from librdkafka 12 | NotSet = -1, 13 | Gssapi, 14 | Plain, 15 | ScramSha256, 16 | ScramSha512, 17 | OAuthBearer 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Kafka/src/BrokerProtocol.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker 5 | { 6 | /// 7 | /// Defines the broker protocols 8 | /// 9 | public enum BrokerProtocol 10 | { 11 | // Force that 0 starts like the one from librdkafka 12 | NotSet = -1, 13 | Plaintext, 14 | Ssl, 15 | SaslPlaintext, 16 | SaslSsl 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Kafka/src/KafkaMessageKeyType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace Microsoft.Azure.Functions.Worker 9 | { 10 | /// 11 | /// Defines the data type used in kafka extension as enum. 12 | /// 13 | public enum KafkaMessageKeyType 14 | { 15 | Int = 0, 16 | Long, 17 | String, 18 | Binary 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Kafka/src/OAuthBearerMethod.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace Microsoft.Azure.Functions.Worker 9 | { 10 | /// 11 | /// Defines the OAuth bearer method 12 | /// 13 | public enum OAuthBearerMethod 14 | { 15 | Default, 16 | Oidc 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.RabbitMQ/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.rabbitmq.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.RabbitMQ/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Extensions.RabbitMQ 2.1.0 8 | 9 | - Updates `Microsoft.Azure.WebJobs.Extensions.RabbitMQ` to 2.1.0. 10 | - Adds drain mode feature. 11 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Rpc/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.rpc.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Rpc/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Extensions.Rpc 8 | 9 | - 10 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Rpc/src/FunctionsGrpcOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using Grpc.Core; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Extensions.Rpc; 7 | 8 | /// 9 | /// Contains options for the functions gRPC invocation. 10 | /// 11 | public sealed class FunctionsGrpcOptions 12 | { 13 | /// 14 | /// Gets the which is configured to call the functions host. 15 | /// 16 | public CallInvoker CallInvoker { get; internal set; } = null!; 17 | } 18 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.SendGrid/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.sendgrid.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.SendGrid/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Extensions.SendGrid 3.1.0 8 | 9 | - Update dependency "Microsoft.Azure.WebJobs.Extensions.SendGrid" to v3.1.0 10 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.ServiceBus/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.servicebus.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.ServiceBus/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Extensions.ServiceBus 8 | 9 | - -------------------------------------------------------------------------------- /extensions/Worker.Extensions.ServiceBus/src/Constants.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Extensions.ServiceBus 5 | { 6 | internal static class Constants 7 | { 8 | internal const string BinaryContentType = "application/octet-stream"; 9 | 10 | internal const string BindingSource = "AzureServiceBusReceivedMessage"; 11 | 12 | internal const string SessionId = "SessionId"; 13 | 14 | internal const string SessionIdArray = "SessionIdArray"; 15 | 16 | internal const string SessionActions = "SessionActions"; 17 | 18 | internal const string SessionLockedUntil = "SessionLockedUntil"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.ServiceBus/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Azure.Functions.Worker.Extensions.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001005148be37ac1d9f58bd40a2e472c9d380d635b6048278f7d47480b08c928858f0f7fe17a6e4ce98da0e7a7f0b8c308aecd9e9b02d7e9680a5b5b75ac7773cec096fbbc64aebd429e77cb5f89a569a79b28e9c76426783f624b6b70327eb37341eb498a2c3918af97c4860db6cdca4732787150841e395a29cfacb959c1fd971c1")] 7 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.ServiceBus/src/ServiceBusEntityType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | 5 | namespace Microsoft.Azure.Functions.Worker 6 | { 7 | /// 8 | /// Service Bus entity type. 9 | /// 10 | public enum ServiceBusEntityType 11 | { 12 | /// 13 | /// Service Bus Queue 14 | /// 15 | Queue, 16 | 17 | /// 18 | /// Service Bus Topic 19 | /// 20 | Topic 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.SignalRService/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.signalr.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.SignalRService/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Extensions.SignalRService 8 | 9 | - -------------------------------------------------------------------------------- /extensions/Worker.Extensions.SignalRService/src/Constants.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.SignalRService 5 | { 6 | internal class Constants 7 | { 8 | internal const string ServiceTransportTypeName = "AzureSignalRServiceTransportType"; 9 | internal const string AzureSignalREndpoints = "Azure:SignalR:Endpoints"; 10 | 11 | internal const string FunctionsWorkerProductInfoKey = "func"; 12 | internal const string DotnetIsolatedWorker = "dotnet-isolated-classBased"; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.SignalRService/src/Hubs/HubContextProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Collections.Concurrent; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.SignalRService 8 | { 9 | internal class HubContextProvider 10 | { 11 | private static readonly ConcurrentDictionary Cache = new(); 12 | 13 | public bool TryGetValue(Type type, out object value) => Cache.TryGetValue(type, out value); 14 | 15 | public void Add(Type type, object value) => Cache.TryAdd(type, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.SignalRService/src/Models/SignalRConnectionInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker 5 | { 6 | /// 7 | /// Contains necessary information for a SignalR client to connect to SignalR Service. 8 | /// 9 | public sealed class SignalRConnectionInfo 10 | { 11 | /// 12 | /// The URL for a client to connect to SignalR Service. 13 | /// 14 | public string Url { get; set; } 15 | 16 | /// 17 | /// The access token for a client to connect to SignalR service. 18 | /// 19 | public string AccessToken { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Storage.Blobs/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.storage.blobs.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Storage.Blobs/src/BlobStorageExtensionStartup.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.Azure.Functions.Worker; 6 | using Microsoft.Azure.Functions.Worker.Core; 7 | 8 | [assembly: WorkerExtensionStartup(typeof(BlobStorageExtensionStartup))] 9 | 10 | namespace Microsoft.Azure.Functions.Worker 11 | { 12 | public class BlobStorageExtensionStartup : WorkerExtensionStartup 13 | { 14 | public override void Configure(IFunctionsWorkerApplicationBuilder applicationBuilder) 15 | { 16 | if (applicationBuilder == null) 17 | { 18 | throw new ArgumentNullException(nameof(applicationBuilder)); 19 | } 20 | 21 | applicationBuilder.ConfigureBlobStorageExtension(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Storage.Blobs/src/Constants.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs 5 | { 6 | internal static class Constants 7 | { 8 | internal const string Storage = "Storage"; 9 | internal const string BlobExtensionName = "AzureStorageBlobs"; 10 | 11 | // Media content types 12 | internal const string JsonContentType = "application/json"; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Storage.Queues/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.storage.queues.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Storage.Queues/src/Constants.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Storage.Queues 5 | { 6 | internal static class Constants 7 | { 8 | internal const string QueueExtensionName = "AzureStorageQueues"; 9 | internal const string QueueMessageText = "MessageText"; 10 | 11 | // Media content types 12 | internal const string JsonContentType = "application/json"; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Storage.Queues/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Azure.Functions.Worker.Extensions.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001005148be37ac1d9f58bd40a2e472c9d380d635b6048278f7d47480b08c928858f0f7fe17a6e4ce98da0e7a7f0b8c308aecd9e9b02d7e9680a5b5b75ac7773cec096fbbc64aebd429e77cb5f89a569a79b28e9c76426783f624b6b70327eb37341eb498a2c3918af97c4860db6cdca4732787150841e395a29cfacb959c1fd971c1")] 7 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Storage/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.storage.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Storage/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Extensions.Storage 8 | 9 | - 10 | 11 | ### Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs 12 | 13 | - 14 | 15 | ### Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues 16 | 17 | - 18 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Tables/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.tables.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Tables/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Extensions.Tables 1.5.0 8 | 9 | - Support deferred binding for poco types in Table Input binding (#3003) -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Tables/src/Constants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Microsoft.Azure.Functions.Worker.Extensions.Tables 6 | { 7 | internal class Constants 8 | { 9 | internal const string Storage = "Storage"; 10 | internal const string TablesExtensionName = "AzureStorageTables"; 11 | internal const string TableName = "TableName"; 12 | internal const string PartitionKey = "PartitionKey"; 13 | internal const string RowKey = "RowKey"; 14 | internal const string Connection = "Connection"; 15 | internal const string Take = "Take"; 16 | internal const string Filter = "Filter"; 17 | // Media content types 18 | internal const string JsonContentType = "application/json"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Timer/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.timer.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Timer/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Extensions.Timer 8 | 9 | - 10 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Timer/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Azure.Functions.Worker.Extensions.Timer.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001005148be37ac1d9f58bd40a2e472c9d380d635b6048278f7d47480b08c928858f0f7fe17a6e4ce98da0e7a7f0b8c308aecd9e9b02d7e9680a5b5b75ac7773cec096fbbc64aebd429e77cb5f89a569a79b28e9c76426783f624b6b70327eb37341eb498a2c3918af97c4860db6cdca4732787150841e395a29cfacb959c1fd971c1")] 7 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Timer/src/Worker.Extensions.Timer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Microsoft.Azure.Functions.Worker.Extensions.Timer 5 | Microsoft.Azure.Functions.Worker.Extensions.Timer 6 | Timer extensions for .NET isolated functions 7 | 8 | 9 | 4.3.1 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Warmup/ci/official-release.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishToNugetOrg 3 | displayName: Publish to nuget.org? 4 | type: boolean 5 | default: false 6 | 7 | pr: none 8 | trigger: none 9 | 10 | resources: 11 | pipelines: 12 | - pipeline: build 13 | source: extensions.warmup.official 14 | 15 | extends: 16 | template: /eng/ci/templates/pipelines/release-extension-packages.yml@self 17 | parameters: 18 | publishToNugetOrg: ${{ parameters.publishToNugetOrg }} 19 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Warmup/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Extensions.Warmup 8 | 9 | - 10 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Warmup/src/WarmupTrigger.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Azure.Functions.Worker.Extensions.Abstractions; 5 | 6 | namespace Microsoft.Azure.Functions.Worker 7 | { 8 | /// 9 | /// Attribute used to mark a function that should be invoked during the warmup 10 | /// stage of the Function App. 11 | /// 12 | public sealed class WarmupTrigger : TriggerBindingAttribute 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /extensions/Worker.Extensions.Warmup/src/Worker.Extensions.Warmup.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Microsoft.Azure.Functions.Worker.Extensions.Warmup 5 | Microsoft.Azure.Functions.Worker.Extensions.Warmup 6 | Warmup extensions for .NET isolated functions 7 | 8 | 9 | 4.0.2 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "9.0.201", 4 | "allowPrerelease": true, 5 | "rollForward": "latestFeature" 6 | }, 7 | "msbuild-sdks": { 8 | "Microsoft.Build.NoTargets": "3.7.56", 9 | "Microsoft.Build.Traversal": "4.1.0" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /host/.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ 2 | build/ 3 | out/ 4 | .idea/ 5 | cmake-build-*/ 6 | /src/.idea/ 7 | 8 | #Ignore the proto files we temporarily copy for build 9 | /src/Protos/**/*.proto -------------------------------------------------------------------------------- /host/README.md: -------------------------------------------------------------------------------- 1 | # FunctionsNetHost 2 | 3 | [![Build Status](https://azfunc.visualstudio.com/Azure%20Functions/_apis/build/status/.NET%20Worker/FunctionsNetHost%20(dotnet%20isolated)?branchName=main)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=206&branchName=main) 4 | 5 | FunctionsNetHost is a native component which enables placeholder mode & specialization for dotnet isolated function apps. 6 | 7 | ## Build 8 | 9 | [Build - Windows](docs/build.md) 10 | -------------------------------------------------------------------------------- /host/src/FunctionsNetHost/AppLoader/WorkerLoadStatusSignalManager.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace FunctionsNetHost; 5 | 6 | /// 7 | /// Provides a signaling mechanism to wait and get notified about successful load of worker assembly. 8 | /// 9 | public class WorkerLoadStatusSignalManager 10 | { 11 | private WorkerLoadStatusSignalManager() 12 | { 13 | Signal = new ManualResetEvent(false); 14 | } 15 | 16 | public static WorkerLoadStatusSignalManager Instance { get; } = new(); 17 | 18 | public readonly ManualResetEvent Signal; 19 | } 20 | -------------------------------------------------------------------------------- /host/src/FunctionsNetHost/Grpc/Exceptions/EnvironmentReloadNotSupportedException.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker 5 | { 6 | /// 7 | /// The exception that is thrown when the current function app payload does not support environment reload. 8 | /// 9 | public sealed class EnvironmentReloadNotSupportedException : NotSupportedException 10 | { 11 | public EnvironmentReloadNotSupportedException() { } 12 | 13 | public EnvironmentReloadNotSupportedException(string message) : base(message) { } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /host/src/FunctionsNetHost/Grpc/Exceptions/FunctionAppPayloadNotFoundException.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker 5 | { 6 | /// 7 | /// The exception that is thrown when there is no function app payload found. 8 | /// 9 | public sealed class FunctionAppPayloadNotFoundException : Exception 10 | { 11 | public FunctionAppPayloadNotFoundException() { } 12 | 13 | public FunctionAppPayloadNotFoundException(string message) : base(message) { } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /host/src/FunctionsNetHost/Grpc/GrpcWorkerStartupOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace FunctionsNetHost.Grpc 5 | { 6 | internal sealed class GrpcWorkerStartupOptions 7 | { 8 | public Uri ServerUri { get; set; } 9 | 10 | public string? WorkerId { get; set; } 11 | 12 | public string? RequestId { get; set; } 13 | 14 | public int GrpcMaxMessageLength { get; set; } 15 | 16 | public string[] CommandLineArgs { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /host/src/FunctionsNetHost/Grpc/WorkerCapabilities.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace FunctionsNetHost.Grpc 5 | { 6 | internal static class WorkerCapabilities 7 | { 8 | internal const string EnableUserCodeException = "EnableUserCodeException"; 9 | internal const string HandlesWorkerWarmupMessage = "HandlesWorkerWarmupMessage"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /host/src/FunctionsNetHost/Grpc/WorkerConfig/WorkerConfig.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace FunctionsNetHost.Grpc 5 | { 6 | /// 7 | /// Represents a worker configuration instance. 8 | /// 9 | public sealed class WorkerConfig 10 | { 11 | public WorkerDescription? Description { set; get; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /host/src/FunctionsNetHost/Grpc/WorkerConfig/WorkerConfigSerializerContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Text.Json.Serialization; 5 | 6 | namespace FunctionsNetHost.Grpc 7 | { 8 | [JsonSerializable(typeof(WorkerConfig))] 9 | [JsonSourceGenerationOptions(IncludeFields = true, PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)] 10 | internal partial class WorkerConfigSerializerContext : JsonSerializerContext { } 11 | } 12 | -------------------------------------------------------------------------------- /host/src/FunctionsNetHost/Grpc/WorkerConfig/WorkerDescription.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace FunctionsNetHost.Grpc 5 | { 6 | public sealed class WorkerDescription 7 | { 8 | public string? DefaultWorkerPath { set; get; } 9 | 10 | public bool CanUsePlaceholder { set; get; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /host/src/FunctionsNetHost/Logger.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Globalization; 5 | 6 | namespace FunctionsNetHost 7 | { 8 | internal static class Logger 9 | { 10 | /// 11 | /// Logs a trace message if trace level logging is enabled. 12 | /// 13 | internal static void LogTrace(string message) 14 | { 15 | if (Configuration.IsTraceLogEnabled) 16 | { 17 | Log(message); 18 | } 19 | } 20 | 21 | internal static void Log(string message) 22 | { 23 | var ts = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture); 24 | Console.WriteLine($"{Configuration.LogPrefix}[{ts}] [FunctionsNetHost] {message}"); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /host/src/FunctionsNetHost/Native/NativeHostData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace FunctionsNetHost; 5 | 6 | public struct NativeHostData 7 | { 8 | public IntPtr PNativeApplication; 9 | } 10 | -------------------------------------------------------------------------------- /host/src/FunctionsNetHost/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "FunctionsNetHost": { 4 | "commandName": "Project", 5 | "commandLineArgs": "FunctionsNetHost.exe --host 127.0.0.1 --port 503 --workerId 13a2c943-ee61-449b-97ea-7c2577cbb1db --requestId 78522dbc-3bef-4ced-8988-bb3761c94e00 --grpcMaxMessageLength 2147483647" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /host/src/FunctionsNetHost/exports.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | get_application_properties 3 | register_callbacks 4 | send_streaming_message 5 | -------------------------------------------------------------------------------- /host/src/FunctionsNetHost/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "8.0.110", 4 | "rollForward": "latestMinor" 5 | } 6 | } -------------------------------------------------------------------------------- /host/src/PrelaunchApp/App.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | net6.0;net7.0;net8.0;net9.0 5 | False 6 | None 7 | 8 | -------------------------------------------------------------------------------- /host/src/README.md: -------------------------------------------------------------------------------- 1 | # FunctionsNetHost 2 | 3 | Managed code version of FunctionsNetHost. 4 | 5 | ## Publish 6 | 7 | Open a terminal here and run `dotnet publish -c release -r win-x64`. This will produce the native exe in `FunctionsNetHost\bin\Release\net7.0\win-x64\publish\` directory. 8 | -------------------------------------------------------------------------------- /key.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-functions-dotnet-worker/9ed7ece0564d9db3a30b87d5eea8324a6e7c3d10/key.snk -------------------------------------------------------------------------------- /protos/azure-functions-language-worker-protobuf/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/about-codeowners/ 2 | # for more info about CODEOWNERS file 3 | # 4 | # It uses the same pattern rule for gitignore file 5 | # https://git-scm.com/docs/gitignore#_pattern_format 6 | 7 | 8 | 9 | # AZURE FUNCTIONS TEAM 10 | # For all file changes, github would automatically 11 | # include the following people in the PRs. 12 | # Language owners should get notified of any new changes to the proto file. 13 | 14 | src/proto/FunctionRpc.proto @vrdmr @gavin-aguiar @YunchuWang @surgupta-msft @satvu @ejizba @alrod @anatolib @kaibocai @shreyas-gopalakrishna @amamounelsayed @Francisco-Gamino 15 | -------------------------------------------------------------------------------- /protos/azure-functions-language-worker-protobuf/src/proto/shared/NullableTypes.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | // protobuf vscode extension: https://marketplace.visualstudio.com/items?itemName=zxh404.vscode-proto3 3 | 4 | option java_package = "com.microsoft.azure.functions.rpc.messages"; 5 | 6 | import "google/protobuf/timestamp.proto"; 7 | 8 | message NullableString { 9 | oneof string { 10 | string value = 1; 11 | } 12 | } 13 | 14 | message NullableDouble { 15 | oneof double { 16 | double value = 1; 17 | } 18 | } 19 | 20 | message NullableBool { 21 | oneof bool { 22 | bool value = 1; 23 | } 24 | } 25 | 26 | message NullableTimestamp { 27 | oneof timestamp { 28 | google.protobuf.Timestamp value = 1; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker (metapackage) 8 | 9 | - `AZURE_FUNCTIONS_` environment variables are now loaded correctly when using `FunctionsApplicationBuilder`. (#2878) 10 | 11 | ### Microsoft.Azure.Functions.Worker.Core 12 | 13 | - 14 | 15 | ### Microsoft.Azure.Functions.Worker.Grpc 16 | 17 | - 18 | -------------------------------------------------------------------------------- /samples/AspNetIntegration/AspNetIntegration.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | v4 6 | Exe 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /samples/AspNetIntegration/BodyBindingHttpTrigger.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using Microsoft.AspNetCore.Http; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.Azure.Functions.Worker; 7 | using FromBodyAttribute = Microsoft.Azure.Functions.Worker.Http.FromBodyAttribute; 8 | 9 | namespace AspNetIntegration 10 | { 11 | public class BodyBindingHttpTrigger 12 | { 13 | [Function(nameof(BodyBindingHttpTrigger))] 14 | public IActionResult Run([HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequest req, 15 | [FromBody] Person person) 16 | { 17 | return new OkObjectResult(person); 18 | } 19 | } 20 | 21 | public record Person(string Name, int Age); 22 | } 23 | -------------------------------------------------------------------------------- /samples/AspNetIntegration/FileDownload.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.Functions.Worker; 4 | 5 | namespace AspNetIntegration 6 | { 7 | public class FileDownload 8 | { 9 | // Replace this with your blob container name 10 | private const string BlobContainer = "runtimes"; 11 | 12 | // Replace this with your blob name 13 | private const string BlobName = "dotnet-sdk-8.0.110-win-x64.exe"; 14 | 15 | [Function("FileDownload")] 16 | public IActionResult Run([HttpTrigger(AuthorizationLevel.Function, "get")] HttpRequest req, 17 | [BlobInput($"{BlobContainer}/{BlobName}")] Stream blobStream) 18 | { 19 | return new FileStreamResult(blobStream, "application/octet-stream") 20 | { 21 | FileDownloadName = BlobName 22 | }; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/AspNetIntegration/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /samples/AspNetIntegration/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true", 5 | "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", 6 | "AzureWebJobsFeatureFlags": "EnableHttpProxying" 7 | } 8 | } -------------------------------------------------------------------------------- /samples/Configuration/Configuration.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | v4 6 | Exe 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /samples/Configuration/README.md: -------------------------------------------------------------------------------- 1 | # Configuration 2 | 3 | This sample demonstrates how to configure the Azure Functions Dotnet Isolated Worker. See `Program.cs` for details. -------------------------------------------------------------------------------- /samples/Configuration/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /samples/Configuration/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", 5 | "AzureWebJobsStorage": "UseDevelopmentStorage=true" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/CustomMiddleware/CustomMiddleware.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | v4 6 | Exe 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/CustomMiddleware/README.md: -------------------------------------------------------------------------------- 1 | # Custom Middleware 2 | 3 | This sample demonstrates how to create and register a custom middleware that is injected into the invocation pipeline. -------------------------------------------------------------------------------- /samples/CustomMiddleware/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingExcludedTypes": "Request", 6 | "samplingSettings": { 7 | "isEnabled": true 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /samples/CustomMiddleware/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", 5 | "AzureWebJobsStorage": "" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | false 5 | enable 6 | enable 7 | 8 | 9 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/EntityFramework/README.md: -------------------------------------------------------------------------------- 1 | # .NET 5 Entity Framework Sample (Azure Functions) 2 | 3 | ## Setup 4 | 5 | 1. Clone the repo 6 | 1. Rename `local.settings.sample.json` to `local.settings.json` and fill in connection strings 7 | 1. Install the dontnet-ef tool: 8 | `dotnet tool install --global dotnet-ef` 9 | 1. Set the connection string for migration 10 | `$env:SqlConnectionString="Server=tcp:my.database.windows.net,1433;......"` 11 | 1. Create the initial migration 12 | `dotnet ef migrations add initial` 13 | 1. Update the database 14 | `dotnet ef database update` 15 | 1. Run the function project with `func start` 16 | 1. Call the different operations in the `./test.http` file (file format is for RESTClient in VS Code) 17 | 18 | -------------------------------------------------------------------------------- /samples/EntityFramework/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingExcludedTypes": "Request", 6 | "samplingSettings": { 7 | "isEnabled": true 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /samples/EntityFramework/local.settings.sample.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "", 5 | "SqlConnectionString": "", 6 | "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/EntityFramework/test.http: -------------------------------------------------------------------------------- 1 | ### Create Blog 2 | POST http://localhost:7071/api/blog 3 | Content-Type: application/json 4 | 5 | { 6 | "Url": "http://example.com" 7 | } 8 | 9 | ### Create Post 10 | 11 | POST http://localhost:7071/api/blog/1/post 12 | Content-Type: application/json 13 | 14 | { 15 | "Title": "Hello World", 16 | "Content": "This is the content" 17 | } 18 | 19 | ### Get Posts 20 | GET http://localhost:7071/api/posts 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/Extensions/Blob/Book.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace SampleApp 5 | { 6 | public class Book 7 | { 8 | public string? Id { get; set; } 9 | 10 | public string? Name { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/Extensions/README.md: -------------------------------------------------------------------------------- 1 | # Extensions Sample 2 | 3 | This sample project provides simple examples of how to use various extensions supported by the .NET Worker. -------------------------------------------------------------------------------- /samples/Extensions/Timer/TimerFunction.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Azure.Functions.Worker; 5 | using Microsoft.Extensions.Logging; 6 | 7 | namespace SampleApp 8 | { 9 | public static class TimerFunction 10 | { 11 | // 12 | [Function(nameof(TimerFunction))] 13 | [FixedDelayRetry(5, "00:00:10")] 14 | public static void Run([TimerTrigger("0 */5 * * * *")] TimerInfo timerInfo, 15 | FunctionContext context) 16 | { 17 | var logger = context.GetLogger(nameof(TimerFunction)); 18 | logger.LogInformation($"Function Ran. Next timer schedule = {timerInfo.ScheduleStatus?.Next}"); 19 | } 20 | // 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/Extensions/Warmup/Warmup.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Azure.Functions.Worker; 5 | using Microsoft.Extensions.Logging; 6 | 7 | namespace SampleApp 8 | { 9 | public static class Warmup 10 | { 11 | [Function(nameof(Warmup))] 12 | public static void Run([WarmupTrigger] object warmupContext, FunctionContext context) 13 | { 14 | var logger = context.GetLogger(nameof(Warmup)); 15 | logger.LogInformation("Function App instance is now warm!"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/Extensions/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /samples/Extensions/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", 5 | "AzureWebJobsStorage": "", 6 | "CosmosDBConnection": "", 7 | "CosmosDb": "ItemDb", 8 | "CosmosContainerIn": "ItemContainerIn", 9 | "CosmosContainerOut": "ItemContainerOut", 10 | "EventHubConnection": "", 11 | "RabbitMQConnection": "", 12 | "ServiceBusConnection": "", 13 | "SignalRConnection": "" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /samples/FunctionApp/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /samples/FunctionApp/QueueTrigger/QueueTrigger.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Azure.Functions.Worker; 5 | 6 | namespace FunctionApp 7 | { 8 | public static class QueueTrigger 9 | { 10 | [Function(nameof(QueueTrigger))] 11 | public static Book Run( 12 | [QueueTrigger("functionstesting2", Connection = "AzureWebJobsStorage")] Book myQueueItem, 13 | [BlobInput("test-samples/sample1.txt", Connection = "AzureWebJobsStorage")] string myBlob) 14 | { 15 | Console.WriteLine(myBlob); 16 | return myQueueItem; 17 | } 18 | } 19 | 20 | public class Book 21 | { 22 | public string? Id { get; set; } 23 | public string? Name { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/FunctionApp/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /samples/FunctionApp/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", 5 | "AzureWebJobsStorage": "UseDevelopmentStorage=true" 6 | } 7 | } -------------------------------------------------------------------------------- /samples/Net9FunctionApp/HelloHttp.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.Functions.Worker; 4 | using Microsoft.Extensions.Logging; 5 | 6 | namespace Net9FunctionApp 7 | { 8 | public class HelloHttp(ILogger logger) 9 | { 10 | [Function("HelloHttp")] 11 | public IActionResult Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequest req) 12 | { 13 | logger.LogInformation("C# HTTP trigger function processed a request."); 14 | return new OkObjectResult("Welcome to Azure Functions!"); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/Net9FunctionApp/Net9FunctionApp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net9.0 4 | v4 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/Net9FunctionApp/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Functions.Worker; 2 | using Microsoft.Azure.Functions.Worker.Builder; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Microsoft.Extensions.Hosting; 5 | 6 | var builder = FunctionsApplication.CreateBuilder(args); 7 | builder.ConfigureFunctionsWebApplication(); 8 | 9 | builder.Services.AddApplicationInsightsTelemetryWorkerService(); 10 | builder.Services.ConfigureFunctionsApplicationInsights(); 11 | 12 | var host = builder.Build(); 13 | 14 | host.Run(); 15 | -------------------------------------------------------------------------------- /samples/Net9FunctionApp/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | }, 9 | "enableLiveMetricsFilters": true 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /samples/Net9FunctionApp/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", 5 | "AzureWebJobsStorage": "UseDevelopmentStorage=true" 6 | } 7 | } -------------------------------------------------------------------------------- /samples/NetFxWorker/NetFxWorker.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net48 5 | v4 6 | Exe 7 | disable 8 | disable 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /samples/NetFxWorker/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Extensions.Hosting; 5 | using Microsoft.Azure.Functions.Worker; 6 | 7 | namespace NetFxWorker 8 | { 9 | internal class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | FunctionsDebugger.Enable(); 14 | 15 | var host = new HostBuilder() 16 | .ConfigureFunctionsWorkerDefaults() 17 | .Build(); 18 | 19 | host.Run(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/NetFxWorker/README.md: -------------------------------------------------------------------------------- 1 | # .NET Framework Worker 2 | 3 | This sample demonstrates how to create a .NET Framework project using the Isolated model. 4 | -------------------------------------------------------------------------------- /samples/NetFxWorker/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /samples/NetFxWorker/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", 5 | "AzureWebJobsStorage": "UseDevelopmentStorage=true" 6 | } 7 | } -------------------------------------------------------------------------------- /sdk/FunctionMetadataLoaderExtension/FunctionMetadataJsonReaderOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.WebJobs.Extensions.FunctionMetadataLoader 5 | { 6 | internal class FunctionMetadataJsonReaderOptions 7 | { 8 | public string FunctionMetadataFileDrectory { get; set; } = string.Empty; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /sdk/FunctionMetadataLoaderExtension/FunctionMetadataLoaderExtension.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | false 5 | netstandard2.0 6 | Microsoft.Azure.WebJobs.Extensions.FunctionMetadataLoader 7 | Microsoft.Azure.WebJobs.Extensions.FunctionMetadataLoader 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /sdk/Sdk.Analyzers/Extensions/NamedSymbolExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.CodeAnalysis; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Sdk.Analyzers 8 | { 9 | internal static class NamedSymbolExtensions 10 | { 11 | internal static bool IsInputOrTriggerBinding(this INamedTypeSymbol symbol) 12 | { 13 | var baseType = symbol.BaseType?.ToDisplayString(); 14 | 15 | if (string.Equals(baseType,Constants.Types.InputBindingAttribute, StringComparison.Ordinal) 16 | || string.Equals(baseType,Constants.Types.TriggerBindingAttribute, StringComparison.Ordinal)) 17 | { 18 | return true; 19 | } 20 | 21 | return false; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sdk/Sdk.Generators/Enums/CardinalityEnum.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Sdk.Generators.Enums 5 | { 6 | internal enum Cardinality 7 | { 8 | Undefined, 9 | Many, 10 | One 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sdk/Sdk.Generators/Enums/DataTypeEnum.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Sdk.Generators 5 | { 6 | internal enum DataType 7 | { 8 | Undefined, 9 | Binary, 10 | String 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sdk/Sdk.Generators/Enums/RetryStrategy.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Sdk.Generators 5 | { 6 | internal enum RetryStrategy 7 | { 8 | FixedDelay, 9 | ExponentialBackoff 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /sdk/Sdk.Generators/FunctionMetadataProviderGenerator/Abstractions/GeneratorRetryOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Sdk.Generators 5 | { 6 | internal class GeneratorRetryOptions 7 | { 8 | public RetryStrategy Strategy { get; set; } 9 | 10 | public string? MaxRetryCount { get; set; } 11 | 12 | public string? DelayInterval { get; set; } 13 | 14 | public string? MinimumInterval { get; set; } 15 | 16 | public string? MaximumInterval { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /sdk/Sdk.Generators/FunctionMetadataProviderGenerator/FunctionsMetadataParsingContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information.; 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Sdk.Generators 5 | { 6 | internal sealed class FunctionsMetadataParsingContext 7 | { 8 | internal string? ScriptFileExtension { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /sdk/Sdk.Generators/FunctionMethodVisibility.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Sdk.Generators 5 | { 6 | /// 7 | /// Represents the visibility of an "azure function" method and its parent classes. 8 | /// 9 | internal enum FunctionMethodVisibility 10 | { 11 | /// 12 | /// The method and it's parent classes are public & visible. 13 | /// 14 | Public, 15 | 16 | /// 17 | /// The method is public, but one or more of its parent classes are not public. 18 | /// 19 | PublicButContainingTypeNotVisible, 20 | 21 | /// 22 | /// The method is not public. 23 | /// 24 | NotPublic 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sdk/Sdk.Generators/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Azure.Functions.Sdk.Generator.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001005148be37ac1d9f58bd40a2e472c9d380d635b6048278f7d47480b08c928858f0f7fe17a6e4ce98da0e7a7f0b8c308aecd9e9b02d7e9680a5b5b75ac7773cec096fbbc64aebd429e77cb5f89a569a79b28e9c76426783f624b6b70327eb37341eb498a2c3918af97c4860db6cdca4732787150841e395a29cfacb959c1fd971c1")] 7 | -------------------------------------------------------------------------------- /sdk/Sdk.Generators/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "SourceGenerator": { 4 | "commandName": "DebugRoslynComponent", 5 | "targetProject": "..\\..\\samples\\FunctionApp\\FunctionApp.csproj" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /sdk/Sdk/Abstractions/SdkRetryOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Sdk 5 | { 6 | internal class SdkRetryOptions 7 | { 8 | public string? Strategy { get; set; } 9 | 10 | public int MaxRetryCount { get; set; } 11 | 12 | public string? DelayInterval { get; set; } 13 | 14 | public string? MinimumInterval { get; set; } 15 | 16 | public string? MaximumInterval { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /sdk/Sdk/DataTypeEnum.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Sdk 5 | { 6 | internal enum DataType 7 | { 8 | Undefined, 9 | Binary, 10 | String, 11 | Stream 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /sdk/Sdk/ExtensionReference.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Text.Json.Serialization; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Sdk 7 | { 8 | public class ExtensionReference 9 | { 10 | [JsonPropertyName("name")] 11 | public string? Name { get; set; } 12 | 13 | [JsonPropertyName("typeName")] 14 | public string? TypeName { get; set; } 15 | 16 | [JsonPropertyName("hintPath")] 17 | public string? HintPath { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /sdk/Sdk/Extensions/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Linq; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Sdk 8 | { 9 | internal static class StringExtensions 10 | { 11 | /// 12 | /// Returns a copy of the string where the first character is in lower case. 13 | /// 14 | public static string? ToLowerFirstCharacter(this string? str) 15 | { 16 | if (!string.IsNullOrEmpty(str)) 17 | { 18 | return Char.ToLowerInvariant(str.First()) + str!.Substring(1); 19 | } 20 | else 21 | { 22 | return str; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sdk/Sdk/Extensions/TypeReferenceExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using Mono.Cecil; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Sdk 7 | { 8 | internal static class TypeReferenceExtensions 9 | { 10 | public static string GetReflectionFullName(this TypeReference typeRef) 11 | { 12 | return typeRef.FullName.Replace('/', '+'); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sdk/Sdk/ExtensionsMetadata.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | using System.Text.Json.Serialization; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Sdk 8 | { 9 | public class ExtensionsMetadata 10 | { 11 | [JsonPropertyName("extensions")] 12 | public List Extensions { get; set; } = new List(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /sdk/Sdk/FunctionsMetadataGenerationException.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Runtime.Serialization; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Sdk 8 | { 9 | [Serializable] 10 | internal class FunctionsMetadataGenerationException: Exception 11 | { 12 | public FunctionsMetadataGenerationException() { } 13 | 14 | internal FunctionsMetadataGenerationException(string message): base(message) { } 15 | 16 | internal FunctionsMetadataGenerationException(string message, Exception innerException) : base(message, innerException) { } 17 | 18 | protected FunctionsMetadataGenerationException(SerializationInfo info, StreamingContext context) 19 | : base(info, context) { } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.Publish.props: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /sdk/Sdk/Tasks/ZipDeploy/DeployStatus.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | // IMPORTANT: Do not modify this file directly with major changes 5 | // This file is a copy from this project (with minor updates) -- https://github.com/Azure/azure-functions-vs-build-sdk/blob/b0e54a832a92119e00a2b1796258fcf88e0d6109/src/Microsoft.NET.Sdk.Functions.MSBuild/Microsoft.NET.Sdk.Functions.MSBuild.csproj 6 | // Please make any changes upstream first. 7 | 8 | namespace Microsoft.NET.Sdk.Functions.MSBuild.Tasks 9 | { 10 | public enum DeployStatus 11 | { 12 | Unknown = -1, 13 | Pending = 0, 14 | Building = 1, 15 | Deploying = 2, 16 | Failed = 3, 17 | Success = 4, 18 | Conflict = 5, 19 | PartialSuccess = 6 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /sdk/Sdk/WorkerNamingPolicy.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Text.Json; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Sdk 7 | { 8 | internal class FunctionsJsonNamingPolicy : JsonNamingPolicy 9 | { 10 | public override string ConvertName(string name) 11 | { 12 | // We need to camelCase everything but this one property or the host won't honor it. 13 | if (string.Equals("IsCodeless", name, System.StringComparison.OrdinalIgnoreCase)) 14 | { 15 | return "IsCodeless"; 16 | } 17 | 18 | return CamelCase.ConvertName(name); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /sdk/Sdk/worker.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": { 3 | "language": "dotnet-isolated", 4 | "extensions": [ ".dll" ], 5 | "defaultExecutablePath": "$functionExe$", 6 | "defaultWorkerPath": "$functionWorker$", 7 | "workerIndexing": "$enableWorkerIndexing$", 8 | "canUsePlaceholder": true 9 | } 10 | } -------------------------------------------------------------------------------- /sdk/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | 6 | 7 | ### Microsoft.Azure.Functions.Worker.Sdk 2.0.4 8 | 9 | - Address issue with `dotnet publish --no-build` producing an error. (#3068) 10 | 11 | ### Microsoft.Azure.Functions.Worker.Sdk.Generators 12 | 13 | - 14 | -------------------------------------------------------------------------------- /src/DotNetWorker.ApplicationInsights/Initializers/AppServiceOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Azure.Functions.Worker.ApplicationInsights.Initializers; 2 | 3 | internal class AppServiceOptions 4 | { 5 | public string? AzureWebsiteName { get; set; } 6 | 7 | public string? AzureWebsiteSlotName { get; set; } 8 | 9 | public string? AzureWebsiteCloudRoleName { get; set; } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /src/DotNetWorker.ApplicationInsights/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Azure.Functions.Worker.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001005148be37ac1d9f58bd40a2e472c9d380d635b6048278f7d47480b08c928858f0f7fe17a6e4ce98da0e7a7f0b8c308aecd9e9b02d7e9680a5b5b75ac7773cec096fbbc64aebd429e77cb5f89a569a79b28e9c76426783f624b6b70327eb37341eb498a2c3918af97c4860db6cdca4732787150841e395a29cfacb959c1fd971c1")] 7 | -------------------------------------------------------------------------------- /src/DotNetWorker.ApplicationInsights/TraceConstants.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Azure.Functions.Worker.ApplicationInsights 2 | { 3 | internal class TraceConstants 4 | { 5 | public const string FunctionsActivitySource = "Microsoft.Azure.Functions.Worker"; 6 | 7 | public const string AttributeExceptionEventName = "exception"; 8 | public const string AttributeExceptionType = "exception.type"; 9 | public const string AttributeExceptionMessage = "exception.message"; 10 | public const string AttributeExceptionStacktrace = "exception.stacktrace"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/DotNetWorker.ApplicationInsights/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | ### Microsoft.Azure.Functions.Worker.ApplicationInsights 4 | 5 | - 6 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/CollectionModelBindingData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Core 5 | { 6 | /// 7 | /// A representation of Collection of Microsoft.Azure.WebJobs.ParameterBindingData 8 | /// 9 | public abstract class CollectionModelBindingData 10 | { 11 | /// 12 | /// Gets a ModelBindingData array 13 | /// 14 | public abstract ModelBindingData[] ModelBindingData { get; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Context/BindingContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | 6 | namespace Microsoft.Azure.Functions.Worker 7 | { 8 | /// 9 | /// Exposes binding infomation for a given function context. 10 | /// 11 | public abstract class BindingContext 12 | { 13 | /// 14 | /// Gets the binding data information for the current context. 15 | /// This contains all the trigger defined metadata. 16 | /// 17 | public abstract IReadOnlyDictionary BindingData { get; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Context/DefaultTraceContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker 5 | { 6 | internal sealed class DefaultTraceContext : TraceContext 7 | { 8 | public DefaultTraceContext(string traceParent, string traceState) 9 | { 10 | TraceParent = traceParent; 11 | TraceState = traceState; 12 | } 13 | 14 | public override string TraceParent { get; } 15 | 16 | public override string TraceState { get; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Context/Features/DefaultInvocationFeaturesFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | 6 | namespace Microsoft.Azure.Functions.Worker 7 | { 8 | internal class DefaultInvocationFeaturesFactory : IInvocationFeaturesFactory 9 | { 10 | private readonly IEnumerable _providers; 11 | 12 | public DefaultInvocationFeaturesFactory(IEnumerable providers) 13 | { 14 | _providers = providers ?? throw new System.ArgumentNullException(nameof(providers)); 15 | } 16 | 17 | public IInvocationFeatures Create() 18 | { 19 | return new InvocationFeatures(_providers); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Context/Features/IExecutionRetryFeature.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Azure.Functions.Worker 7 | { 8 | internal interface IExecutionRetryFeature 9 | { 10 | RetryContext Context { get; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Context/Features/IFunctionBindingsFeature.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | using Microsoft.Azure.Functions.Worker.OutputBindings; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Context.Features 8 | { 9 | internal interface IFunctionBindingsFeature 10 | { 11 | public IReadOnlyDictionary TriggerMetadata { get; } 12 | 13 | public IReadOnlyDictionary InputData { get; } 14 | 15 | public IDictionary OutputBindingData { get; } 16 | 17 | public OutputBindingsInfo OutputBindingsInfo { get; } 18 | 19 | public object? InvocationResult { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Context/Features/IFunctionInputBindingFeature.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Threading.Tasks; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Context.Features 7 | { 8 | /// 9 | /// Provides a mechanism to bind function inputs. 10 | /// 11 | public interface IFunctionInputBindingFeature 12 | { 13 | /// 14 | /// Asynchronously binds the function inputs. 15 | /// 16 | /// The instance. 17 | /// A that will contain an instance of the . 18 | ValueTask BindFunctionInputAsync(FunctionContext context); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Context/Features/IInputConversionFeatureProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Context.Features 7 | { 8 | /// 9 | /// Provider abstraction to get IInputConversionFeature instance. 10 | /// 11 | internal interface IInputConversionFeatureProvider 12 | { 13 | /// 14 | /// Tries to create an instance of IInputConversionFeature feature. 15 | /// 16 | /// The feature type. 17 | /// The IInputConversionFeature instance created or null. 18 | /// True if the creation was successful, else False. 19 | bool TryCreate(Type type, out IInputConversionFeature? feature); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Context/Features/IInvocationFeatureProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Azure.Functions.Worker 7 | { 8 | internal interface IInvocationFeatureProvider 9 | { 10 | bool TryCreate(Type type, out object? feature); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Context/Features/IInvocationFeaturesFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | 7 | namespace Microsoft.Azure.Functions.Worker 8 | { 9 | internal interface IInvocationFeaturesFactory 10 | { 11 | IInvocationFeatures Create(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Context/FunctionInvocation.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker 5 | { 6 | /// 7 | /// A representation of a single function invocation. 8 | /// 9 | public abstract class FunctionInvocation 10 | { 11 | /// 12 | /// The invocation id. 13 | /// 14 | public abstract string Id { get; } 15 | 16 | /// 17 | /// The function id, typically assigned by the host. 18 | /// 19 | public abstract string FunctionId { get; } 20 | 21 | /// 22 | /// Gets the distributed tracing context. 23 | /// 24 | public abstract TraceContext TraceContext { get; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Context/RetryContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker 5 | { 6 | /// 7 | /// Exposes information about retry activity for the event that triggered 8 | /// the current function invocation. 9 | /// 10 | public abstract class RetryContext 11 | { 12 | /// 13 | /// The the retry count for the current event. 14 | /// 15 | public abstract int RetryCount { get; } 16 | 17 | /// 18 | /// The maximum number of retry attempts that will be made by the trigger/host 19 | /// before the event is considered undeliverable. 20 | /// 21 | public abstract int MaxRetryCount { get; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Context/TraceContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker 5 | { 6 | /// 7 | /// The trace context for the current invocation. 8 | /// 9 | public abstract class TraceContext 10 | { 11 | /// 12 | /// Gets the identity of the incoming invocation in a tracing system. 13 | /// 14 | public abstract string TraceParent { get; } 15 | 16 | /// 17 | /// Gets the state data. 18 | /// 19 | public abstract string TraceState { get; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Converters/CancellationTokenConverter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Converters 8 | { 9 | internal class CancellationTokenConverter : IInputConverter 10 | { 11 | public ValueTask ConvertAsync(ConverterContext context) 12 | { 13 | if (context.TargetType == typeof(CancellationToken) || context.TargetType == typeof(CancellationToken?)) 14 | { 15 | return new ValueTask(ConversionResult.Success(context.FunctionContext.CancellationToken)); 16 | } 17 | 18 | return new ValueTask(ConversionResult.Unhandled()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Converters/Converter/ConversionStatus.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Converters 5 | { 6 | /// 7 | /// Conversion status enumeration. 8 | /// 9 | public enum ConversionStatus 10 | { 11 | /// 12 | /// Converter did not act on the input to execute a conversion operation. 13 | /// 14 | Unhandled, 15 | 16 | /// 17 | /// Conversion operation was successful. 18 | /// 19 | Succeeded, 20 | 21 | /// 22 | /// Conversion operation failed. 23 | /// 24 | Failed 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Converters/Converter/IInputConverter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Threading.Tasks; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Converters 7 | { 8 | /// 9 | /// Provides a mechanism for input conversion. 10 | /// 11 | public interface IInputConverter 12 | { 13 | /// 14 | /// Executes an input conversion operation using the converter context provided. 15 | /// 16 | /// The converter context instance. 17 | /// An instance of representing the result of the convert operation. 18 | ValueTask ConvertAsync(ConverterContext context); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Converters/Converter/PropertyBagKeys.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Converters 5 | { 6 | internal static class PropertyBagKeys 7 | { 8 | internal const string ConverterType = "converterType"; 9 | internal const string BindingAttribute = "bindingAttribute"; 10 | internal const string ConverterFallbackBehavior = "converterFallbackBehavior"; 11 | internal const string BindingAttributeSupportedConverters = "bindingAttributeSupportedConverters"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Converters/FunctionContextConverter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Converters 8 | { 9 | internal class FunctionContextConverter : IInputConverter 10 | { 11 | public ValueTask ConvertAsync(ConverterContext context) 12 | { 13 | // Special handling for the context. 14 | if (context.TargetType == typeof(FunctionContext)) 15 | { 16 | return new ValueTask(ConversionResult.Success(context.FunctionContext)); 17 | } 18 | 19 | return new ValueTask(ConversionResult.Unhandled()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Definition/BindingDirection.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker 5 | { 6 | /// 7 | /// Specifies the direction of the binding. 8 | /// 9 | public enum BindingDirection 10 | { 11 | /// 12 | /// Identifies an input binding; a binding that provides data to the function. 13 | /// 14 | In, 15 | /// 16 | /// Identifies an output binding; a binding that receives data from the function. 17 | /// 18 | Out 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Definition/BindingMetadata.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker 5 | { 6 | /// 7 | /// Contains metadata about an Azure Functions binding. 8 | /// 9 | public abstract class BindingMetadata 10 | { 11 | /// 12 | /// Gets the name of the binding metadata entry. 13 | /// 14 | public abstract string Name { get; } 15 | 16 | /// 17 | /// Gets the type of the binding. For example, "httpTrigger". 18 | /// 19 | public abstract string Type { get; } 20 | 21 | /// 22 | /// Gets the binding direction. 23 | /// 24 | public abstract BindingDirection Direction { get; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Diagnostics/IWorkerDiagnostics.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Diagnostics 5 | { 6 | /// 7 | /// Represents an interface for sending logs directly to the Functions host. 8 | /// 9 | internal interface IWorkerDiagnostics 10 | { 11 | void OnApplicationCreated(WorkerInformation workerInfo); 12 | 13 | void OnFunctionLoaded(FunctionDefinition definition); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Diagnostics/OpenTelemetrySchemaVersion.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Diagnostics 5 | { 6 | internal enum OpenTelemetrySchemaVersion 7 | { 8 | v1_17_0 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/ExtensionStartup/WorkerExtensionStartup.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Core 5 | { 6 | /// 7 | /// The base type for worker extension startup implementations. 8 | /// 9 | public abstract class WorkerExtensionStartup 10 | { 11 | /// 12 | /// Configures the function worker application builder option. 13 | /// Called once during app startup. 14 | /// 15 | /// The IFunctionsWorkerApplicationBuilder instance. 16 | public abstract void Configure(IFunctionsWorkerApplicationBuilder applicationBuilder); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/FunctionMetadata/IFunctionMetadataProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Immutable; 5 | using System.Threading.Tasks; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Core.FunctionMetadata 8 | { 9 | /// 10 | /// Returns function metadata information from an app. 11 | /// 12 | public interface IFunctionMetadataProvider 13 | { 14 | 15 | /// 16 | /// Gets all function metadata that this provider knows about asynchronously 17 | /// 18 | /// A Task with IEnumerable of FunctionMetadata 19 | Task> GetFunctionMetadataAsync(string directory); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/FunctionMetadata/RetryStrategy.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Core.FunctionMetadata 5 | { 6 | /// 7 | /// The retry strategy used in the case of function invocation failure. 8 | /// 9 | public enum RetryStrategy 10 | { 11 | /// 12 | /// Exponential backoff strategy. The first retry waits for the minimum delay. On subsequent retries, time is added exponentially to the initial duration for each retry, until the maximum delay is reached. 13 | /// 14 | ExponentialBackoff, 15 | /// 16 | /// A fixed delay strategy.A specified amount of time is allowed to elapse between each retry. 17 | /// 18 | FixedDelay 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/FunctionsDebugger.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Microsoft.Azure.Functions.Worker 11 | { 12 | /// 13 | /// Isolated debugging utility. 14 | /// 15 | public class FunctionsDebugger 16 | { 17 | /// 18 | /// Enables Isolated debugging 19 | /// 20 | public static void Enable() 21 | { 22 | StartupHook.Initialize(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Http/IHttpRequestDataFeature.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Threading.Tasks; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Http 7 | { 8 | /// 9 | /// A representation of the HTTP request sent by the host 10 | /// 11 | public interface IHttpRequestDataFeature 12 | { 13 | /// 14 | /// Gets the instance if the FunctionContext contains an invocation for an HTTP trigger. 15 | /// 16 | /// The FunctionContext instance. 17 | /// HttpRequestData instance if the invocation is http, else null 18 | ValueTask GetHttpRequestDataAsync(FunctionContext context); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/IFunctionsApplication.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | 7 | namespace Microsoft.Azure.Functions.Worker 8 | { 9 | internal interface IFunctionsApplication 10 | { 11 | void LoadFunction(FunctionDefinition definition); 12 | 13 | Task InvokeFunctionAsync(FunctionContext context); 14 | 15 | FunctionContext CreateContext(IInvocationFeatures features, CancellationToken token = default); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/IWorker.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | 7 | namespace Microsoft.Azure.Functions.Worker 8 | { 9 | internal interface IWorker 10 | { 11 | Task StartAsync(CancellationToken token); 12 | 13 | Task StopAsync(CancellationToken token); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/InitializationResponse.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | 6 | namespace Microsoft.Azure.Functions.Worker 7 | { 8 | internal class InitializationResponse 9 | { 10 | public IDictionary Capabilities = new Dictionary(); 11 | 12 | public string? WorkerVersion { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Invocation/DefaultFunctionActivator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.Extensions.DependencyInjection; 6 | 7 | namespace Microsoft.Azure.Functions.Worker 8 | { 9 | internal class DefaultFunctionActivator : IFunctionActivator 10 | { 11 | public object? CreateInstance(Type instanceType, FunctionContext context) 12 | { 13 | if (instanceType is null) 14 | { 15 | throw new ArgumentNullException(nameof(instanceType)); 16 | } 17 | 18 | if (context is null) 19 | { 20 | throw new ArgumentNullException(nameof(context)); 21 | } 22 | 23 | return ActivatorUtilities.CreateInstance(context.InstanceServices, instanceType, Array.Empty()); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Invocation/IFunctionExecutor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Threading.Tasks; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Invocation 7 | { 8 | /// 9 | /// Provides a mechanism to execute function code. 10 | /// 11 | public interface IFunctionExecutor 12 | { 13 | /// 14 | /// Asynchronously executes the function code. 15 | /// 16 | /// The instance. 17 | /// A representing the completion of the operation. 18 | ValueTask ExecuteAsync(FunctionContext context); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Invocation/IFunctionInvoker.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | #nullable disable 5 | 6 | using System; 7 | using System.Threading.Tasks; 8 | 9 | namespace Microsoft.Azure.Functions.Worker.Invocation 10 | { 11 | internal interface IFunctionInvoker 12 | { 13 | object CreateInstance(FunctionContext context); 14 | 15 | Task InvokeAsync(object instance, object[] arguments); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Invocation/IFunctionInvokerFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Invocation 5 | { 6 | internal interface IFunctionInvokerFactory 7 | { 8 | IFunctionInvoker Create(FunctionDefinition definition); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Invocation/IMethodInvoker.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | #nullable disable 5 | 6 | using System.Threading.Tasks; 7 | 8 | namespace Microsoft.Azure.Functions.Worker.Invocation 9 | { 10 | internal interface IMethodInvoker 11 | { 12 | // The cancellation token, if any, is provided along with the other arguments. 13 | Task InvokeAsync(TInstance instance, object[] arguments); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Invocation/IMethodInvokerFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Reflection; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Invocation 7 | { 8 | internal interface IMethodInvokerFactory 9 | { 10 | IMethodInvoker Create(MethodInfo method); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Invocation/IMethodLocator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Reflection; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Invocation 7 | { 8 | internal interface IMethodInfoLocator 9 | { 10 | MethodInfo GetMethod(string assemblyName, string entryPoint); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Invocation/InvocationResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker 5 | { 6 | /// 7 | /// A type wrapping the result of a function invocation. 8 | /// 9 | public abstract class InvocationResult : InvocationResult 10 | { 11 | } 12 | 13 | /// 14 | /// A type wrapping the result of a function invocation. 15 | /// 16 | /// The type of invocation result value. 17 | public abstract class InvocationResult 18 | { 19 | /// 20 | /// Gets or sets the invocation result value. 21 | /// 22 | public abstract T? Value { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Invocation/VoidMethodInvoker.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | #nullable disable 5 | 6 | using System; 7 | using System.Threading.Tasks; 8 | 9 | namespace Microsoft.Azure.Functions.Worker.Invocation 10 | { 11 | internal class VoidMethodInvoker : IMethodInvoker 12 | { 13 | private readonly Action _lambda; 14 | 15 | public VoidMethodInvoker(Action lambda) 16 | { 17 | _lambda = lambda; 18 | } 19 | 20 | public Task InvokeAsync(TReflected instance, object[] arguments) 21 | { 22 | _lambda.Invoke(instance, arguments); 23 | return Task.FromResult(default(TReturnValue)); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Invocation/VoidTaskMethodInvoker.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | #nullable disable 5 | 6 | using System; 7 | using System.Threading.Tasks; 8 | 9 | namespace Microsoft.Azure.Functions.Worker.Invocation 10 | { 11 | internal class VoidTaskMethodInvoker : IMethodInvoker 12 | { 13 | private readonly Func _lambda; 14 | 15 | public VoidTaskMethodInvoker(Func lambda) 16 | { 17 | _lambda = lambda; 18 | } 19 | 20 | public async Task InvokeAsync(TReflected instance, object[] arguments) 21 | { 22 | await _lambda.Invoke(instance, arguments); 23 | return default; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Logging/IUserMetricWriter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | using Microsoft.Extensions.Logging; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Logging 8 | { 9 | /// 10 | /// An abstraction for writing user metrics. 11 | /// 12 | internal interface IUserMetricWriter 13 | { 14 | /// 15 | /// Writes user metrics. 16 | /// 17 | /// The provider of scope data. 18 | /// Additional properties. 19 | void WriteUserMetric(IExternalScopeProvider scopeProvider, IDictionary state); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/NullFunctionActivator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Azure.Functions.Worker 7 | { 8 | internal class NullFunctionActivator : IFunctionActivator 9 | { 10 | private NullFunctionActivator() 11 | { 12 | } 13 | 14 | public static NullFunctionActivator Instance { get; } = new NullFunctionActivator(); 15 | 16 | public object? CreateInstance(Type instanceType, FunctionContext context) 17 | { 18 | return null; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/OutputBindings/EmptyOutputBindingsInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Microsoft.Azure.Functions.Worker.OutputBindings 11 | { 12 | internal class EmptyOutputBindingsInfo : OutputBindingsInfo 13 | { 14 | private static readonly Lazy _instance = new(() => new EmptyOutputBindingsInfo()); 15 | 16 | public static EmptyOutputBindingsInfo Instance => _instance.Value; 17 | 18 | private EmptyOutputBindingsInfo() 19 | { 20 | } 21 | 22 | public override void BindOutputInContext(FunctionContext context) 23 | { 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/OutputBindings/IOutputBindingsInfoProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.OutputBindings 5 | { 6 | internal interface IOutputBindingsInfoProvider 7 | { 8 | public OutputBindingsInfo GetBindingsInfo(FunctionDefinition definition); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/OutputBindings/InputBindingData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker 5 | { 6 | /// 7 | /// A type representing the input binding data. 8 | /// 9 | /// The type of binding data value. 10 | public abstract class InputBindingData 11 | { 12 | /// 13 | /// Gets the binding metadata part of this input binding data instance. 14 | /// 15 | public abstract BindingMetadata BindingMetadata { get; } 16 | 17 | /// 18 | /// Gets or sets the value of the binding result. 19 | /// 20 | public abstract T? Value { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/OutputBindings/MethodReturnOutputBindingsInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Microsoft.Azure.Functions.Worker.OutputBindings 11 | { 12 | internal class MethodReturnOutputBindingsInfo : OutputBindingsInfo 13 | { 14 | public override void BindOutputInContext(FunctionContext context) 15 | { 16 | // For output bindings that are defined by method returns, 17 | // the invocation result provides the value. The $return binding name 18 | // is sufficient to have it identified that the output binding value 19 | // comes from function invocation result. 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/OutputBindings/OutputBindingsConstants.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Microsoft.Azure.Functions.Worker.OutputBindings 11 | { 12 | internal static class OutputBindingsConstants 13 | { 14 | public const string ReturnBindingName = "$return"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/OutputBindings/OutputBindingsInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.OutputBindings 5 | { 6 | /// 7 | /// Encapsulates the information about all output bindings in a Function 8 | /// 9 | internal abstract class OutputBindingsInfo 10 | { 11 | /// 12 | /// Binds output from a function to the output bindings 13 | /// 14 | /// The Function context to bind the data to. 15 | public abstract void BindOutputInContext(FunctionContext context); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Pipeline/FunctionExecutionDelegate.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Threading.Tasks; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Middleware 7 | { 8 | /// 9 | /// A delegate that can process an event. 10 | /// 11 | /// The context for the event invocation. 12 | /// A that represents the invocation process. 13 | public delegate Task FunctionExecutionDelegate(FunctionContext context); 14 | } 15 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Pipeline/FunctionExecutionMiddleware.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Threading.Tasks; 5 | using Microsoft.Azure.Functions.Worker.Invocation; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Pipeline 8 | { 9 | internal class FunctionExecutionMiddleware 10 | { 11 | private readonly IFunctionExecutor _functionExecutor; 12 | 13 | public FunctionExecutionMiddleware(IFunctionExecutor functionExecutor) 14 | { 15 | _functionExecutor = functionExecutor; 16 | } 17 | 18 | public Task Invoke(FunctionContext context) 19 | { 20 | return _functionExecutor.ExecuteAsync(context).AsTask(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Pipeline/IFunctionContextFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Threading; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Pipeline 7 | { 8 | internal interface IFunctionContextFactory 9 | { 10 | FunctionContext Create(IInvocationFeatures features, CancellationToken token); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Pipeline/IInvocationPipelineBuilder.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.Azure.Functions.Worker.Middleware; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Pipeline 8 | { 9 | internal interface IInvocationPipelineBuilder 10 | { 11 | IInvocationPipelineBuilder Use(Func middleware); 12 | 13 | FunctionExecutionDelegate Build(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/DotNetWorker.Core/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Microsoft.Azure.Functions.Worker": { 4 | "commandName": "Project", 5 | "commandLineArgs": "--host 127.0.0.1 --port 1710 --workerId 5b258b67-3440-4b89-bd75-e813bedb059c --requestId 4a28f828-4f90-4efa-bd5f-a08714ed28e3 --grpcMaxMessageLength 134217728" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /src/DotNetWorker.Grpc/Definition/GrpcBindingMetadata.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Azure.Functions.Worker.Grpc.Messages; 5 | 6 | namespace Microsoft.Azure.Functions.Worker 7 | { 8 | internal class GrpcBindingMetadata : BindingMetadata 9 | { 10 | public GrpcBindingMetadata(string name, BindingInfo bindingInfo) 11 | { 12 | Name = name; 13 | Type = bindingInfo.Type; 14 | Direction = bindingInfo.Direction == BindingInfo.Types.Direction.In ? BindingDirection.In : BindingDirection.Out; 15 | } 16 | 17 | public override string Name { get; } 18 | 19 | public override string Type { get; } 20 | 21 | public override BindingDirection Direction { get; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DotNetWorker.Grpc/FunctionMetadata/RpcFunctionMetadata.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | using Microsoft.Azure.Functions.Worker.Core.FunctionMetadata; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Grpc.Messages 8 | { 9 | internal sealed partial class RpcFunctionMetadata : IFunctionMetadata 10 | { 11 | IList IFunctionMetadata.RawBindings => RawBindings; 12 | 13 | IRetryOptions IFunctionMetadata.Retry => RetryOptions; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/DotNetWorker.Grpc/GrpcCollectionModelBindingData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Linq; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Grpc.Messages 8 | { 9 | internal partial class GrpcCollectionModelBindingData : Microsoft.Azure.Functions.Worker.Core.CollectionModelBindingData 10 | { 11 | public GrpcCollectionModelBindingData(CollectionModelBindingData collectionModelBindingData) 12 | { 13 | ModelBindingData = collectionModelBindingData.ModelBindingData 14 | .Select(p => new GrpcModelBindingData(p)).ToArray(); 15 | } 16 | 17 | public override Core.ModelBindingData[] ModelBindingData { get; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DotNetWorker.Grpc/GrpcHostChannel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Threading.Channels; 6 | using Microsoft.Azure.Functions.Worker.Grpc.Messages; 7 | 8 | namespace Microsoft.Azure.Functions.Worker 9 | { 10 | internal class GrpcHostChannel 11 | { 12 | public GrpcHostChannel(Channel channel) 13 | { 14 | Channel = channel ?? throw new ArgumentNullException(nameof(channel)); 15 | } 16 | 17 | public Channel Channel { get; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DotNetWorker.Grpc/GrpcRetryContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using RetryContextMessage = Microsoft.Azure.Functions.Worker.Grpc.Messages.RetryContext; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Grpc 7 | { 8 | internal sealed class GrpcRetryContext : RetryContext 9 | { 10 | private readonly RetryContextMessage _retryContext; 11 | 12 | public GrpcRetryContext(RetryContextMessage retryContext) 13 | { 14 | _retryContext = retryContext; 15 | } 16 | 17 | public override int RetryCount => _retryContext.RetryCount; 18 | 19 | public override int MaxRetryCount => _retryContext.MaxRetryCount; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DotNetWorker.Grpc/GrpcStartupOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | 5 | using System; 6 | 7 | namespace Microsoft.Azure.Functions.Worker 8 | { 9 | internal class GrpcWorkerStartupOptions 10 | { 11 | public Uri? HostEndpoint { get; set; } 12 | 13 | public string? WorkerId { get; set; } 14 | 15 | public string? RequestId { get; set; } 16 | 17 | public int GrpcMaxMessageLength { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DotNetWorker.Grpc/Hosting/GrpcWorkerApplicationBuilderExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Azure.Functions.Worker; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection 7 | { 8 | internal static class GrpcWorkerApplicationBuilderExtensions 9 | { 10 | public static IFunctionsWorkerApplicationBuilder UseGrpc(this IFunctionsWorkerApplicationBuilder builder) 11 | { 12 | builder.Services.AddGrpc(); 13 | 14 | return builder; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/DotNetWorker.Grpc/IGrpcRequestHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Azure.Functions.Worker.Grpc.Messages; 5 | using System.Threading.Tasks; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Grpc 8 | { 9 | internal interface IMessageProcessor 10 | { 11 | Task ProcessMessageAsync(StreamingMessage request); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DotNetWorker.Grpc/IWorkerClient.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | using Microsoft.Azure.Functions.Worker.Grpc.Messages; 7 | 8 | namespace Microsoft.Azure.Functions.Worker.Grpc 9 | { 10 | internal interface IWorkerClient 11 | { 12 | Task StartAsync(CancellationToken cancellationToken); 13 | 14 | ValueTask SendMessageAsync(StreamingMessage message); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DotNetWorker.Grpc/IWorkerClientFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Grpc 5 | { 6 | internal interface IWorkerClientFactory 7 | { 8 | IWorkerClient CreateClient(IMessageProcessor messageProcessor); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DotNetWorker.Grpc/NativeHostIntegration/NativeWorkerClientFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Grpc.NativeHostIntegration 5 | { 6 | internal class NativeWorkerClientFactory : IWorkerClientFactory 7 | { 8 | private readonly GrpcHostChannel _hostChannel; 9 | 10 | public NativeWorkerClientFactory(GrpcHostChannel hostChannel) 11 | { 12 | _hostChannel = hostChannel; 13 | } 14 | 15 | public IWorkerClient CreateClient(IMessageProcessor messageProcessor) 16 | { 17 | return new NativeWorkerClient(messageProcessor, _hostChannel); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/DotNetWorker.Grpc/StatusResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Grpc.Messages 7 | { 8 | internal sealed partial class StatusResult 9 | { 10 | private static StatusResult? _successInstance; 11 | 12 | public StatusResult(Types.Status status) 13 | { 14 | Status = status; 15 | } 16 | 17 | public static StatusResult Success => _successInstance ??= new StatusResult(Types.Status.Success); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DotNetWorker.OpenTelemetry/OpenTelemetryConstants.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.OpenTelemetry 5 | { 6 | internal class OpenTelemetryConstants 7 | { 8 | internal const string AzureCloudProviderValue = "azure"; 9 | internal const string AzurePlatformValue = "azure_functions"; 10 | internal const string SDKPrefix = "dotnetiso"; 11 | internal const string SiteNameEnvVar = "WEBSITE_SITE_NAME"; 12 | internal const string RegionNameEnvVar = "REGION_NAME"; 13 | internal const string ResourceGroupEnvVar = "WEBSITE_RESOURCE_GROUP"; 14 | internal const string OwnerNameEnvVar = "WEBSITE_OWNER_NAME"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DotNetWorker.OpenTelemetry/ResourceSemanticConventions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Microsoft.Azure.Functions.Worker.OpenTelemetry 6 | { 7 | internal static class ResourceSemanticConventions 8 | { 9 | // Service 10 | internal const string ServiceName = "service.name"; 11 | internal const string ServiceVersion = "service.version"; 12 | 13 | // Cloud 14 | internal const string CloudProvider = "cloud.provider"; 15 | internal const string CloudPlatform = "cloud.platform"; 16 | internal const string CloudRegion = "cloud.region"; 17 | internal const string CloudResourceId = "cloud.resource.id"; 18 | 19 | // Process 20 | internal const string ProcessId = "process.pid"; 21 | 22 | // AI 23 | internal const string AISDKPrefix = "ai.sdk.prefix"; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/DotNetWorker.OpenTelemetry/release_notes.md: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | ### Microsoft.Azure.Functions.Worker.OpenTelemetry 1.0.0 (Preview 2) 4 | 5 | - `UseFunctionsWorkerDefaults` signature now uses `IOpenTelemetryBuilder` (from `OpenTelemetryBuilder`) (#2839) -------------------------------------------------------------------------------- /src/DotNetWorker/Builder/FunctionsApplication.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Builder; 5 | 6 | /// 7 | /// The application used to configure an Azure Functions worker. 8 | /// 9 | public class FunctionsApplication 10 | { 11 | /// 12 | /// Initializes a new instance of the class with preconfigured defaults. 13 | /// 14 | /// The command line arguments. 15 | /// The . 16 | public static FunctionsApplicationBuilder CreateBuilder(string[] args) => new(args); 17 | } 18 | -------------------------------------------------------------------------------- /src/DotNetWorker/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "DotNetWorker": { 4 | "commandName": "Project", 5 | "launchBrowser": true, 6 | "environmentVariables": { 7 | "ASPNETCORE_ENVIRONMENT": "Development" 8 | }, 9 | "applicationUrl": "https://localhost:59964;http://localhost:59965" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /test/DependentAssemblyWithFunctions.NetStandard/DependentAssemblyWithFunctions.NetStandard.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/DependentAssemblyWithFunctions/DependencyFunction.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information.; 3 | 4 | using Microsoft.Azure.Functions.Worker; 5 | using Microsoft.Azure.Functions.Worker.Http; 6 | 7 | namespace DependentAssemblyWithFunctions 8 | { 9 | public class DependencyFunction 10 | { 11 | [Function("DependencyFunc")] 12 | public HttpResponseData Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestData req) 13 | { 14 | throw new NotImplementedException(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/DependentAssemblyWithFunctions/DependentAssemblyWithFunctions.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/DependentAssemblyWithFunctions/NestedNamespaceFunction.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information.; 3 | 4 | using Microsoft.Azure.Functions.Worker; 5 | using Microsoft.Azure.Functions.Worker.Http; 6 | 7 | namespace MyCompany.MyProduct.MyApp 8 | { 9 | public class HttpFunctions 10 | { 11 | [Function("NestedNamespaceFunc1")] 12 | public HttpResponseData Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestData req) 13 | { 14 | throw new NotImplementedException(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/DependentAssemblyWithFunctions/NestedTypesFunction.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information.; 3 | 4 | using Microsoft.Azure.Functions.Worker; 5 | using Microsoft.Azure.Functions.Worker.Http; 6 | 7 | namespace MyCompany.MyProduct.MyApp 8 | { 9 | public sealed class Foo 10 | { 11 | public sealed class Bar 12 | { 13 | [Function("NestedTypeFunc")] 14 | public HttpResponseData Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestData req) 15 | { 16 | throw new NotImplementedException(); 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/DependentAssemblyWithFunctions/StaticFunction.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Functions.Worker; 2 | using Microsoft.Azure.Functions.Worker.Http; 3 | 4 | namespace DependentAssemblyWithFunctions 5 | { 6 | public static class StaticFunction 7 | { 8 | [Function(nameof(StaticFunction))] 9 | public static HttpResponseData Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequestData req, 10 | FunctionContext executionContext) 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/DotNetWorkerTests/ApplicationInsights/TestTelemetryChannel.cs: -------------------------------------------------------------------------------- 1 | //// Copyright (c) .NET Foundation. All rights reserved. 2 | //// Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Concurrent; 5 | using Microsoft.ApplicationInsights.Channel; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Tests.ApplicationInsights; 8 | 9 | internal class TestTelemetryChannel : ITelemetryChannel 10 | { 11 | public ConcurrentBag Telemetries { get; private set; } = new ConcurrentBag(); 12 | 13 | public bool? DeveloperMode { get; set; } 14 | 15 | public string EndpointAddress { get; set; } 16 | 17 | public void Dispose() 18 | { 19 | } 20 | 21 | public void Flush() 22 | { 23 | } 24 | 25 | public void Send(ITelemetry item) 26 | { 27 | Telemetries.Add(item); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/DotNetWorkerTests/Book.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Tests 5 | { 6 | public class Book 7 | { 8 | public string Id { get; set; } 9 | 10 | public string Title { get; set; } 11 | 12 | public string Author { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/DotNetWorkerTests/Executors/NullInstanceFactoryTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | // Copyright (c) .NET Foundation. All rights reserved. 5 | // Licensed under the MIT License. See License.txt in the project root for license information. 6 | 7 | using Xunit; 8 | 9 | namespace Microsoft.Azure.Functions.Worker.Tests 10 | { 11 | public class NullInstanceFactoryTests 12 | { 13 | [Fact] 14 | public void Create_ReturnsNull() 15 | { 16 | // Arrange 17 | IFunctionActivator product = NullFunctionActivator.Instance; 18 | 19 | // Act 20 | object instance = product.CreateInstance(typeof(object), new TestFunctionContext()); 21 | 22 | // Assert 23 | Assert.Null(instance); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/DotNetWorkerTests/GrpcServiceCollectionExtensionsTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Extensions.DependencyInjection; 5 | using Xunit; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.Tests; 8 | 9 | public class GrpcServiceCollectionExtensionsTests 10 | { 11 | [Fact] 12 | public void AddGrpc_RegistersServicesIdempotently() 13 | { 14 | ServiceCollectionExtensionsTestUtility.AssertServiceRegistrationIdempotency(services => 15 | { 16 | services.AddGrpc(); 17 | services.AddGrpc(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/E2ETests/E2EApps/E2EApp/Blob/Book.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.E2EApp.Blob 5 | { 6 | public class Book 7 | { 8 | public string Id { get; set; } 9 | public string Name { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /test/E2ETests/E2EApps/E2EApp/EventHubs/TestData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.Json.Serialization; 6 | using System.Threading.Tasks; 7 | 8 | namespace Microsoft.Azure.Functions.Worker.E2EApp.EventHubs 9 | { 10 | public class TestData 11 | { 12 | public string Name { get; set; } 13 | 14 | public string TimeProperty { get; set; } 15 | 16 | public override string ToString() 17 | { 18 | return $"Name: {Name}, TimeProperty: {TimeProperty}"; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/E2ETests/E2EApps/E2EApp/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/E2ETests/E2EApps/E2EApp/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Threading.Tasks; 5 | using Microsoft.Extensions.Hosting; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.E2EApps.CosmosApp 8 | { 9 | class Program 10 | { 11 | static async Task Main(string[] args) 12 | { 13 | var host = new HostBuilder() 14 | .ConfigureFunctionsWorkerDefaults() 15 | .Build(); 16 | 17 | await host.RunAsync(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/E2ETests/E2EApps/E2EApp/Timer/TimerTestFunctions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Text.Json; 5 | using Microsoft.Extensions.Logging; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.E2EApp.Queue 8 | { 9 | public class TimerTestFunctions 10 | { 11 | private readonly ILogger _logger; 12 | 13 | public TimerTestFunctions(ILogger logger) 14 | { 15 | _logger = logger; 16 | } 17 | 18 | [Function(nameof(TimerTrigger))] 19 | public void TimerTrigger([TimerTrigger("0 * * * * *", RunOnStartup = true)] TimerInfo timerInfo) 20 | { 21 | var info = JsonSerializer.Serialize(timerInfo); 22 | _logger.LogInformation($"TimerInfo: {info}"); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/E2ETests/E2EApps/E2EApp/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingExcludedTypes": "Request", 6 | "samplingSettings": { 7 | "isEnabled": true 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /test/E2ETests/E2EApps/E2EApp/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true", 5 | "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", 6 | "CosmosConnection": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", 7 | "CosmosDb": "ItemDb", 8 | "CosmosCollIn": "ItemCollectionIn", 9 | "CosmosCollOut": "ItemCollectionOut" 10 | } 11 | } -------------------------------------------------------------------------------- /test/E2ETests/E2EApps/E2EApp/proxies.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/proxies", 3 | "proxies": { 4 | "proxytest": { 5 | "matchCondition": { 6 | "route": "api/proxytest" 7 | }, 8 | "responseOverrides": { 9 | "response.body": "Proxy response" 10 | } 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /test/E2ETests/E2EApps/E2EAspNetCoreApp/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/E2ETests/E2EApps/E2EAspNetCoreApp/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Functions.Worker; 2 | using Microsoft.Extensions.Hosting; 3 | using Microsoft.Extensions.DependencyInjection; 4 | 5 | var host = new HostBuilder() 6 | .ConfigureFunctionsWebApplication() 7 | .Build(); 8 | 9 | host.Run(); 10 | -------------------------------------------------------------------------------- /test/E2ETests/E2EApps/E2EAspNetCoreApp/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "dni_net8_cancellation": { 4 | "commandName": "Project", 5 | "commandLineArgs": "--port 7097", 6 | "launchBrowser": false 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /test/E2ETests/E2EApps/E2EAspNetCoreApp/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | }, 9 | "enableLiveMetricsFilters": true 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /test/E2ETests/E2EApps/E2EAspNetCoreApp/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true", 5 | "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" 6 | } 7 | } -------------------------------------------------------------------------------- /test/E2ETests/E2ETests.slnf: -------------------------------------------------------------------------------- 1 | { 2 | "solution": { 3 | "path": "..\\..\\DotNetWorker.sln", 4 | "projects": [ 5 | "extensions\\Worker.Extensions.Abstractions\\Worker.Extensions.Abstractions.csproj", 6 | "extensions\\Worker.Extensions.CosmosDB\\Worker.Extensions.CosmosDB.csproj", 7 | "extensions\\Worker.Extensions.EventHubs\\Worker.Extensions.EventHubs.csproj", 8 | "extensions\\Worker.Extensions.Http\\Worker.Extensions.Http.csproj", 9 | "extensions\\Worker.Extensions.Storage\\Worker.Extensions.Storage.csproj", 10 | "extensions\\Worker.Extensions.Timer\\Worker.Extensions.Timer.csproj", 11 | "src\\DotNetWorker.Core\\DotNetWorker.Core.csproj", 12 | "src\\DotNetWorker.Grpc\\DotNetWorker.Grpc.csproj", 13 | "src\\DotNetWorker\\DotNetWorker.csproj", 14 | "test\\E2ETests\\E2EApps\\E2EApp\\E2EApp.csproj", 15 | "test\\E2ETests\\E2ETests\\E2ETests.csproj", 16 | "test\\TestUtility\\TestUtility.csproj" 17 | ] 18 | } 19 | } -------------------------------------------------------------------------------- /test/E2ETests/E2ETests/Helpers/FactAttributes/IgnoreOnNetFxTestRunTheory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using Xunit; 6 | 7 | namespace Microsoft.Azure.Functions.Tests.E2ETests 8 | { 9 | public sealed class IgnoreOnNetFxTestRunTheory : TheoryAttribute 10 | { 11 | public IgnoreOnNetFxTestRunTheory() 12 | { 13 | if (IsNetFxTestRun()) 14 | { 15 | Skip = "Ignore when test run is using netFx as AspNetCore is not supported."; 16 | } 17 | } 18 | 19 | private static bool IsNetFxTestRun() 20 | => string.Equals(Environment.GetEnvironmentVariable("DOTNET_VERSION"), "netfx", StringComparison.OrdinalIgnoreCase); 21 | } 22 | } -------------------------------------------------------------------------------- /test/E2ETests/E2ETests/xunit.runner.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", 3 | "parallelizeAssembly": false, 4 | "parallelizeTestCollections": false 5 | } -------------------------------------------------------------------------------- /test/E2ETests/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/Resources/Projects/FunctionApp01/FunctionApp01.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | v4 7 | enable 8 | enable 9 | 1.17.2 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/Resources/Projects/FunctionApp01/HttpFunction.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Net; 5 | using Microsoft.Azure.Functions.Worker; 6 | using Microsoft.Azure.Functions.Worker.Http; 7 | using Microsoft.Extensions.Logging; 8 | 9 | namespace FunctionApp01 10 | { 11 | public class HttpFunction 12 | { 13 | [Function("FunctionApp01_Hello")] 14 | public HttpResponseData Hello([HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequestData req) 15 | { 16 | return req.CreateResponse(HttpStatusCode.OK); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/Resources/Projects/FunctionApp01/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | Console.WriteLine("Hello, World!"); 3 | -------------------------------------------------------------------------------- /test/Resources/Projects/FunctionExt01/FunctionExt01.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | <_Parameter1>Microsoft.Azure.WebJobs.Extensions.Storage 17 | <_Parameter2>5.3.1 18 | <_Parameter3>true 19 | <_Parameter3_IsLiteral>true 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/Resources/Projects/FunctionLib01/FunctionLib01.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/Resources/Projects/FunctionLib01/HttpFunction.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Net; 5 | using Microsoft.Azure.Functions.Worker; 6 | using Microsoft.Azure.Functions.Worker.Http; 7 | using Microsoft.Extensions.Logging; 8 | 9 | namespace FunctionLib01 10 | { 11 | public class HttpFunction 12 | { 13 | [Function("FunctionLib01_Hello")] 14 | public HttpResponseData Hello([HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequestData req) 15 | { 16 | return req.CreateResponse(HttpStatusCode.OK); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/Sdk.E2ETests/Sdk.E2ETests_default.runsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | (Requirement != Docker) 5 | 6 | -------------------------------------------------------------------------------- /test/Sdk.E2ETests/Sdk.E2ETests_dockertests.runsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | (Requirement = Docker) 5 | 6 | -------------------------------------------------------------------------------- /test/Sdk.E2ETests/xunit.runner.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", 3 | "parallelizeAssembly": false, 4 | "parallelizeTestCollections": false 5 | } -------------------------------------------------------------------------------- /test/Sdk.Generator.Tests/FunctionMetadata/StringExtensionsTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Azure.Functions.Worker.Sdk; 5 | using Xunit; 6 | 7 | namespace Microsoft.Azure.Functions.Sdk.Generator.FunctionMetadata.Tests 8 | { 9 | public class StringExtensionsTests 10 | { 11 | [Theory] 12 | [InlineData("HttpTrigger", "httpTrigger")] 13 | [InlineData("Blob", "blob")] 14 | [InlineData("http", "http")] 15 | [InlineData("", "")] 16 | [InlineData(null, null)] 17 | public void ToLowerFirstCharacterWorks(string? input, string? expectedOutput) 18 | { 19 | var actual = input.ToLowerFirstCharacter(); 20 | 21 | Assert.Equal(expectedOutput, actual); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/Sdk.Generator.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Azure.Functions.Worker.Extensions.Abstractions; 5 | 6 | [assembly: ExtensionInformation("Sdk.Generator.Tests", "1.0.0")] 7 | -------------------------------------------------------------------------------- /test/Sdk.Generator.Tests/Resources/TestPublishContents.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-functions-dotnet-worker/9ed7ece0564d9db3a30b87d5eea8324a6e7c3d10/test/Sdk.Generator.Tests/Resources/TestPublishContents.zip -------------------------------------------------------------------------------- /test/TestUtility/ExternalPoco.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Tests 5 | { 6 | /// 7 | /// Used to validate types defined in external assemblies 8 | /// 9 | public class ExternalPoco 10 | { 11 | public string Prop1 { get; set; } 12 | 13 | public string Prop2 { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/TestUtility/TestBindingMetadata.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Azure.Functions.Worker.Tests 5 | { 6 | public class TestBindingMetadata : BindingMetadata 7 | { 8 | public TestBindingMetadata(string name, string type, BindingDirection direction) 9 | { 10 | Name = name; 11 | Type = type; 12 | Direction = direction; 13 | } 14 | 15 | public override string Name { get; } 16 | 17 | public override string Type { get; } 18 | 19 | public override BindingDirection Direction { get; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/Worker.ApplicationInsights.Tests/TestAppBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Azure.Functions.Worker.Middleware; 3 | using Microsoft.Extensions.DependencyInjection; 4 | 5 | namespace Microsoft.Azure.Functions.Worker.ApplicationInsights.Tests; 6 | 7 | internal class TestAppBuilder : IFunctionsWorkerApplicationBuilder 8 | { 9 | public IServiceCollection Services { get; } = new ServiceCollection(); 10 | 11 | public IFunctionsWorkerApplicationBuilder Use(Func middleware) 12 | { 13 | throw new NotImplementedException(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/Worker.ApplicationInsights.Tests/TestTelemetryChannel.cs: -------------------------------------------------------------------------------- 1 | //// Copyright (c) .NET Foundation. All rights reserved. 2 | //// Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Concurrent; 5 | using Microsoft.ApplicationInsights.Channel; 6 | 7 | namespace Microsoft.Azure.Functions.Worker.ApplicationInsights.Tests; 8 | 9 | internal class TestTelemetryChannel : ITelemetryChannel 10 | { 11 | public ConcurrentBag Telemetries { get; private set; } = new ConcurrentBag(); 12 | 13 | public bool? DeveloperMode { get; set; } 14 | 15 | public string EndpointAddress { get; set; } 16 | 17 | public void Dispose() 18 | { 19 | } 20 | 21 | public void Flush() 22 | { 23 | } 24 | 25 | public void Send(ITelemetry item) 26 | { 27 | Telemetries.Add(item); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/Worker.Extensions.Sample-IncorrectImplementation/SampleIncorrectExtensionStartup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Functions.Worker; 2 | using Microsoft.Azure.Functions.Worker.Core; 3 | using Worker.Extensions.Sample_IncorrectImplementation; 4 | 5 | [assembly: WorkerExtensionStartup(typeof(SampleIncorrectExtensionStartup))] 6 | 7 | 8 | namespace Worker.Extensions.Sample_IncorrectImplementation 9 | { 10 | /// 11 | /// An incorrect extension implementation(Missing parameterless constructor, Missing base class) 12 | /// 13 | public sealed class SampleIncorrectExtensionStartup 14 | { 15 | public SampleIncorrectExtensionStartup(string foo) 16 | { 17 | 18 | } 19 | public void Configure(IFunctionsWorkerApplicationBuilder applicationBuilder) 20 | { 21 | 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/Worker.Extensions.Sample-IncorrectImplementation/Worker.Extensions.Sample-IncorrectImplementation.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | True 6 | ..\..\key.snk 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test/Worker.Extensions.Sample/Worker.Extensions.Sample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | True 6 | ..\..\key.snk 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test/Worker.Extensions.SignalRService.Tests/Usings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; -------------------------------------------------------------------------------- /test/Worker.Extensions.Tests/Blob/BlobTestHelper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Azure.Functions.Worker.Extensions.Tests.Blob 7 | { 8 | public class BlobTestHelper 9 | { 10 | public static BinaryData GetTestBinaryData(string connection = "Connection", string container = "Container", string blobName = "") 11 | { 12 | string jsonData = $@"{{ 13 | ""Connection"" : ""{connection}"", 14 | ""ContainerName"" : ""{container}"", 15 | ""BlobName"" : ""{blobName}"" 16 | }}"; 17 | 18 | return new BinaryData(jsonData); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /test/Worker.Extensions.Tests/GrpcTestHelper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using Google.Protobuf; 6 | using Microsoft.Azure.Functions.Worker.Grpc.Messages; 7 | 8 | namespace Microsoft.Azure.Functions.Worker.Extensions.Tests 9 | { 10 | public static class GrpcTestHelper 11 | { 12 | internal static GrpcModelBindingData GetTestGrpcModelBindingData(BinaryData content, string source, string contentType = "application/json") 13 | { 14 | var data = new ModelBindingData() 15 | { 16 | Version = "1.0", 17 | Source = source, 18 | Content = ByteString.CopyFrom(content), 19 | ContentType = contentType 20 | }; 21 | 22 | return new GrpcModelBindingData(data); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /test/extensions/Worker.Extensions.Http.AspNetCore.Tests/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; --------------------------------------------------------------------------------