├── test ├── WebJobs.Script.Tests │ ├── TestWorkers │ │ ├── worker1 │ │ │ ├── 1.bat │ │ │ └── worker.config.json │ │ └── worker2 │ │ │ └── 2.bat │ ├── TestFixture │ │ ├── ExtensionRequirementOptionsTests │ │ │ ├── EmptyFile.json │ │ │ └── FunctionsHostingEnvironmentConfig_bundlesOnly.json │ │ └── HostOptionsProviderTests │ │ │ ├── TestWihtoutIOptionsFormatter.json │ │ │ ├── TestBasicBindings.json │ │ │ ├── TestBasicConcurrency.json │ │ │ ├── TestDefaultConcurrency.json │ │ │ ├── TestIrregularNamingBindings.json │ │ │ ├── TestWihtoutExtensionsAttributeBindings.json │ │ │ └── TestMultipleBindings.json │ ├── xunit.runner.json │ ├── Description │ │ └── DotNet │ │ │ └── TestFiles │ │ │ └── PackageReferences │ │ │ ├── FunctionWithNoProject │ │ │ └── function.json │ │ │ ├── ProjectWithoutLock │ │ │ └── function.proj │ │ │ ├── ProjectWithMismatchedLock │ │ │ ├── MismatchedPackageVersions │ │ │ │ └── function.proj │ │ │ └── MismatchedProjectDependencies │ │ │ │ └── function.proj │ │ │ └── ProjectWithLockMatch │ │ │ └── function.proj │ ├── Workers │ │ └── Rpc │ │ │ ├── Resources │ │ │ └── functions.png │ │ │ └── TestRpcWorkerConfig.cs │ ├── Resources │ │ └── FileProvisioning │ │ │ └── PowerShell │ │ │ ├── PSGalleryEmptyFeed.xml │ │ │ ├── requirements_PSGalleryOffline.psd1 │ │ │ └── requirements_PSGalleryOnline.psd1 │ └── Configuration │ │ └── WebScriptHostConfigurationSourceTests.cs ├── Resources │ ├── TestScripts │ │ ├── Invalid │ │ │ └── host.json │ │ ├── CSharp │ │ │ ├── MissingAssemblies │ │ │ │ ├── project.json │ │ │ │ ├── function.json │ │ │ │ └── run.csx │ │ │ ├── host.json │ │ │ ├── CustomTrigger │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── HttpTrigger-FunctionAuth │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── ManualTrigger │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── LoadScriptReference │ │ │ │ ├── class.csx │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── HttpTrigger-Dynamic │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── OneSecondTimer │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── ServiceBusTopicTrigger │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── NotificationHubOut │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── ServiceBusTopicOutput │ │ │ │ └── run.csx │ │ │ ├── StorageReferenceV12 │ │ │ │ ├── function.json │ │ │ │ └── run.csx │ │ │ ├── ServiceBusQueueTriggerAndOutput │ │ │ │ └── run.csx │ │ │ ├── FunctionExecutionContext │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── TimeoutSync │ │ │ │ ├── function.json │ │ │ │ └── run.csx │ │ │ ├── TimeoutToken │ │ │ │ └── function.json │ │ │ ├── TwilioReference │ │ │ │ ├── function.json │ │ │ │ └── run.csx │ │ │ ├── MultipleTriggers │ │ │ │ └── run.csx │ │ │ ├── NotificationHubNative │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── CosmosDBTrigger │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── AssembliesFromSharedLocation │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── HttpTrigger-Redirect │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── QueueTriggerToBlob │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── FunctionIndexingError │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── MobileTableIn │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── NotificationHubOutNotification │ │ │ │ └── function.json │ │ │ ├── CosmosDBOut │ │ │ │ └── run.csx │ │ │ ├── HttpTrigger-Model │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── MultipleOutputs │ │ │ │ └── run.csx │ │ │ ├── HttpTrigger-Model-v2 │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── QueueTriggerToBlobRichTypes │ │ │ │ ├── function.json │ │ │ │ └── run.csx │ │ │ ├── MobileTableOut │ │ │ │ └── function.json │ │ │ ├── HttpTrigger-Routed │ │ │ │ └── function.json │ │ │ ├── Scenarios │ │ │ │ └── function.json │ │ │ ├── HttpTrigger-Scenarios │ │ │ │ └── function.json │ │ │ └── TimeoutStopHost │ │ │ │ └── run.csx │ │ ├── Node │ │ │ ├── host.json │ │ │ ├── Common │ │ │ │ └── test.js │ │ │ ├── Invalid │ │ │ │ ├── index.js │ │ │ │ └── function.json │ │ │ ├── ManualTrigger │ │ │ │ ├── index.js │ │ │ │ └── function.json │ │ │ ├── MultipleInputs │ │ │ │ └── index.js │ │ │ ├── TimeoutSync │ │ │ │ ├── function.json │ │ │ │ └── index.js │ │ │ ├── CosmosDBTrigger │ │ │ │ ├── index.js │ │ │ │ └── function.json │ │ │ ├── MultipleOutputs │ │ │ │ └── index.js │ │ │ ├── ServiceBusTopicTrigger │ │ │ │ ├── index.js │ │ │ │ └── function.json │ │ │ ├── SingleNamedExport │ │ │ │ ├── function.json │ │ │ │ └── index.js │ │ │ ├── QueueTriggerToBlob │ │ │ │ ├── index.js │ │ │ │ └── function.json │ │ │ ├── MobileTableOut │ │ │ │ ├── index.js │ │ │ │ └── function.json │ │ │ ├── MultipleExports │ │ │ │ ├── function.json │ │ │ │ └── index.js │ │ │ ├── TimerTrigger │ │ │ │ ├── index.js │ │ │ │ └── function.json │ │ │ ├── ServiceBusTopicOutput │ │ │ │ └── index.js │ │ │ ├── ServiceBusQueueTriggerAndOutput │ │ │ │ └── index.js │ │ │ ├── package.json │ │ │ ├── WebHookTrigger │ │ │ │ ├── index.js │ │ │ │ └── function.json │ │ │ ├── EventHubSender │ │ │ │ ├── index.js │ │ │ │ └── function.json │ │ │ ├── NotificationHubNative │ │ │ │ ├── index.js │ │ │ │ └── function.json │ │ │ ├── TableIn │ │ │ │ └── index.js │ │ │ ├── HttpTriggerByteArray │ │ │ │ ├── function.json │ │ │ │ └── index.js │ │ │ ├── NotificationHubOut │ │ │ │ ├── function.json │ │ │ │ └── index.js │ │ │ ├── TableOut │ │ │ │ └── function.json │ │ │ ├── HttpTrigger │ │ │ │ └── function.json │ │ │ ├── Scenarios │ │ │ │ └── function.json │ │ │ ├── HttpTriggerPromise │ │ │ │ ├── function.json │ │ │ │ └── index.js │ │ │ ├── HttpTriggerExpressApi │ │ │ │ └── function.json │ │ │ ├── QueueTriggerByteArray │ │ │ │ ├── function.json │ │ │ │ └── index.js │ │ │ ├── HttpTrigger-Scenarios │ │ │ │ └── function.json │ │ │ ├── CosmosDBOut │ │ │ │ └── index.js │ │ │ ├── index.js │ │ │ ├── HttpTriggerShared │ │ │ │ └── function.json │ │ │ ├── CosmosDBIn │ │ │ │ └── index.js │ │ │ ├── EventHubTrigger │ │ │ │ └── index.js │ │ │ ├── BlobTriggerToBlob │ │ │ │ └── function.json │ │ │ ├── MobileTableIn │ │ │ │ └── index.js │ │ │ └── HttpTriggerToBlob │ │ │ │ └── index.js │ │ ├── DotNet │ │ │ └── host.json │ │ ├── Proxies │ │ │ ├── host.json │ │ │ ├── Ping │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── PingAuth │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── PingRoute │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ └── PingMakeResponse │ │ │ │ └── function.json │ │ ├── DirectLoad │ │ │ └── host.json │ │ ├── NoFunction │ │ │ └── host.json │ │ ├── ProxiesOnly │ │ │ ├── host.json │ │ │ └── proxies.json │ │ ├── FunctionGeneration │ │ │ ├── host.json │ │ │ ├── HttpTrigger-FSharp │ │ │ │ └── function.json │ │ │ └── HttpTrigger-CSharp │ │ │ │ └── function.json │ │ ├── ListenerExceptions │ │ │ ├── host.json │ │ │ ├── TimerTrigger │ │ │ │ ├── index.js │ │ │ │ └── function.json │ │ │ └── ListenerStartupException │ │ │ │ ├── index.js │ │ │ │ └── function.json │ │ ├── OutOfDateExtension │ │ │ ├── host.json │ │ │ └── bin │ │ │ │ ├── Microsoft.Azure.WebJobs.ServiceBus.dll │ │ │ │ ├── Microsoft.Azure.WebJobs.Extensions.Storage.dll │ │ │ │ └── Microsoft.Azure.WebJobs.Extensions.DurableTask.dll │ │ ├── WarmupFunction │ │ │ ├── Ping │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ │ ├── host.json │ │ │ └── warmup │ │ │ │ ├── run.csx │ │ │ │ └── function.json │ │ ├── OutOfRange │ │ │ └── host.json │ │ ├── NodeWithBundles │ │ │ ├── host.json │ │ │ └── HttpTriggerNoAuth │ │ │ │ └── function.json │ │ └── CustomHeadersMiddleware │ │ │ ├── Node │ │ │ ├── HttpTrigger │ │ │ │ ├── index.js │ │ │ │ └── function.json │ │ │ └── host.json │ │ │ └── CSharp │ │ │ ├── HttpTrigger │ │ │ ├── run.csx │ │ │ └── function.json │ │ │ └── host.json │ └── TestProjects │ │ ├── WebJobsStartupTests │ │ └── host.json │ │ ├── EmptyScriptRoot │ │ └── host.json │ │ ├── DotNetIsolated60 │ │ ├── Properties │ │ │ ├── serviceDependencies.json │ │ │ └── serviceDependencies.local.json │ │ └── host.json │ │ ├── ReferenceOlderRuntimeAssembly │ │ ├── Properties │ │ │ ├── serviceDependencies.json │ │ │ └── serviceDependencies.local.json │ │ └── host.json │ │ ├── AssemblyLoadContextRace │ │ └── host.json │ │ ├── MultipleDependencyVersions │ │ └── host.json │ │ ├── NativeDependencyNoRuntimes │ │ └── host.json │ │ ├── Dependency55 │ │ ├── TypeGetter.cs │ │ └── Dependency55.csproj │ │ ├── Dependency56 │ │ ├── TypeGetter.cs │ │ └── Dependency56.csproj │ │ ├── DotNetIsolatedUnsupportedWorker │ │ └── host.json │ │ └── DotNetCustomHandler │ │ ├── DotNetCustomHandler.csproj │ │ ├── host.json │ │ ├── SimpleHttpTrigger │ │ └── function.json │ │ └── Program.cs ├── WebJobs.Script.Tests.Integration │ ├── xunit.runner.json │ └── Properties │ │ └── launchSettings.json ├── TestWorkers │ └── ProbingPaths │ │ └── functionsworkers │ │ ├── dotnet-isolated │ │ └── 1.0.0 │ │ │ └── worker.config.json │ │ ├── java │ │ ├── 2.18.0 │ │ │ └── worker.config.json │ │ ├── 2.19.0 │ │ │ └── worker.config.json │ │ └── 2.18.1 │ │ │ └── worker.config.json │ │ └── node │ │ └── 3.10.1 │ │ └── worker.config.json ├── WebJobs.Script.Tests.Shared │ └── Properties │ │ └── AssemblyInfo.cs └── Directory.Build.targets ├── .sscignore ├── sample ├── Python │ ├── host.json │ └── HttpTrigger │ │ └── function.json ├── NodeDrain │ ├── host.json │ └── HttpTrigger-LongRun │ │ ├── index.js │ │ └── function.json ├── NodeResume │ ├── host.json │ └── HttpTrigger │ │ ├── function.json │ │ └── index.js ├── CustomHandlerRetry │ ├── package.json │ ├── host.json │ └── HttpTrigger │ │ └── function.json ├── CSharp │ ├── Shared │ │ ├── Message.csx │ │ └── Order.csx │ ├── TimerTrigger │ │ ├── run.csx │ │ └── function.json │ ├── DocumentDB │ │ ├── run.csx │ │ └── function.json │ ├── NotificationHub │ │ ├── run.csx │ │ └── function.json │ ├── ApiHubFileTrigger │ │ ├── run.csx │ │ └── function.json │ ├── QueueTrigger │ │ ├── run.csx │ │ └── function.json │ ├── CosmosDBTrigger │ │ ├── function.json │ │ └── run.csx │ ├── HttpTriggerWithObject │ │ ├── run.csx │ │ └── function.json │ ├── ManualTrigger │ │ └── run.csx │ ├── HttpTrigger-AdminLevel │ │ ├── function.json │ │ └── run.csx │ ├── HttpTrigger-AnonymousLevel │ │ ├── function.json │ │ └── run.csx │ ├── HttpTrigger-Compat │ │ ├── function.proj │ │ ├── function.json │ │ └── run.csx │ ├── HttpTrigger │ │ ├── function.json │ │ └── run.csx │ ├── HttpTrigger-Cancellation │ │ ├── function.json │ │ └── run.csx │ ├── BlobTrigger │ │ ├── run.csx │ │ └── function.json │ ├── HttpTrigger-Identities │ │ └── function.json │ ├── HttpTrigger-CustomRoute │ │ ├── function.json │ │ └── run.csx │ ├── MobileTable │ │ ├── function.json │ │ └── run.csx │ ├── SendGrid │ │ └── function.json │ └── HttpTrigger-Poco │ │ └── function.json ├── Java │ └── HttpTrigger │ │ ├── HttpTrigger-1.0-SNAPSHOT.jar │ │ └── function.json ├── Samples.csproj ├── NodeRetry │ ├── host.json │ ├── HttpTrigger-RetryHostJson │ │ └── function.json │ └── HttpTrigger-RetryFunctionJson │ │ └── function.json ├── Node │ ├── BlobTrigger │ │ ├── index.js │ │ └── function.json │ ├── ApiHubFileTrigger │ │ ├── index.js │ │ └── function.json │ ├── Shared │ │ └── test.js │ ├── ServiceBusTopicTrigger │ │ ├── index.js │ │ └── function.json │ ├── HttpTrigger-CustomRoute-Post │ │ └── index.js │ ├── DocumentDB │ │ ├── index.js │ │ └── function.json │ ├── HttpTrigger-Disabled │ │ ├── index.js │ │ └── function.json │ ├── MobileTable │ │ ├── index.js │ │ └── function.json │ ├── QueueTrigger │ │ ├── index.js │ │ └── function.json │ ├── NotificationHub │ │ ├── index.js │ │ └── function.json │ ├── HttpTrigger │ │ └── function.json │ ├── EventHubTrigger │ │ └── function.json │ ├── HttpTrigger-Promise │ │ └── function.json │ ├── HttpTrigger-Timeout │ │ └── function.json │ ├── ManualTrigger │ │ └── index.js │ ├── proxies.json │ ├── TimerTrigger │ │ └── function.json │ ├── HttpTrigger-CustomRoute-Get │ │ └── function.json │ └── SendGrid │ │ ├── function.json │ │ └── index.js ├── HttpWorker │ ├── host.json │ ├── HttpTrigger │ │ └── function.json │ ├── proxies.json │ └── server.js ├── NodeWithoutBundle │ ├── Shared │ │ └── test.js │ └── HttpTrigger │ │ └── function.json ├── CustomHandler │ ├── host.json │ ├── HttpTrigger │ │ └── function.json │ ├── proxies.json │ └── server.js ├── PythonWorkerIndexing │ └── host.json ├── PowerShell │ └── HttpTrigger │ │ └── function.json └── CSharpBenchmark │ └── HttpTriggerAnon │ ├── function.json │ └── run.csx ├── omnisharp.json ├── src ├── WebJobs.Script.WebHost │ ├── .bowerrc │ ├── extension.xml │ ├── PreJIT │ │ └── .jitmarker │ ├── appsettings.json │ ├── Resources │ │ └── Functions │ │ │ ├── host.json │ │ │ └── WarmUp │ │ │ └── function.json │ ├── Models │ │ ├── FunctionInvocation.cs │ │ ├── CodePackageType.cs │ │ ├── ExtensionsRestoreStatus.cs │ │ ├── EasyAuthSettings.cs │ │ ├── ResumeStatus.cs │ │ └── Link.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Security │ │ ├── KeyManagement │ │ │ ├── ScriptSecretsType.cs │ │ │ ├── IKeyValueReader.cs │ │ │ └── IKeyValueWriter.cs │ │ ├── Authentication │ │ │ └── Keys │ │ │ │ └── AuthLevelAuthenticationDefaults.cs │ │ └── Authorization │ │ │ └── Policies │ │ │ └── PolicyNames.cs │ ├── Diagnostics │ │ ├── ILinuxAppServiceFileLogger.cs │ │ ├── IDiagnosticEventRepositoryFactory.cs │ │ └── ILinuxAppServiceFileLoggerFactory.cs │ ├── Management │ │ └── LinuxSpecialization │ │ │ ├── IUnZipHandler.cs │ │ │ ├── IBashCommandHandler.cs │ │ │ └── IManagedIdentityTokenProvider.cs │ ├── Configuration │ │ ├── HostHstsOptions.cs │ │ ├── HostCorsOptions.cs │ │ ├── HostEasyAuthOptions.cs │ │ └── CustomHttpHeadersOptions.cs │ ├── DependencyInjection │ │ └── DependencyValidator │ │ │ ├── InvalidServiceDescriptorReason.cs │ │ │ └── IDependencyValidator.cs │ ├── runtimeconfig.template.json │ ├── OperationResult.cs │ ├── Standby │ │ └── IStandbyManager.cs │ ├── IFileMonitoringService.cs │ ├── Extensions │ │ └── VfsStringExtensions.cs │ ├── ContainerManagement │ │ └── ILinuxContainerActivityPublisher.cs │ └── Middleware │ │ └── JobHostMiddleware │ │ └── IJobHostMiddlewarePipeline.cs ├── WebJobs.Script.Grpc │ ├── .gitignore │ ├── Http │ │ ├── Configuration │ │ │ └── CustomHandlerType.cs │ │ ├── IHttpWorkerChannel.cs │ │ ├── IHttpWorkerChannelFactory.cs │ │ └── IHttpWorkerProcessFactory.cs │ ├── Channel │ │ └── IInvocationMessageDispatcherFactory.cs │ ├── IFunctionInvocationDispatcherFactory.cs │ ├── Rpc │ │ ├── IRpcWorkerProcessFactory.cs │ │ ├── FunctionRegistration │ │ │ └── IRpcFunctionInvocationDispatcherLoadBalancer.cs │ │ └── IRpcWorkerChannelDictionary.cs │ ├── ProcessManagement │ │ ├── EmptyProcessRegistry.cs │ │ ├── IWorkerProcessFactory.cs │ │ └── IProcessRegistry.cs │ └── Eventing │ │ ├── InboundGrpcEvent.cs │ │ └── OutboundGrpcEvent.cs ├── WebJobs.Script.SiteExtension │ └── extension.xml ├── WebJobs.Script.Abstractions │ ├── key.snk │ ├── Directory.Version.props │ ├── Description │ │ ├── Binding │ │ │ ├── BindingDirection.cs │ │ │ └── DataType.cs │ │ └── RetryStrategy.cs │ └── WebJobs.Script.Abstractions.csproj ├── WebJobs.Script │ ├── Metrics │ │ └── IHostMetrics.cs │ ├── Host │ │ ├── IDebugManager.cs │ │ ├── IFileLoggingStatusManager.cs │ │ ├── ScriptInvocationArguments.cs │ │ ├── Kubernetes │ │ │ └── KubernetesLockHandle.cs │ │ └── IScriptJobHost.cs │ ├── FileProvisioning │ │ └── PowerShell │ │ │ └── requirements.psd1 │ ├── Config │ │ └── IConfigureBuilder.cs │ ├── Diagnostics │ │ ├── IFileWriterFactory.cs │ │ ├── IFileWriter.cs │ │ ├── LogType.cs │ │ ├── OpenTelemetry │ │ │ └── TelemetryMode.cs │ │ ├── HostStartedEvent.cs │ │ ├── IHostDiagnosticEvent.cs │ │ ├── ForwardingLoggerAttribute.cs │ │ └── ISystemLoggerFactory.cs │ ├── ErrorCodes.cs │ ├── Http │ │ ├── IHttpRoutesManager.cs │ │ └── DefaultHttpRouteManager.cs │ ├── Models │ │ ├── ExtensionReferences.cs │ │ ├── ExtensionBundleDetails.cs │ │ └── ExtensionReferencesJsonContext.cs │ ├── Description │ │ └── DotNet │ │ │ ├── IMethodReference.cs │ │ │ ├── RuntimeInfo.cs │ │ │ ├── DotNetScriptTypes.cs │ │ │ ├── IFunctionEntryPointResolver.cs │ │ │ └── ScriptRuntimeAssembly.cs │ ├── ManagedDependencies │ │ └── ManagedDependencyOptions.cs │ ├── CloudName.cs │ ├── Workers │ │ ├── IWebHostWorkerManager.cs │ │ ├── WorkerProcessInfo.cs │ │ ├── ConsoleLog.cs │ │ └── IWorkerConsoleLogSource.cs │ ├── Eventing │ │ └── Host │ │ │ └── HostStartEvent.cs │ ├── IHostOptionsProvider.cs │ ├── PlatformHelper.cs │ ├── RuntimeInformation │ │ └── ISystemRuntimeInformation.cs │ ├── Binding │ │ └── Manual │ │ │ └── ManualTriggerAttribute.cs │ ├── RpcWorkerConfig.cs │ ├── ExtensionRequirements │ │ └── BundleRequirement.cs │ └── ExtensionBundle │ │ └── IExtensionBundleContentProvider.cs ├── Directory.Version.props └── Directory.Build.props ├── eng ├── res │ ├── key.snk │ ├── icon.png │ └── functions.png ├── build │ ├── Workers.Java.props │ ├── Workers.Node.props │ ├── Engineering.targets │ └── Workers.Python.props └── ci │ ├── templates │ ├── variables │ │ ├── coldstart.yml │ │ ├── benchmarks.yml │ │ └── build.yml │ └── install-dotnet.yml │ ├── merge-mirror.yml │ └── code-mirror.yml ├── .vscode ├── settings.json └── tasks.json ├── perf └── Apps │ ├── TimerAppNet9 │ ├── host.json │ └── Program.cs │ ├── global.json │ ├── HelloHttpNode │ ├── src │ │ ├── index.js │ │ └── functions │ │ │ ├── Hello.js │ │ │ └── HelloAuth.js │ ├── package.json │ └── host.json │ ├── HelloHttpNet9NoProxy │ ├── Program.cs │ └── host.json │ └── HelloHttpNet9 │ ├── Program.cs │ └── host.json ├── CodeQL.yml ├── tools ├── ExtensionsMetadataGenerator │ ├── src │ │ ├── ExtensionsMetadataGenerator.Console │ │ │ └── runtimeconfig.template.json │ │ └── ExtensionsMetadataGenerator │ │ │ └── Targets │ │ │ └── Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.props │ ├── key.snk │ ├── Directory.Version.props │ └── test │ │ ├── TestProject_Razor │ │ ├── AssemblyAttribute.cs │ │ └── TestProject_Razor.csproj │ │ ├── TestProject_Core22 │ │ └── TestProject_Core22.csproj │ │ └── TestProject_Core21 │ │ └── TestProject_Core21.csproj └── Clean.targets ├── .azuredevops └── dependabot.yml ├── release_notes.md ├── .editorconfig ├── global.json ├── Directory.Build.targets └── .github ├── ISSUE_TEMPLATE └── General_question.md └── workflows └── dependency-review.yml /test/WebJobs.Script.Tests/TestWorkers/worker1/1.bat: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/TestWorkers/worker2/2.bat: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.sscignore: -------------------------------------------------------------------------------- 1 | { "cfs": [ "CFS0001", "CFS0013", "CFS0031" ] } -------------------------------------------------------------------------------- /sample/Python/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /sample/NodeDrain/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /sample/NodeResume/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Invalid/host.json: -------------------------------------------------------------------------------- 1 | { 2 | ~ 3 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/MissingAssemblies/project.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/DotNet/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Proxies/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /omnisharp.json: -------------------------------------------------------------------------------- 1 | { 2 | "script": { 3 | "enabled": false 4 | } 5 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "wwwroot/lib" 3 | } 4 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/DirectLoad/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/NoFunction/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/ProxiesOnly/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/FunctionGeneration/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/ListenerExceptions/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/OutOfDateExtension/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /eng/res/key.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-functions-host/HEAD/eng/res/key.snk -------------------------------------------------------------------------------- /test/Resources/TestProjects/WebJobsStartupTests/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } 4 | -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/TestFixture/ExtensionRequirementOptionsTests/EmptyFile.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "azure-pipelines.1ESPipelineTemplatesSchemaFile": true 3 | } 4 | -------------------------------------------------------------------------------- /eng/res/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-functions-host/HEAD/eng/res/icon.png -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/extension.xml: -------------------------------------------------------------------------------- 1 | 2 | disabled 3 | -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/xunit.runner.json: -------------------------------------------------------------------------------- 1 | { 2 | "parallelizeTestCollections": false 3 | } 4 | -------------------------------------------------------------------------------- /eng/res/functions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-functions-host/HEAD/eng/res/functions.png -------------------------------------------------------------------------------- /perf/Apps/TimerAppNet9/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "telemetryMode": "OpenTelemetry" 4 | } 5 | -------------------------------------------------------------------------------- /src/WebJobs.Script.Grpc/.gitignore: -------------------------------------------------------------------------------- 1 | Messages 2 | node_modules 3 | azure-functions-language-worker-protobuf -------------------------------------------------------------------------------- /test/Resources/TestScripts/Proxies/Ping/run.csx: -------------------------------------------------------------------------------- 1 | public static string Run(HttpRequestMessage req) => "Pong"; -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/Description/DotNet/TestFiles/PackageReferences/FunctionWithNoProject/function.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CodeQL.yml: -------------------------------------------------------------------------------- 1 | path_classifiers: 2 | library: 3 | - "out/bin/**/workers" 4 | - "out/pub/**/workers" 5 | -------------------------------------------------------------------------------- /sample/CustomHandlerRetry/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "express": "^4.21.2" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/WebJobs.Script.SiteExtension/extension.xml: -------------------------------------------------------------------------------- 1 | 2 | disabled 3 | 4 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/Common/test.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context) { 2 | context.done(); 3 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Proxies/PingAuth/run.csx: -------------------------------------------------------------------------------- 1 | public static string Run(HttpRequestMessage req) => "Pong"; -------------------------------------------------------------------------------- /test/Resources/TestScripts/WarmupFunction/Ping/run.csx: -------------------------------------------------------------------------------- 1 | public static string Run(HttpRequestMessage req) => "Pong"; -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests.Integration/xunit.runner.json: -------------------------------------------------------------------------------- 1 | { 2 | "parallelizeTestCollections": false 3 | } 4 | -------------------------------------------------------------------------------- /perf/Apps/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "rollForward": "latestPatch", 4 | "version": "9.0.100" 5 | } 6 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/PreJIT/.jitmarker: -------------------------------------------------------------------------------- 1 | This file is used to mark the location for .jittrace file insertion 2 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/Invalid/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, req) { 2 | context.done(); 3 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/CustomTrigger/run.csx: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | 4 | public static void Run(string input) 5 | { 6 | } -------------------------------------------------------------------------------- /tools/ExtensionsMetadataGenerator/src/ExtensionsMetadataGenerator.Console/runtimeconfig.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "rollForward": "Major" 3 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.Abstractions/key.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-functions-host/HEAD/src/WebJobs.Script.Abstractions/key.snk -------------------------------------------------------------------------------- /perf/Apps/HelloHttpNode/src/index.js: -------------------------------------------------------------------------------- 1 | const { app } = require('@azure/functions'); 2 | 3 | app.setup({ 4 | enableHttpStream: true, 5 | }); 6 | -------------------------------------------------------------------------------- /sample/CSharp/Shared/Message.csx: -------------------------------------------------------------------------------- 1 | public class Message 2 | { 3 | public string Id { get; set; } 4 | public string Value { get; set; } 5 | } -------------------------------------------------------------------------------- /src/WebJobs.Script/Metrics/IHostMetrics.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-functions-host/HEAD/src/WebJobs.Script/Metrics/IHostMetrics.cs -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/HttpTrigger-FunctionAuth/run.csx: -------------------------------------------------------------------------------- 1 | public static string Run(dynamic input) 2 | { 3 | return $"Success"; 4 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/ManualTrigger/run.csx: -------------------------------------------------------------------------------- 1 | public static void Run(string input, TraceWriter log) 2 | { 3 | log.Info(input); 4 | } -------------------------------------------------------------------------------- /tools/ExtensionsMetadataGenerator/key.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-functions-host/HEAD/tools/ExtensionsMetadataGenerator/key.snk -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/LoadScriptReference/class.csx: -------------------------------------------------------------------------------- 1 | public class Test 2 | { 3 | public string Response { get { return "TestClass"; } } 4 | } -------------------------------------------------------------------------------- /sample/CSharp/TimerTrigger/run.csx: -------------------------------------------------------------------------------- 1 | public static void Run(TimerInfo timerInfo, TraceWriter log) 2 | { 3 | log.Info("C# Timer trigger function executed."); 4 | } -------------------------------------------------------------------------------- /sample/Java/HttpTrigger/HttpTrigger-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-functions-host/HEAD/sample/Java/HttpTrigger/HttpTrigger-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /test/Resources/TestScripts/WarmupFunction/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "extensions": { 4 | "http": { 5 | "routePrefix": "" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /sample/CSharp/DocumentDB/run.csx: -------------------------------------------------------------------------------- 1 | public static object Run(string input) 2 | { 3 | return new 4 | { 5 | text = "Hello from C#! " + input 6 | }; 7 | } -------------------------------------------------------------------------------- /sample/CSharp/NotificationHub/run.csx: -------------------------------------------------------------------------------- 1 | public static string Run(string input) 2 | { 3 | return "{\"message\":\"Hello from C# ! \",\"location\":\"Redmond\"}"; 4 | } 5 | -------------------------------------------------------------------------------- /sample/Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/HttpTrigger-Dynamic/run.csx: -------------------------------------------------------------------------------- 1 | public static string Run(dynamic input) 2 | { 3 | return $"Name: {input.name}, Location: {input.location}"; 4 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/OneSecondTimer/run.csx: -------------------------------------------------------------------------------- 1 | public static void Run(TimerInfo timerInfo, ILogger log) 2 | { 3 | log.LogInformation("OneSecondTimer fired!"); 4 | } -------------------------------------------------------------------------------- /sample/NodeRetry/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "retry": { 4 | "strategy": "fixedDelay", 5 | "maxRetryCount": 2, 6 | "delayInterval": "00:00:03" 7 | } 8 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/ServiceBusTopicTrigger/run.csx: -------------------------------------------------------------------------------- 1 | public static void Run(string trigger, out string completed) 2 | { 3 | completed = trigger + "-completed"; 4 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/NotificationHubOut/run.csx: -------------------------------------------------------------------------------- 1 | public static string Run(string input) 2 | { 3 | return "{\"message\":\"Hello from C# ! \",\"location\":\"Redmond\"}"; 4 | } -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/Workers/Rpc/Resources/functions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-functions-host/HEAD/test/WebJobs.Script.Tests/Workers/Rpc/Resources/functions.png -------------------------------------------------------------------------------- /.azuredevops/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Mirrored repository. We use dependabot via GitHub, not Azure DevOps. 2 | version: 2 3 | enable-security-updates: false 4 | enable-campaigned-updates: false 5 | -------------------------------------------------------------------------------- /release_notes.md: -------------------------------------------------------------------------------- 1 | ### Release notes 2 | 3 | 6 | - Add JitTrace Files for v4.1046 7 | -------------------------------------------------------------------------------- /sample/Node/BlobTrigger/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, blob) { 2 | context.log('Node.js blob trigger function processed blob', blob); 3 | context.done(null, blob); 4 | }; -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/ManualTrigger/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input) { 2 | context.log("ManualTrigger function invoked!", input); 3 | context.done(); 4 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | indent_style = space 3 | charset = utf-8 4 | 5 | [*.cs] 6 | # SA1008: Opening parenthesis should not be preceded by a space. 7 | dotnet_diagnostic.SA1008.severity = silent 8 | -------------------------------------------------------------------------------- /sample/CSharp/ApiHubFileTrigger/run.csx: -------------------------------------------------------------------------------- 1 | public static string Run(string input, TraceWriter log) 2 | { 3 | log.Info($"C# ApiHub trigger function processed a file..."); 4 | return input; 5 | } -------------------------------------------------------------------------------- /sample/HttpWorker/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "httpWorker": { 4 | "description": { 5 | "defaultExecutablePath": "node", 6 | "defaultWorkerPath": "server.js" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /sample/Node/ApiHubFileTrigger/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input) { 2 | context.log('Node.js ApiHub trigger function processed ', input); 3 | context.done(null, input); 4 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/OutOfRange/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logger": { 4 | "aggregator": { 5 | "flushTimeout": "00:30:00" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests.Integration/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "WebJobs.Script.Tests.Integration": { 4 | "commandName": "Project" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /perf/Apps/HelloHttpNet9NoProxy/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Hosting; 2 | 3 | var host = new HostBuilder() 4 | .ConfigureFunctionsWorkerDefaults() 5 | .Build(); 6 | 7 | host.Run(); 8 | -------------------------------------------------------------------------------- /sample/CSharp/Shared/Order.csx: -------------------------------------------------------------------------------- 1 | public class Order 2 | { 3 | public string OrderId { get; set; } 4 | public string CustomerName { get; set; } 5 | public string CustomerEmail { get; set; } 6 | } -------------------------------------------------------------------------------- /src/Directory.Version.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.1047.100 4 | true 5 | 6 | 7 | -------------------------------------------------------------------------------- /eng/build/Workers.Java.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /eng/build/Workers.Node.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sample/Node/Shared/test.js: -------------------------------------------------------------------------------- 1 | var timestamp = new Date().getTime(); 2 | 3 | module.exports = { 4 | timestamp: timestamp, 5 | greeting: function (name) { 6 | return 'Hello ' + name; 7 | } 8 | }; -------------------------------------------------------------------------------- /test/Resources/TestProjects/EmptyScriptRoot/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "extensionBundle": { 4 | "id": "Microsoft.Azure.Functions.ExtensionBundle", 5 | "version": "[4.*, 5.0.0)" 6 | } 7 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/WarmupFunction/warmup/run.csx: -------------------------------------------------------------------------------- 1 | public static void Run(WarmupContext warmupContext, ILogger log) 2 | { 3 | log.LogInformation("Function App instance is warm 🌞🌞🌞"); 4 | } 5 | 6 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Resources/Functions/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "extensionBundle": { 4 | "id": "Microsoft.Azure.Functions.ExtensionBundle", 5 | "version": "[4.*, 5.0.0)" 6 | } 7 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/MultipleInputs/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input, entity1, entity2) { 2 | var result = entity1.Name + ', ' + entity2.Name; 3 | context.done(null, result); 4 | } -------------------------------------------------------------------------------- /sample/NodeWithoutBundle/Shared/test.js: -------------------------------------------------------------------------------- 1 | var timestamp = new Date().getTime(); 2 | 3 | module.exports = { 4 | timestamp: timestamp, 5 | greeting: function (name) { 6 | return 'Hello ' + name; 7 | } 8 | }; -------------------------------------------------------------------------------- /src/WebJobs.Script.Abstractions/Directory.Version.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1.0.4 4 | preview 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/CustomTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "customTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/ServiceBusTopicOutput/run.csx: -------------------------------------------------------------------------------- 1 | public static void Run(string trigger, out string output, out string completed) 2 | { 3 | output = trigger + "-completed"; 4 | completed = output; 5 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/StorageReferenceV12/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/NodeWithBundles/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "extensionBundle": { 4 | "id": "Microsoft.Azure.Functions.ExtensionBundle", 5 | "version": "[3.*, 4.0.0)" 6 | } 7 | } -------------------------------------------------------------------------------- /tools/ExtensionsMetadataGenerator/Directory.Version.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.2 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sample/Node/ServiceBusTopicTrigger/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, message) { 2 | context.log('Node.js ServiceBus topic trigger function processed message', message); 3 | context.done(null, message.value); 4 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/ServiceBusQueueTriggerAndOutput/run.csx: -------------------------------------------------------------------------------- 1 | public static void Run(string trigger, out string output, out string completed) 2 | { 3 | output = trigger + "-completed"; 4 | completed = output; 5 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/TimeoutSync/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /eng/ci/templates/variables/coldstart.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | # This controls how many cold start samples are collected for each app+OS combination. 3 | - name: runInstances 4 | value: "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20" 5 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/FunctionExecutionContext/run.csx: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | public static IActionResult Run(HttpRequest req, ExecutionContext context) 4 | { 5 | return new OkObjectResult(context); 6 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/TimeoutSync/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "inputData", 6 | "direction": "in" 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/CosmosDBTrigger/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input) { 2 | context.log('Document Id: ', input[0].id); 3 | 4 | context.bindings.blob = input[0].id; 5 | 6 | context.done(); 7 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/OutOfDateExtension/bin/Microsoft.Azure.WebJobs.ServiceBus.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-functions-host/HEAD/test/Resources/TestScripts/OutOfDateExtension/bin/Microsoft.Azure.WebJobs.ServiceBus.dll -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/TestWorkers/worker1/worker.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": { 3 | "language": "foo", 4 | "defaultExecutablePath": "%FUNCTIONS_WORKER_DIRECTORY%/1.bat", 5 | "defaultWorkerPath": "1.bat" 6 | } 7 | } -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "8.0.101", 4 | "rollForward": "latestFeature" 5 | }, 6 | "msbuild-sdks": { 7 | "Microsoft.Build.NoTargets": "3.7.56", 8 | "Microsoft.Build.Traversal": "4.1.0" 9 | } 10 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/MultipleOutputs/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input) { 2 | context.bindings.blob1 = "Test Blob 1"; 3 | context.bindings.blob2 = "Test Blob 2"; 4 | context.done(null, "Test Blob 3"); 5 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/ServiceBusTopicTrigger/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, trigger) { 2 | context.log("Trigger: " + trigger); 3 | context.bindings.completed = trigger + "-completed"; 4 | context.done(); 5 | } -------------------------------------------------------------------------------- /sample/CSharp/QueueTrigger/run.csx: -------------------------------------------------------------------------------- 1 | #load "..\Shared\Message.csx" 2 | 3 | public static string Run(Message message, TraceWriter log) 4 | { 5 | log.Info($"C# Queue trigger function processed message: {message.Id}"); 6 | return message.Value; 7 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/ManualTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/TimeoutToken/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/TwilioReference/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/ListenerExceptions/TimerTrigger/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, timerInfo) { 2 | var timeStamp = new Date().toISOString(); 3 | context.log('Timer function ran! ', timeStamp); 4 | context.done(); 5 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/ManualTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/SingleNamedExport/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/MultipleTriggers/run.csx: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Extensions.Primitives; 4 | 5 | public static IActionResult Run(HttpRequest req) 6 | { 7 | return new OkResult(); 8 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/QueueTriggerToBlob/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input) { 2 | var json = JSON.stringify(input); 3 | context.log('Node.js script processed queue message', json); 4 | context.done(null, json); 5 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/OutOfDateExtension/bin/Microsoft.Azure.WebJobs.Extensions.Storage.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-functions-host/HEAD/test/Resources/TestScripts/OutOfDateExtension/bin/Microsoft.Azure.WebJobs.Extensions.Storage.dll -------------------------------------------------------------------------------- /test/Resources/TestScripts/OutOfDateExtension/bin/Microsoft.Azure.WebJobs.Extensions.DurableTask.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-functions-host/HEAD/test/Resources/TestScripts/OutOfDateExtension/bin/Microsoft.Azure.WebJobs.Extensions.DurableTask.dll -------------------------------------------------------------------------------- /test/Resources/TestScripts/WarmupFunction/warmup/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "warmupTrigger", 5 | "direction": "in", 6 | "name": "warmupContext" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /perf/Apps/HelloHttpNet9/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Functions.Worker.Builder; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | var builder = FunctionsApplication.CreateBuilder(args); 5 | 6 | builder.ConfigureFunctionsWebApplication(); 7 | 8 | builder.Build().Run(); 9 | -------------------------------------------------------------------------------- /sample/CSharp/TimerTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "timerTrigger", 5 | "name": "timerInfo", 6 | "schedule": "0 * * * * *", 7 | "direction": "in" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/ListenerExceptions/ListenerStartupException/index.js: -------------------------------------------------------------------------------- 1 | var util = require('util'); 2 | 3 | module.exports = function (context, input) { 4 | context.log(util.format("Node.js script processed %d events", input.length)); 5 | context.done(); 6 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/MobileTableOut/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input) { 2 | context.log('Node.js function triggered with input', input); 3 | 4 | context.bindings.item = { 5 | id: input 6 | }; 7 | 8 | context.done(); 9 | } -------------------------------------------------------------------------------- /perf/Apps/TimerAppNet9/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Functions.Worker.Builder; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | var builder = FunctionsApplication.CreateBuilder(args); 5 | builder.ConfigureFunctionsWebApplication(); 6 | 7 | await builder.Build().RunAsync(); 8 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/OneSecondTimer/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "timerTrigger", 5 | "name": "timerInfo", 6 | "schedule": "*/1 * * * * *", 7 | "direction": "in" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/MultipleExports/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoint": "doIt", 3 | "bindings": [ 4 | { 5 | "type": "manualTrigger", 6 | "name": "input", 7 | "direction": "in" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/TimerTrigger/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, timerInfo) { 2 | var timeStamp = new Date().toISOString(); 3 | context.log('Timer function ran! ', timeStamp); 4 | context.bindings.output = __dirname; 5 | context.done(); 6 | } -------------------------------------------------------------------------------- /eng/build/Engineering.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/TestWorkers/ProbingPaths/functionsworkers/dotnet-isolated/1.0.0/worker.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": { 3 | "language": "dotnet-isolated", 4 | "extensions": [ ".dll" ], 5 | "workerIndexing": "true", 6 | "defaultExecutablePath": "worker.config.json" 7 | } 8 | } -------------------------------------------------------------------------------- /sample/CustomHandler/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "customHandler": { 4 | "enableForwardingHttpRequest": true, 5 | "description": { 6 | "defaultExecutablePath": "node", 7 | "arguments": [ "server.js" ] 8 | }, 9 | "port": "3456" 10 | } 11 | } -------------------------------------------------------------------------------- /sample/Node/HttpTrigger-CustomRoute-Post/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, req) { 2 | context.bindings.product = req.body; 3 | 4 | var res = { 5 | status: 201, 6 | body: 'Product created' 7 | }; 8 | 9 | context.done(null, res); 10 | } 11 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/NotificationHubNative/run.csx: -------------------------------------------------------------------------------- 1 | public static void Run(string input, out string wnsToastPayload) 2 | { 3 | wnsToastPayload = "Test message from C#"; 4 | } 5 | -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/TestFixture/HostOptionsProviderTests/TestWihtoutIOptionsFormatter.json: -------------------------------------------------------------------------------- 1 | { 2 | "concurrency": { 3 | "dynamicConcurrencyEnabled": false, 4 | "maximumFunctionConcurrency": 500, 5 | "cpuThreshold": 0.8, 6 | "snapshotPersistenceEnabled": true 7 | } 8 | } -------------------------------------------------------------------------------- /sample/Node/DocumentDB/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input) { 2 | context.log('Node.js queue-triggered DocumentDB function called with input', input); 3 | 4 | var item = { 5 | text: "Hello from Node! " + input 6 | }; 7 | 8 | context.done(null, item); 9 | } -------------------------------------------------------------------------------- /sample/Node/HttpTrigger-Disabled/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, req) { 2 | context.log('Node.js HTTP trigger function invoked!'); 3 | 4 | context.res = { 5 | status: 200, 6 | body: 'Hello World!' 7 | }; 8 | 9 | context.done(); 10 | } 11 | -------------------------------------------------------------------------------- /sample/Node/MobileTable/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input) { 2 | context.log('Node.js queue-triggered MobileTable-Node function called with input', input); 3 | 4 | var item = { 5 | Text: "Hello from Node! " + input 6 | }; 7 | 8 | context.done(null, item); 9 | } -------------------------------------------------------------------------------- /src/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | true 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/ServiceBusTopicOutput/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, trigger) { 2 | context.log("Trigger: " + trigger); 3 | context.bindings.output = trigger + "-completed"; 4 | context.bindings.completed = context.bindings.output; 5 | context.done(); 6 | } -------------------------------------------------------------------------------- /eng/ci/templates/variables/benchmarks.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | - name: storeBenchmarkResultsInDatabase 3 | value: ${{ eq(variables['Build.Reason'], 'Schedule') }} 4 | - name: benchmarkBaselineBranch 5 | value: refs/heads/release/4.x 6 | - name: benchmarkBaselineTagName 7 | value: AzFunc.Perf.Baseline 8 | -------------------------------------------------------------------------------- /test/Resources/TestProjects/DotNetIsolated60/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "appInsights1": { 4 | "type": "appInsights" 5 | }, 6 | "storage1": { 7 | "type": "storage", 8 | "connectionId": "AzureWebJobsStorage" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $(ArtifactsPath)/log/$(ArtifactsProjectName)/tests_$(ArtifactsPivots)/ 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/ServiceBusQueueTriggerAndOutput/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, trigger) { 2 | context.log("Trigger: " + trigger); 3 | context.bindings.output = trigger + "-completed"; 4 | context.bindings.completed = context.bindings.output; 5 | context.done(); 6 | } -------------------------------------------------------------------------------- /eng/ci/templates/variables/build.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | - name: DOTNET_NOLOGO 3 | value: 1 4 | - name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE 5 | value: 1 6 | - name: DOTNET_CLI_TELEMETRY_OPTOUT 7 | value: 1 8 | - name: Build.Counter 9 | value: $[counter(format('{0:yyyyMMdd}', pipeline.startTime), 0)] 10 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CustomHeadersMiddleware/Node/HttpTrigger/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, req) { 2 | context.log('Node.js HTTP trigger function processed a request.'); 3 | 4 | const res = { 5 | status: 200, 6 | }; 7 | 8 | context.done(null, res); 9 | }; 10 | -------------------------------------------------------------------------------- /test/Resources/TestProjects/DotNetIsolated60/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /test/Resources/TestProjects/ReferenceOlderRuntimeAssembly/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "appInsights1": { 4 | "type": "appInsights" 5 | }, 6 | "storage1": { 7 | "type": "storage", 8 | "connectionId": "AzureWebJobsStorage" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/FunctionGeneration/HttpTrigger-FSharp/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "direction": "in", 6 | "methods": [ "get" ] 7 | }, 8 | { 9 | "type": "http", 10 | "direction": "out" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nodeapp", 3 | "version": "1.0.0", 4 | "description": "", 5 | "scripts": { 6 | "start": "func start", 7 | "test": "echo \"No tests yet...\"" 8 | }, 9 | "dependencies": {}, 10 | "devDependencies": {}, 11 | "main": "index.js" 12 | } -------------------------------------------------------------------------------- /test/Resources/TestProjects/DotNetIsolated60/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "appInsights1": { 4 | "type": "appInsights.sdk" 5 | }, 6 | "storage1": { 7 | "type": "storage.emulator", 8 | "connectionId": "AzureWebJobsStorage" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/TimeoutSync/run.csx: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | 3 | public static void Run(string inputData, TraceWriter log) 4 | { 5 | log.Info(inputData); 6 | 7 | int count = 0; 8 | while (count < 10) 9 | { 10 | count++; 11 | Thread.Sleep(1000); 12 | } 13 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/WebHookTrigger/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, payload) { 2 | context.log('Webhook was triggered!'); 3 | if (payload) { 4 | context.res.send('WebHook processed successfully! ' + payload.a); 5 | } else { 6 | context.res.send('No content'); 7 | } 8 | } -------------------------------------------------------------------------------- /eng/build/Workers.Python.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sample/CSharp/CosmosDBTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "cosmosDBTrigger", 5 | "name": "input", 6 | "direction": "in", 7 | "databaseName": "ItemDb", 8 | "collectionName": "ItemCollection" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /test/Resources/TestProjects/AssemblyLoadContextRace/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingExcludedTypes": "Request", 6 | "samplingSettings": { 7 | "isEnabled": true 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/CosmosDBTrigger/run.csx: -------------------------------------------------------------------------------- 1 | #r "Microsoft.Azure.DocumentDB.Core" 2 | 3 | using Microsoft.Azure.Documents; 4 | using System.Collections.Generic; 5 | using System; 6 | 7 | public static void Run(IReadOnlyList input, out string completed) 8 | { 9 | completed = input[0].Id; 10 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/TwilioReference/run.csx: -------------------------------------------------------------------------------- 1 | #r "Twilio" 2 | 3 | using Twilio.Rest.Api.V2010.Account; 4 | using Twilio.Types; 5 | 6 | public static void Run(string input, TraceWriter log) 7 | { 8 | var message = new CreateMessageOptions(new PhoneNumber("+1704XXXXXXX")); 9 | log.Info(input); 10 | } -------------------------------------------------------------------------------- /sample/CSharp/HttpTriggerWithObject/run.csx: -------------------------------------------------------------------------------- 1 | public static TestObject Run(TestObject req) 2 | { 3 | req.Greeting = $"Hello, {req.SenderName}"; 4 | 5 | return req; 6 | } 7 | 8 | public class TestObject 9 | { 10 | public string SenderName { get; set; } 11 | 12 | public string Greeting { get; set; } 13 | } -------------------------------------------------------------------------------- /test/Resources/TestProjects/MultipleDependencyVersions/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingExcludedTypes": "Request", 6 | "samplingSettings": { 7 | "isEnabled": true 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /test/Resources/TestProjects/NativeDependencyNoRuntimes/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingExcludedTypes": "Request", 6 | "samplingSettings": { 7 | "isEnabled": true 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/AssembliesFromSharedLocation/run.csx: -------------------------------------------------------------------------------- 1 | #r "..\SharedAssemblies\PrimaryDependency.dll" 2 | 3 | using PrimaryDependency; 4 | using Microsoft.AspNetCore.Mvc; 5 | 6 | public static IActionResult Run(HttpRequest req, TraceWriter log) 7 | { 8 | return new OkObjectResult(new Primary().GetValue()); 9 | } -------------------------------------------------------------------------------- /test/Resources/TestProjects/ReferenceOlderRuntimeAssembly/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "appInsights1": { 4 | "type": "appInsights.sdk" 5 | }, 6 | "storage1": { 7 | "type": "storage.emulator", 8 | "connectionId": "AzureWebJobsStorage" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /test/Resources/TestProjects/ReferenceOlderRuntimeAssembly/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingExcludedTypes": "Request", 6 | "samplingSettings": { 7 | "isEnabled": true 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /perf/Apps/HelloHttpNet9/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/Resources/TestScripts/ListenerExceptions/TimerTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "timerTrigger", 5 | "name": "timerInfo", 6 | "direction": "in", 7 | "runOnStartup": true, 8 | "schedule": "*/2 * * * * *" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/EventHubSender/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input) { 2 | context.log('Node.js function triggered with input' , input); 3 | 4 | // queue to event hub 5 | context.bindings.output = { 6 | prop1: "from test", 7 | id: input 8 | }; 9 | 10 | context.done(); 11 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/SingleNamedExport/index.js: -------------------------------------------------------------------------------- 1 | var util = require('util'); 2 | 3 | module.exports.myFunc = function (context) { 4 | var log = util.format("Exports: IsObject=%s, Count=%d", 5 | util.isObject(module.exports), 6 | Object.keys(module.exports).length); 7 | context.log(log); 8 | context.done(); 9 | } -------------------------------------------------------------------------------- /test/Resources/TestProjects/Dependency55/TypeGetter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.IdentityModel.Tokens; 3 | 4 | namespace Dependency55 5 | { 6 | public static class TypeGetter 7 | { 8 | public static Type ReturnSecurityKeyType() 9 | { 10 | return typeof(SecurityKey); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/Resources/TestProjects/Dependency56/TypeGetter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.IdentityModel.Tokens; 3 | 4 | namespace Dependency56 5 | { 6 | public static class TypeGetter 7 | { 8 | public static Type ReturnSecurityKeyType() 9 | { 10 | return typeof(SecurityKey); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/ProxiesOnly/proxies.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/proxies", 3 | "proxies": { 4 | "testproxy2": { 5 | "matchCondition": { 6 | "route": "/mthttp2" 7 | }, 8 | "backendUri": "https://testapp.azurewebsites.net/api/HttpTriggerCSharp1?name=test" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /tools/ExtensionsMetadataGenerator/test/TestProject_Razor/AssemblyAttribute.cs: -------------------------------------------------------------------------------- 1 | // This attribute will not be resolve-able because the Razor.Runtime assembly will not be 2 | // present in the output directory. This is used by tests to ensure we don't crash. 3 | [assembly: Microsoft.AspNetCore.Razor.Hosting.RazorExtensionAssemblyName("something", "something")] -------------------------------------------------------------------------------- /perf/Apps/HelloHttpNet9NoProxy/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 | } -------------------------------------------------------------------------------- /src/WebJobs.Script/Host/IDebugManager.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.Script 5 | { 6 | public interface IDebugManager 7 | { 8 | void NotifyDebug(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/StorageReferenceV12/run.csx: -------------------------------------------------------------------------------- 1 | // Use storage v12 2 | #r "Azure.Storage.Blobs" 3 | 4 | using Azure.Storage.Blobs; 5 | 6 | public static void Run(string input, TraceWriter log) 7 | { 8 | // it is enough to just reference the type; compilation should fail 9 | BlobClient blobClient; 10 | log.Info(input); 11 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/General_question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "General question" 3 | about: Questions related to Azure Functions and the host 4 | 5 | --- 6 | 7 | #### Is your question related to a specific version? If so, please specify: 8 | 9 | #### What language does your question apply to? (e.g. C#, JavaScript, Java, All) 10 | 11 | #### Question 12 | -------------------------------------------------------------------------------- /eng/ci/merge-mirror.yml: -------------------------------------------------------------------------------- 1 | trigger: 2 | branches: 3 | include: 4 | - release/* 5 | 6 | resources: 7 | repositories: 8 | - repository: eng 9 | type: git 10 | name: engineering 11 | ref: refs/tags/release 12 | 13 | variables: 14 | - template: ci/variables/cfs.yml@eng 15 | 16 | extends: 17 | template: ci/merge-mirror.yml@eng 18 | -------------------------------------------------------------------------------- /test/TestWorkers/ProbingPaths/functionsworkers/java/2.18.0/worker.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": { 3 | "language": "java", 4 | "extensions": [".jar"], 5 | "defaultExecutablePath": "%JAVA_HOME%/bin/java", 6 | "defaultWorkerPath": "worker.config.json", 7 | "arguments": [] 8 | }, 9 | "profiles": [] 10 | } -------------------------------------------------------------------------------- /sample/Node/QueueTrigger/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, workItem) { 2 | context.log('Node.js queue trigger function processed work item', workItem.id); 3 | 4 | context.log('DequeueCount=%s', context.bindingData.dequeueCount); 5 | context.log('InsertionTime=%s', context.bindingData.insertionTime); 6 | 7 | context.done(null, workItem); 8 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/NotificationHubNative/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input) { 2 | context.log('Sending native windows toast notification...'); 3 | context.bindings.wnsToastPayload = "Test message from Node!"; 4 | context.done(); 5 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/TableIn/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input) { 2 | var result = { 3 | single: context.bindings.single, 4 | partition: context.bindings.partition, 5 | query: context.bindings.query 6 | }; 7 | 8 | context.log('Result: ', JSON.stringify(result)); 9 | 10 | context.done(); 11 | } -------------------------------------------------------------------------------- /sample/CSharp/ManualTrigger/run.csx: -------------------------------------------------------------------------------- 1 | public static string Run(Input input, string blobIn, TraceWriter log) 2 | { 3 | log.Info($"C# manually triggered function called: InId: {input.InId}, OutId: {input.OutId}"); 4 | return blobIn; 5 | } 6 | 7 | public class Input 8 | { 9 | public string InId { get; set; } 10 | public string OutId { get; set; } 11 | } -------------------------------------------------------------------------------- /sample/HttpWorker/HttpTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "direction": "in", 6 | "name": "req", 7 | "methods": [ 8 | "get", 9 | "post" 10 | ] 11 | }, 12 | { 13 | "type": "http", 14 | "direction": "out", 15 | "name": "res" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /sample/NodeResume/HttpTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "direction": "in", 6 | "name": "req", 7 | "methods": [ 8 | "get", 9 | "post" 10 | ] 11 | }, 12 | { 13 | "type": "http", 14 | "direction": "out", 15 | "name": "res" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/HttpTriggerByteArray/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "dataType": "binary" 8 | }, 9 | { 10 | "type": "http", 11 | "name": "res", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /sample/CSharp/HttpTrigger-AdminLevel/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ], 8 | "authLevel": "admin" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "$return", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /sample/CustomHandler/HttpTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "direction": "in", 6 | "name": "req", 7 | "methods": [ 8 | "get", 9 | "post" 10 | ] 11 | }, 12 | { 13 | "type": "http", 14 | "direction": "out", 15 | "name": "res" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/HttpTrigger-Redirect/run.csx: -------------------------------------------------------------------------------- 1 | #r "Newtonsoft.Json" 2 | 3 | using System.Net; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.Extensions.Primitives; 6 | using Newtonsoft.Json; 7 | 8 | public static async Task Run(HttpRequest req, ILogger log) 9 | { 10 | return new RedirectResult("http://bing.com"); 11 | } 12 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/LoadScriptReference/run.csx: -------------------------------------------------------------------------------- 1 | #load "Class.csx" 2 | 3 | using System.Net; 4 | using Microsoft.AspNetCore.Mvc; 5 | 6 | public static IActionResult Run(HttpRequest req, ILogger log) 7 | { 8 | string response = new Test().Response; 9 | log.LogInformation("response: " + response); 10 | return new OkObjectResult(response); 11 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/TimeoutSync/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, timerInfo) { 2 | context.log(context.bindings.input); 3 | 4 | // Run for 30 seconds before closing. Test will timeout in 3 seconds but this cleans up. 5 | var stop = new Date().getTime() + 10000; 6 | while (new Date().getTime() <= stop) { } 7 | context.done(); 8 | } -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/Description/DotNet/TestFiles/PackageReferences/ProjectWithoutLock/function.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /perf/Apps/HelloHttpNode/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nodeapp", 3 | "version": "1.0.0", 4 | "description": "", 5 | "scripts": { 6 | "start": "func start", 7 | "test": "echo \"No tests yet...\"" 8 | }, 9 | "dependencies": { 10 | "@azure/functions": "^4.0.0" 11 | }, 12 | "devDependencies": {}, 13 | "main": "src/{index.js,functions/*.js}" 14 | } 15 | -------------------------------------------------------------------------------- /sample/CSharp/CosmosDBTrigger/run.csx: -------------------------------------------------------------------------------- 1 | #r "Microsoft.Azure.Documents.Client" 2 | using Microsoft.Azure.Documents; 3 | using System.Collections.Generic; 4 | using System; 5 | public static void Run(IReadOnlyList input, TraceWriter log) 6 | { 7 | log.Verbose("Documents modified " + input.Count); 8 | log.Verbose("First document Id " + input[0].Id); 9 | } 10 | -------------------------------------------------------------------------------- /src/WebJobs.Script/FileProvisioning/PowerShell/requirements.psd1: -------------------------------------------------------------------------------- 1 | # This file enables modules to be automatically managed by the Functions service. 2 | # See https://aka.ms/functionsmanageddependency for additional information. 3 | # 4 | @{ 5 | # For latest supported version, go to 'https://www.powershellgallery.com/packages/Az'. GUIDANCE 6 | # 'Az' = 'MAJOR_VERSION.*' 7 | } 8 | -------------------------------------------------------------------------------- /test/Resources/TestProjects/DotNetIsolatedUnsupportedWorker/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/Resources/TestScripts/CustomHeadersMiddleware/CSharp/HttpTrigger/run.csx: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Extensions.Primitives; 4 | 5 | public static IActionResult Run(HttpRequest req, TraceWriter log) 6 | { 7 | log.Info("C# HTTP trigger function processed a request."); 8 | 9 | return new OkObjectResult("Success"); 10 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/src/WebJobs.Script.WebHost/WebJobs.Script.WebHost.csproj" 11 | ], 12 | "problemMatcher": "$msCompile" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /sample/CSharp/HttpTrigger-AnonymousLevel/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ], 8 | "authLevel": "anonymous" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "$return", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /sample/Node/NotificationHub/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input) { 2 | context.log('Queue triggerd Node.js function input:', input); 3 | context.log('Sending Template Notification...'); 4 | 5 | var notification = { 6 | message: "Hello from Node! ", 7 | location:"Redmond" 8 | }; 9 | 10 | context.done(null, notification); 11 | } -------------------------------------------------------------------------------- /sample/NodeRetry/HttpTrigger-RetryHostJson/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "direction": "in", 6 | "name": "req", 7 | "methods": [ 8 | "get", 9 | "post" 10 | ] 11 | }, 12 | { 13 | "type": "http", 14 | "direction": "out", 15 | "name": "res" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /test/Resources/TestProjects/DotNetCustomHandler/DotNetCustomHandler.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | true 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /perf/Apps/HelloHttpNode/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | }, 11 | "extensionBundle": { 12 | "id": "Microsoft.Azure.Functions.ExtensionBundle", 13 | "version": "[4.*, 5.0.0)" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sample/Node/HttpTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ] 8 | }, 9 | { 10 | "type": "http", 11 | "name": "$return", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /sample/PythonWorkerIndexing/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | }, 11 | "extensionBundle": { 12 | "id": "Microsoft.Azure.Functions.ExtensionBundle", 13 | "version": "[2.*, 3.0.0)" 14 | } 15 | } -------------------------------------------------------------------------------- /src/WebJobs.Script/Config/IConfigureBuilder.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.Script 5 | { 6 | public interface IConfigureBuilder 7 | { 8 | void Configure(TBuilder builder); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/QueueTriggerToBlob/run.csx: -------------------------------------------------------------------------------- 1 | public static string Run(WorkItem input, TraceWriter log) 2 | { 3 | string json = string.Format("{{ \"id\": \"{0}\" }}", input.Id); 4 | 5 | log.Info($"C# script processed queue message. Item={json}"); 6 | 7 | return json; 8 | } 9 | 10 | public class WorkItem 11 | { 12 | public string Id { get; set; } 13 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CustomHeadersMiddleware/Node/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "extensions": { 4 | "durableTask": { 5 | "hubName": "CustomHeadersMiddlewareNodeTestHub" 6 | }, 7 | "http": { 8 | "customHeaders": { 9 | "X-Content-Type-Options": "nosniff" 10 | } 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /test/TestWorkers/ProbingPaths/functionsworkers/java/2.19.0/worker.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": { 3 | "language": "java", 4 | "extensions": [".jar"], 5 | "defaultExecutablePath": "%JAVA_HOME%/bin/java", 6 | "defaultWorkerPath": "worker.config.json", 7 | "arguments": [] 8 | }, 9 | "hostRequirements": [], 10 | "profiles": [] 11 | } -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/TestFixture/ExtensionRequirementOptionsTests/FunctionsHostingEnvironmentConfig_bundlesOnly.json: -------------------------------------------------------------------------------- 1 | { 2 | "HostingEnvironmentConfig": { 3 | "extensionRequirements": { 4 | "bundles": [ 5 | { 6 | "id": "Microsoft.Azure.Functions.ExtensionBundle", 7 | "minimumVersion": "4.12.0" 8 | } 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /eng/ci/code-mirror.yml: -------------------------------------------------------------------------------- 1 | trigger: 2 | branches: 3 | include: 4 | - dev 5 | - in-proc 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 | -------------------------------------------------------------------------------- /sample/CSharp/HttpTrigger-Compat/function.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sample/CSharp/HttpTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ] 8 | }, 9 | { 10 | "type": "http", 11 | "name": "$return", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /sample/CustomHandlerRetry/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "customHandler": { 4 | "enableForwardingHttpRequest": false, 5 | "description": { 6 | "defaultExecutablePath": "node", 7 | "arguments": [ "server.js" ] 8 | } 9 | }, 10 | "retry": { 11 | "strategy": "fixedDelay", 12 | "maxRetryCount": 2, 13 | "delayInterval": "00:00:00" 14 | } 15 | } -------------------------------------------------------------------------------- /sample/Node/EventHubTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "eventHubTrigger", 5 | "name": "input", 6 | "cardinality": "many", 7 | "direction": "in", 8 | "connection": "AzureWebJobsEventHubReceiver", 9 | "eventHubName": "%AzureWebJobsEventHubPath%" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /sample/Node/HttpTrigger-Disabled/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ] 8 | }, 9 | { 10 | "type": "http", 11 | "name": "res", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Models/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.WebJobs.Script.WebHost.Models 5 | { 6 | public class FunctionInvocation 7 | { 8 | public string Input { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "WebJobs.Script.WebHost": { 4 | "commandName": "Project", 5 | "launchBrowser": true, 6 | "environmentVariables": { 7 | "ASPNETCORE_ENVIRONMENT": "Development" 8 | }, 9 | "applicationUrl": "https://localhost:62513;http://localhost:62514" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Diagnostics/IFileWriterFactory.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.Script 5 | { 6 | internal interface IFileWriterFactory 7 | { 8 | IFileWriter Create(string filePath); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Host/IFileLoggingStatusManager.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.Script 5 | { 6 | public interface IFileLoggingStatusManager 7 | { 8 | bool IsFileLoggingEnabled { get; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/FunctionIndexingError/run.csx: -------------------------------------------------------------------------------- 1 | public static string Run(WorkItem input, TraceWriter log) 2 | { 3 | string json = string.Format("{{ \"id\": \"{0}\" }}", input.Id); 4 | 5 | log.Info($"C# script processed queue message. Item={json}"); 6 | 7 | return json; 8 | } 9 | 10 | public class WorkItem 11 | { 12 | public string Id { get; set; } 13 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/NotificationHubOut/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | }, 8 | { 9 | "type": "notificationHub", 10 | "name": "$return", 11 | "direction": "out" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CustomHeadersMiddleware/CSharp/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "extensions": { 4 | "durableTask": { 5 | "hubName": "CustomHeadersMiddlewareCSharpTestHub" 6 | }, 7 | "http": { 8 | "customHeaders": { 9 | "X-Content-Type-Options": "nosniff" 10 | } 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /sample/CSharp/HttpTrigger-Compat/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ] 8 | }, 9 | { 10 | "type": "http", 11 | "name": "$return", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /sample/CSharp/HttpTriggerWithObject/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "post" ] 8 | }, 9 | { 10 | "type": "http", 11 | "name": "res", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /sample/Node/HttpTrigger-Promise/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ] 8 | }, 9 | { 10 | "type": "http", 11 | "name": "$return", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /sample/Node/HttpTrigger-Timeout/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ] 8 | }, 9 | { 10 | "type": "http", 11 | "name": "$return", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /sample/NodeDrain/HttpTrigger-LongRun/index.js: -------------------------------------------------------------------------------- 1 | var errorString = 'An error occurred'; 2 | 3 | function delay(delayInms) { 4 | return new Promise(resolve => { 5 | setTimeout(() => { 6 | resolve(2); 7 | }, delayInms); 8 | }); 9 | } 10 | 11 | module.exports = async function (context, req) { 12 | await delay(1000); 13 | throw new Error(errorString); 14 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Security/KeyManagement/ScriptSecretsType.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.Script.WebHost 5 | { 6 | public enum ScriptSecretsType 7 | { 8 | Host, 9 | Function 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/WebJobs.Script/ErrorCodes.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.WebJobs.Script 7 | { 8 | public static class ErrorCodes 9 | { 10 | public const int KeyCryptographicError = 1000; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/MobileTableIn/run.csx: -------------------------------------------------------------------------------- 1 | #r "Newtonsoft.Json" 2 | 3 | using Newtonsoft.Json.Linq; 4 | 5 | public static void Run(QueueInput input, JObject item, TraceWriter log) 6 | { 7 | item["Text"] = "This was updated!"; 8 | 9 | log.Info($"Updating item {item["Id"]}"); 10 | } 11 | 12 | public class QueueInput 13 | { 14 | public string RecordId { get; set; } 15 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/NotificationHubOut/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | }, 8 | { 9 | "type": "notificationHub", 10 | "name": "notification", 11 | "direction": "out" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/NotificationHubOut/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input) { 2 | context.log('Queue triggerd Node.js function input:', input); 3 | context.log('Sending Template Notification...'); 4 | 5 | context.bindings.notification = { 6 | location: "Redmond", 7 | message: "Hello from Node!" 8 | }; 9 | 10 | context.done(); 11 | } -------------------------------------------------------------------------------- /sample/CSharp/HttpTrigger-Cancellation/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ] 8 | }, 9 | { 10 | "type": "http", 11 | "name": "$return", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /sample/Node/ManualTrigger/index.js: -------------------------------------------------------------------------------- 1 | var util = require('util'); 2 | 3 | module.exports = function (context, input) { 4 | context.log('Node.js manually triggered function called with input', input); 5 | 6 | var blobIn = context.bindings.blobIn; 7 | context.log('First: %s Last:%s', blobIn.first, blobIn.last); 8 | 9 | context.done(null, util.format(blobIn.first, blobIn.last)); 10 | } -------------------------------------------------------------------------------- /sample/NodeWithoutBundle/HttpTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ] 8 | }, 9 | { 10 | "type": "http", 11 | "name": "$return", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/WebJobs.Script.Grpc/Http/Configuration/CustomHandlerType.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.Script.Workers.Http 5 | { 6 | internal enum CustomHandlerType 7 | { 8 | Http = 0, 9 | None = 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Models/CodePackageType.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.WebJobs.Script.WebHost.Models 7 | { 8 | public enum CodePackageType 9 | { 10 | Squashfs, 11 | Zip 12 | } 13 | } -------------------------------------------------------------------------------- /src/WebJobs.Script/Diagnostics/IFileWriter.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.Script 5 | { 6 | internal interface IFileWriter 7 | { 8 | void AppendLine(string line); 9 | 10 | void Flush(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Http/IHttpRoutesManager.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.Script 5 | { 6 | public interface IHttpRoutesManager 7 | { 8 | void InitializeHttpFunctionRoutes(IScriptJobHost host); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /sample/CSharp/BlobTrigger/run.csx: -------------------------------------------------------------------------------- 1 | #r "Microsoft.Azure.Storage" 2 | 3 | using Microsoft.Azure.Storage.Blob; 4 | 5 | public static async Task Run(CloudBlockBlob blob, CloudBlockBlob output, TraceWriter log) 6 | { 7 | string content = await blob.DownloadTextAsync(); 8 | log.Info($"C# Blob trigger function processed a blob. Blob={content}"); 9 | 10 | await output.UploadTextAsync(content); 11 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CustomHeadersMiddleware/Node/HttpTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ], 8 | "authLevel": "anonymous" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "$return", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/Description/DotNet/TestFiles/PackageReferences/ProjectWithMismatchedLock/MismatchedPackageVersions/function.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sample/CustomHandlerRetry/HttpTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "authLevel": "anonymous", 5 | "type": "httpTrigger", 6 | "direction": "in", 7 | "name": "req", 8 | "methods": [ 9 | "get", 10 | "post" 11 | ] 12 | }, 13 | { 14 | "type": "http", 15 | "direction": "out", 16 | "name": "res" 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.Grpc/Channel/IInvocationMessageDispatcherFactory.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.Script.Grpc; 5 | 6 | internal interface IInvocationMessageDispatcherFactory 7 | { 8 | IInvocationMessageDispatcher Create(string invocationId); 9 | } -------------------------------------------------------------------------------- /test/Resources/TestProjects/DotNetCustomHandler/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "extensionBundle": { 4 | "id": "Microsoft.Azure.Functions.ExtensionBundle", 5 | "version": "[4.*, 5.0.0)" 6 | }, 7 | "customHandler": { 8 | "description": { 9 | "defaultExecutablePath": "DotNetCustomHandler.exe" 10 | }, 11 | "enableProxyingHttpRequest": true 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/NotificationHubOutNotification/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | }, 8 | { 9 | "type": "notificationHub", 10 | "name": "notification", 11 | "direction": "out" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CustomHeadersMiddleware/CSharp/HttpTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ], 8 | "authLevel": "anonymous" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "$return", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/Invalid/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "invalid", 7 | "methods": [ "get", "post" ] 8 | }, 9 | { 10 | "type": "http", 11 | "name": "res", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/TableOut/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | }, 8 | { 9 | "type": "table", 10 | "name": "items", 11 | "direction": "out", 12 | "tableName": "testoutput" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/WebJobs.Script.Abstractions/Description/Binding/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.WebJobs.Script.Description 5 | { 6 | public enum BindingDirection 7 | { 8 | In, 9 | Out, 10 | InOut 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Models/ExtensionReferences.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.Script.Models 5 | { 6 | public sealed class ExtensionReferences 7 | { 8 | public ExtensionReference[] Extensions { get; init; } = []; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/CosmosDBOut/run.csx: -------------------------------------------------------------------------------- 1 | public static object Run(string input, ICollector relatedItems) 2 | { 3 | // a later stage of the test will query for these 4 | for (int i = 0; i < 3; i++) 5 | { 6 | relatedItems.Add(new { related = input }); 7 | } 8 | 9 | return new 10 | { 11 | id = input, 12 | text = "Hello from C#!" 13 | }; 14 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/ListenerExceptions/ListenerStartupException/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "eventHubTrigger", 5 | "name": "input", 6 | "cardinality": "many", 7 | "direction": "in", 8 | "connection": "AzureWebJobsEventHubReceiver", 9 | "eventHubName": "InvalidHubName" 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Proxies/PingRoute/run.csx: -------------------------------------------------------------------------------- 1 | public static string Run(HttpRequestMessage req) 2 | { 3 | if (req.Headers.Contains("return_incoming_url")) 4 | { 5 | return req.RequestUri.OriginalString; 6 | } 7 | else if (req.Headers.Contains("return_empty_body")) 8 | { 9 | return null; 10 | } 11 | else 12 | { 13 | return "Pong"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sample/Node/proxies.json: -------------------------------------------------------------------------------- 1 | { 2 | "proxies": { 3 | "proxyroute": { 4 | "matchCondition": { 5 | "methods": [ 6 | "GET" 7 | ], 8 | "route": "/something" 9 | }, 10 | "responseOverrides": { 11 | "response.statusCode": "200", 12 | "response.headers.Content-Type": "text/plain", 13 | "response.body": "something" 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Diagnostics/ILinuxAppServiceFileLogger.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.Script.WebHost.Diagnostics 5 | { 6 | public interface ILinuxAppServiceFileLogger 7 | { 8 | public void Log(string message); 9 | } 10 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Models/ExtensionsRestoreStatus.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.Script.WebHost.Models 5 | { 6 | public enum ExtensionsRestoreStatus 7 | { 8 | Started, 9 | Succeeded, 10 | Failed 11 | } 12 | } -------------------------------------------------------------------------------- /src/WebJobs.Script/Description/DotNet/IMethodReference.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.Script.Description 5 | { 6 | public interface IMethodReference 7 | { 8 | string Name { get; } 9 | 10 | bool IsPublic { get; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/WebJobs.Script/ManagedDependencies/ManagedDependencyOptions.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.Script.ManagedDependencies 5 | { 6 | public class ManagedDependencyOptions 7 | { 8 | public bool Enabled { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/HttpTrigger-Model/run.csx: -------------------------------------------------------------------------------- 1 | 2 | public static TestPayload Run(TestPayload payload) 3 | { 4 | return payload; 5 | } 6 | 7 | public class TestPayload 8 | { 9 | public CustomType Custom { get; set; } 10 | 11 | public IEnumerable CustomEnumerable { get; set; } 12 | } 13 | 14 | public class CustomType 15 | { 16 | public string CustomProperty { get; set; } 17 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/MultipleOutputs/run.csx: -------------------------------------------------------------------------------- 1 | public static string Run(Input input, out string blob1, out string blob2, TraceWriter log) 2 | { 3 | blob1 = "Test Blob 1"; 4 | blob2 = "Test Blob 2"; 5 | 6 | return "Test Blob 3"; 7 | } 8 | 9 | public class Input 10 | { 11 | public string Id1 { get; set; } 12 | public string Id2 { get; set; } 13 | public string Id3 { get; set; } 14 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/HttpTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "request", 6 | "direction": "in", 7 | "methods": [ "get", "post" ] 8 | }, 9 | { 10 | "type": "http", 11 | "name": "response", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/Scenarios/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | }, 8 | { 9 | "type": "blob", 10 | "name": "blob", 11 | "direction": "out", 12 | "path": "{container}/{sys.randGuid}" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/WebHookTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "payload", 6 | "direction": "in", 7 | "webHookType": "genericJson" 8 | }, 9 | { 10 | "type": "http", 11 | "name": "res", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /test/Resources/TestProjects/Dependency55/Dependency55.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/Resources/TestProjects/Dependency56/Dependency56.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/HttpTrigger-Model-v2/run.csx: -------------------------------------------------------------------------------- 1 | 2 | public static TestPayload Run(TestPayload payload) 3 | { 4 | return payload; 5 | } 6 | 7 | public class TestPayload 8 | { 9 | public CustomType Custom { get; set; } 10 | 11 | public IEnumerable CustomEnumerable { get; set; } 12 | } 13 | 14 | public class CustomType 15 | { 16 | public string CustomProperty { get; set; } 17 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/QueueTriggerToBlobRichTypes/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "name": "input", 6 | "queueName": "test-input-csharp", 7 | "direction": "in" 8 | }, 9 | { 10 | "type": "blob", 11 | "name": "output", 12 | "direction": "inout", 13 | "path": "test-output-csharp/{id}" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/FunctionGeneration/HttpTrigger-CSharp/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ] 8 | }, 9 | { 10 | "type": "http", 11 | "name": "res", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/HttpTriggerPromise/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "request", 6 | "direction": "in", 7 | "methods": [ "get", "post" ] 8 | }, 9 | { 10 | "type": "http", 11 | "name": "response", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /tools/ExtensionsMetadataGenerator/test/TestProject_Razor/TestProject_Razor.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /sample/CSharp/NotificationHub/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "name": "input", 6 | "direction": "in", 7 | "queueName": "samples-notificationHub-csharp" 8 | }, 9 | { 10 | "type": "notificationHub", 11 | "name": "$return", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /sample/CustomHandler/proxies.json: -------------------------------------------------------------------------------- 1 | { 2 | "proxies": { 3 | "proxyroute": { 4 | "matchCondition": { 5 | "methods": [ 6 | "GET" 7 | ], 8 | "route": "/something" 9 | }, 10 | "responseOverrides": { 11 | "response.statusCode": "200", 12 | "response.headers.Content-Type": "text/plain", 13 | "response.body": "something" 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /sample/HttpWorker/proxies.json: -------------------------------------------------------------------------------- 1 | { 2 | "proxies": { 3 | "proxyroute": { 4 | "matchCondition": { 5 | "methods": [ 6 | "GET" 7 | ], 8 | "route": "/something" 9 | }, 10 | "responseOverrides": { 11 | "response.statusCode": "200", 12 | "response.headers.Content-Type": "text/plain", 13 | "response.body": "something" 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /sample/Java/HttpTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "scriptFile" : "HttpTrigger-1.0-SNAPSHOT.jar", 3 | "entryPoint" : "Microsoft.Azure.WebJobs.Script.Tests.EndToEnd.Function.run", 4 | "bindings" : [ { 5 | "type" : "httpTrigger", 6 | "direction" : "in", 7 | "methods" : [ "GET", "POST" ], 8 | "name" : "req" 9 | }, { 10 | "type" : "http", 11 | "direction" : "out", 12 | "name" : "$return" 13 | } ] 14 | } -------------------------------------------------------------------------------- /sample/Node/NotificationHub/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "name": "input", 6 | "direction": "in", 7 | "queueName": "samples-notificationHub-node" 8 | }, 9 | { 10 | "type": "notificationHub", 11 | "name": "$return", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/WebJobs.Script/CloudName.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.Script 5 | { 6 | public enum CloudName 7 | { 8 | Azure, 9 | Blackforest, 10 | Fairfax, 11 | Mooncake, 12 | USNat, 13 | USSec 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/HttpTriggerExpressApi/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "request", 6 | "direction": "in", 7 | "methods": [ "get", "post" ] 8 | }, 9 | { 10 | "type": "http", 11 | "name": "response", 12 | "direction": "out" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Proxies/Ping/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "authLevel": "anonymous", 5 | "name": "req", 6 | "type": "httpTrigger", 7 | "direction": "in" 8 | }, 9 | { 10 | "name": "$return", 11 | "type": "http", 12 | "direction": "out" 13 | } 14 | ], 15 | "disabled": false 16 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Proxies/PingAuth/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "authLevel": "function", 5 | "name": "req", 6 | "type": "httpTrigger", 7 | "direction": "in" 8 | }, 9 | { 10 | "name": "$return", 11 | "type": "http", 12 | "direction": "out" 13 | } 14 | ], 15 | "disabled": false 16 | } -------------------------------------------------------------------------------- /sample/PowerShell/HttpTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "disabled": false, 3 | "bindings": [ 4 | { 5 | "authLevel": "function", 6 | "type": "httpTrigger", 7 | "direction": "in", 8 | "name": "req", 9 | "methods": [ 10 | "get", 11 | "post" 12 | ] 13 | }, 14 | { 15 | "type": "http", 16 | "direction": "out", 17 | "name": "res" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /src/WebJobs.Script.Abstractions/Description/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 | using System; 5 | 6 | namespace Microsoft.Azure.WebJobs.Script.Description 7 | { 8 | public enum RetryStrategy 9 | { 10 | ExponentialBackoff = 0, 11 | FixedDelay = 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WebJobs.Script.Grpc/IFunctionInvocationDispatcherFactory.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.Script.Workers 5 | { 6 | internal interface IFunctionInvocationDispatcherFactory 7 | { 8 | IFunctionInvocationDispatcher GetFunctionDispatcher(); 9 | } 10 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/NotificationHubNative/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | }, 8 | { 9 | "type": "notificationHub", 10 | "direction": "out", 11 | "name": "wnsToastPayload", 12 | "platform": "wns" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/TestFixture/HostOptionsProviderTests/TestBasicBindings.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": { 3 | "test": { 4 | "config1": "test1", 5 | "config2": "test2", 6 | "config3": "default" 7 | } 8 | }, 9 | "concurrency": { 10 | "dynamicConcurrencyEnabled": false, 11 | "maximumFunctionConcurrency": 500, 12 | "cpuThreshold": 0.8, 13 | "snapshotPersistenceEnabled": true 14 | } 15 | } -------------------------------------------------------------------------------- /sample/CSharpBenchmark/HttpTriggerAnon/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "authLevel": "anonymous", 6 | "name": "req", 7 | "direction": "in", 8 | "methods": [ "get" ] 9 | }, 10 | { 11 | "type": "http", 12 | "name": "$return", 13 | "direction": "out" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /sample/Node/BlobTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "blobTrigger", 5 | "name": "blob", 6 | "direction": "in", 7 | "path": "samples-input/{name}" 8 | }, 9 | { 10 | "type": "blob", 11 | "name": "$return", 12 | "direction": "out", 13 | "path": "samples-output/{name}" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /sample/Python/HttpTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "scriptFile": "__init__.py", 3 | "bindings": [ 4 | { 5 | "authLevel": "anonymous", 6 | "type": "httpTrigger", 7 | "direction": "in", 8 | "name": "req", 9 | "methods": [ 10 | "get", 11 | "post" 12 | ] 13 | }, 14 | { 15 | "type": "http", 16 | "direction": "out", 17 | "name": "$return" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Diagnostics/IDiagnosticEventRepositoryFactory.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.Script.WebHost.Diagnostics 5 | { 6 | public interface IDiagnosticEventRepositoryFactory 7 | { 8 | IDiagnosticEventRepository Create(); 9 | } 10 | } -------------------------------------------------------------------------------- /src/WebJobs.Script/Models/ExtensionBundleDetails.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.Script.Models 5 | { 6 | public class ExtensionBundleDetails 7 | { 8 | public string Id { get; set; } 9 | 10 | public string Version { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/NotificationHubNative/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | }, 8 | { 9 | "type": "notificationHub", 10 | "name": "wnsToastPayload", 11 | "direction": "out", 12 | "platform": "wns" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/TimerTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "timerTrigger", 5 | "name": "timerInfo", 6 | "direction": "in", 7 | "runOnStartup": true, 8 | "schedule": "0 * * * * *" 9 | }, 10 | { 11 | "type": "blob", 12 | "name": "output", 13 | "direction": "out", 14 | "path": "test-output-node/testblob" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/TestFixture/HostOptionsProviderTests/TestBasicConcurrency.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": { 3 | "test": { 4 | "config1": "default", 5 | "config2": "default", 6 | "config3": "default" 7 | } 8 | }, 9 | "concurrency": { 10 | "dynamicConcurrencyEnabled": true, 11 | "maximumFunctionConcurrency": 20, 12 | "cpuThreshold": 0.8, 13 | "snapshotPersistenceEnabled": true 14 | } 15 | } -------------------------------------------------------------------------------- /sample/CSharp/HttpTrigger-Identities/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "authLevel": "anonymous", 8 | "methods": [ "get" ] 9 | }, 10 | { 11 | "type": "http", 12 | "name": "$return", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /sample/Node/TimerTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "timerTrigger", 5 | "name": "timerInfo", 6 | "direction": "in", 7 | "schedule": "0 * * * * *" 8 | }, 9 | { 10 | "type": "queue", 11 | "name": "messages", 12 | "direction": "out", 13 | "queueName": "samples-fsharp" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /sample/NodeResume/HttpTrigger/index.js: -------------------------------------------------------------------------------- 1 | function delay(ms) { 2 | return new Promise(resolve => { 3 | setTimeout(() => { 4 | resolve(2); 5 | }, ms); 6 | }); 7 | } 8 | 9 | module.exports = async function (context, req) { 10 | context.log('Node.js resume http trigger function processed a request'); 11 | await delay(5000); 12 | let res = { status: 200 }; 13 | context.done(null, res); 14 | }; 15 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/MobileTableOut/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | }, 8 | { 9 | "type": "mobileTable", 10 | "name": "$return", 11 | "direction": "out", 12 | "connection": "AzureWebJobs_TestMobileUri" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/HttpTriggerPromise/index.js: -------------------------------------------------------------------------------- 1 | var util = require('util'); 2 | 3 | module.exports = function (context, req) { 4 | context.log('Node.js HttpTrigger function invoked.'); 5 | 6 | return Promise.resolve({ 7 | // we should attempt to bind properties on the resolved object 8 | response: { 9 | status: 200, 10 | body: "returned from promise" 11 | } 12 | }); 13 | } -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/TestFixture/HostOptionsProviderTests/TestDefaultConcurrency.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": { 3 | "test": { 4 | "config1": "default", 5 | "config2": "default", 6 | "config3": "default" 7 | } 8 | }, 9 | "concurrency": { 10 | "dynamicConcurrencyEnabled": false, 11 | "maximumFunctionConcurrency": 500, 12 | "cpuThreshold": 0.8, 13 | "snapshotPersistenceEnabled": true 14 | } 15 | } -------------------------------------------------------------------------------- /sample/CSharp/HttpTrigger-Compat/run.csx: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Extensions.Primitives; 4 | using System.Web.Http; 5 | 6 | public static HttpResponseMessage Run(HttpRequestMessage req, TraceWriter log) 7 | { 8 | log.Info("C# HTTP trigger with legacy types function processed a request."); 9 | 10 | return req.CreateResponse(System.Net.HttpStatusCode.OK, "Hello from HttpResponseMessage"); 11 | } -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/TestFixture/HostOptionsProviderTests/TestIrregularNamingBindings.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": { 3 | "eventHubs": { 4 | "config1": "test1", 5 | "config2": "test2", 6 | "config3": "default" 7 | } 8 | }, 9 | "concurrency": { 10 | "dynamicConcurrencyEnabled": false, 11 | "maximumFunctionConcurrency": 500, 12 | "cpuThreshold": 0.8, 13 | "snapshotPersistenceEnabled": true 14 | } 15 | } -------------------------------------------------------------------------------- /sample/CSharp/QueueTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "name": "message", 6 | "direction": "in", 7 | "queueName": "samples-csharp" 8 | }, 9 | { 10 | "type": "blob", 11 | "name": "$return", 12 | "direction": "out", 13 | "path": "samples-output-csharp/{Id}" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /sample/Node/QueueTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "name": "workItem", 6 | "direction": "in", 7 | "queueName": "samples-workitems" 8 | }, 9 | { 10 | "type": "blob", 11 | "name": "$return", 12 | "direction": "out", 13 | "path": "samples-workitems/{id}" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/LoadScriptReference/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ], 8 | "authLevel": "anonymous" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "res", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/MissingAssemblies/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ], 8 | "authLevel": "anonymous" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "res", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /sample/CSharp/BlobTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "blobTrigger", 5 | "name": "blob", 6 | "direction": "in", 7 | "path": "samples-input-csharp/{name}" 8 | }, 9 | { 10 | "type": "blob", 11 | "name": "output", 12 | "direction": "inout", 13 | "path": "samples-output-csharp/{name}" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Management/LinuxSpecialization/IUnZipHandler.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.Script.WebHost.Management.LinuxSpecialization 5 | { 6 | public interface IUnZipHandler 7 | { 8 | void UnzipPackage(string filePath, string scriptPath); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/FunctionExecutionContext/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ], 8 | "authLevel": "anonymous" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "res", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/HttpTrigger-Redirect/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ], 8 | "authLevel": "anonymous" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "$return", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/HttpTrigger-Routed/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ], 8 | "authLevel": "anonymous" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "$return", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/Scenarios/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "direction": "in", 6 | "name": "input", 7 | "queueName": "scenarios" 8 | }, 9 | { 10 | "type": "blob", 11 | "name": "blob", 12 | "direction": "out", 13 | "path": "{Container}/{sys.randGuid}" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/QueueTriggerByteArray/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "name": "input", 6 | "direction": "in", 7 | "dataType": "binary", 8 | "queueName": "test-input-byte" 9 | }, 10 | { 11 | "type": "queue", 12 | "name": "output", 13 | "direction": "out", 14 | "queueName": "test-input-byte" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Proxies/PingRoute/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "authLevel": "anonymous", 5 | "name": "req", 6 | "type": "httpTrigger", 7 | "direction": "in", 8 | "route": "myroute/mysubroute" 9 | }, 10 | { 11 | "name": "$return", 12 | "type": "http", 13 | "direction": "out" 14 | } 15 | ], 16 | "disabled": false 17 | } -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/Workers/Rpc/TestRpcWorkerConfig.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.Script.Tests.Workers.Rpc 5 | { 6 | public class TestRpcWorkerConfig 7 | { 8 | public string Language { get; set; } 9 | 10 | public string Json { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tools/ExtensionsMetadataGenerator/src/ExtensionsMetadataGenerator/Targets/Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | <_ExtensionsMetadataGeneratorPropsImported>true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Configuration/HostHstsOptions.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.HttpsPolicy; 5 | 6 | namespace Microsoft.Azure.WebJobs.Script.WebHost.Configuration 7 | { 8 | public class HostHstsOptions : HstsOptions 9 | { 10 | public bool IsEnabled { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/DependencyInjection/DependencyValidator/InvalidServiceDescriptorReason.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.Script.WebHost.DependencyInjection 5 | { 6 | internal enum InvalidServiceDescriptorReason 7 | { 8 | Invalid, 9 | Missing 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Models/EasyAuthSettings.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.Script.WebHost.Models 5 | { 6 | public class EasyAuthSettings 7 | { 8 | public bool SiteAuthEnabled { get; set; } 9 | 10 | public string SiteAuthClientId { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/runtimeconfig.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "configProperties": { 3 | // Protect users from https://github.com/dotnet/runtime/pull/59716. 4 | // Can be removed after running on .NET 6.0 GA 5 | "Microsoft.Extensions.Configuration.BindSingleElementsToArray": false, 6 | 7 | // Fix for https://github.com/dotnet/runtime/issues/56052 8 | "System.Diagnostics.Tracing.EventSource.AllowDuplicateSourceNames": true 9 | } 10 | } -------------------------------------------------------------------------------- /src/WebJobs.Script/Workers/IWebHostWorkerManager.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.WebJobs.Script.WebHost 7 | { 8 | public interface IWebHostWorkerManager 9 | { 10 | Task SpecializeAsync(); 11 | 12 | Task WorkerWarmupAsync(); 13 | } 14 | } -------------------------------------------------------------------------------- /test/Resources/TestProjects/DotNetCustomHandler/SimpleHttpTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "direction": "in", 6 | "authLevel": "anonymous", 7 | "name": "req", 8 | "methods": [ 9 | "get", 10 | "post" 11 | ] 12 | }, 13 | { 14 | "type": "http", 15 | "direction": "out", 16 | "name": "res" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/AssembliesFromSharedLocation/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ], 8 | "authLevel": "anonymous" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "res", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/HttpTrigger-Dynamic/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "input", 6 | "direction": "in", 7 | "methods": [ "post" ], 8 | "authLevel": "anonymous" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "$return", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/HttpTrigger-FunctionAuth/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "input", 6 | "direction": "in", 7 | "methods": [ "get" ], 8 | "authLevel": "function" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "$return", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/HttpTrigger-Model-v2/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "payload", 6 | "direction": "in", 7 | "methods": [ "post" ], 8 | "authLevel": "anonymous" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "$return", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/HttpTrigger-Model/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "payload", 6 | "direction": "in", 7 | "methods": [ "post" ], 8 | "authLevel": "anonymous" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "$return", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/HttpTrigger-Scenarios/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "post" ], 8 | "authLevel": "anonymous" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "$return", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/HttpTrigger-Scenarios/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get", "post" ], 8 | "authLevel": "anonymous" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "res", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Proxies/PingMakeResponse/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "authLevel": "anonymous", 5 | "name": "req", 6 | "type": "httpTrigger", 7 | "direction": "in", 8 | "route": "pingMakeResponse" 9 | }, 10 | { 11 | "name": "$return", 12 | "type": "http", 13 | "direction": "out" 14 | } 15 | ], 16 | "disabled": false 17 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/OperationResult.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.WebJobs.Script.WebHost 7 | { 8 | public enum OperationResult 9 | { 10 | Created, 11 | Updated, 12 | NotFound, 13 | Conflict, 14 | BadRequest 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Workers/WorkerProcessInfo.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.Script.Workers; 5 | 6 | public class WorkerProcessInfo 7 | { 8 | public int ProcessId { get; set; } 9 | 10 | public string ProcessName { get; set; } 11 | 12 | public string DebugEngine { get; set; } 13 | } 14 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/CosmosDBOut/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input) { 2 | context.log('Node.js function triggered with input', input); 3 | 4 | context.bindings.relatedItems = [ 5 | { related: input }, 6 | { related: input }, 7 | { related: input } 8 | ]; 9 | 10 | context.bindings.item = { 11 | id: input, 12 | text: "Hello from Node!" 13 | }; 14 | 15 | context.done(); 16 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/QueueTriggerByteArray/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input) { 2 | if (input.length < 5) { 3 | var append = new Buffer([4, 5]); 4 | context.bindings.output = Buffer.concat([input, append]); 5 | } 6 | else { 7 | context.log("TestResult:", { 8 | isBuffer: Buffer.isBuffer(input), 9 | length: input.length 10 | }); 11 | } 12 | 13 | context.done(); 14 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/index.js: -------------------------------------------------------------------------------- 1 | const func = require('@azure/functions-core'); 2 | 3 | func.registerHook('postInvocation', async () => { 4 | // Add slight delay to ensure logs show up before the invocation finishes 5 | // See these issues for more info: 6 | // https://github.com/Azure/azure-functions-host/issues/9238 7 | // https://github.com/Azure/azure-functions-host/issues/8222 8 | await new Promise((resolve) => setTimeout(resolve, 100)); 9 | }); -------------------------------------------------------------------------------- /sample/Node/HttpTrigger-CustomRoute-Get/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "req", 6 | "direction": "in", 7 | "methods": [ "get" ], 8 | "route": "node/products/{category:alpha?}/{id:guid?}" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "$return", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/HttpTriggerShared/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "scriptFile": "../HttpTrigger/index.js", 3 | "bindings": [ 4 | { 5 | "type": "httpTrigger", 6 | "name": "request", 7 | "direction": "in", 8 | "methods": [ "get", "post" ] 9 | }, 10 | { 11 | "type": "http", 12 | "name": "response", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/QueueTriggerToBlob/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "name": "input", 6 | "direction": "in", 7 | "queueName": "test-input-node" 8 | }, 9 | { 10 | "type": "blob", 11 | "name": "$return", 12 | "direction": "out", 13 | "path": "test-output-node/{id}" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/TestWorkers/ProbingPaths/functionsworkers/java/2.18.1/worker.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": { 3 | "language": "java", 4 | "extensions": [".jar"], 5 | "defaultExecutablePath": "%JAVA_HOME%/bin/java", 6 | "defaultWorkerPath": "azure-functions-java-worker.jar", 7 | "arguments": [] 8 | }, 9 | "hostRequirements": [ 10 | "test-capability1", 11 | "test-capability2" 12 | ], 13 | "profiles": [] 14 | } -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/Description/DotNet/TestFiles/PackageReferences/ProjectWithLockMatch/function.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/Resources/FileProvisioning/PowerShell/PSGalleryEmptyFeed.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/Resources/FileProvisioning/PowerShell/requirements_PSGalleryOffline.psd1: -------------------------------------------------------------------------------- 1 | # This file enables modules to be automatically managed by the Functions service. 2 | # See https://aka.ms/functionsmanageddependency for additional information. 3 | # 4 | @{ 5 | # For latest supported version, go to 'https://www.powershellgallery.com/packages/Az'. Uncomment the next line and replace the MAJOR_VERSION, e.g., 'Az' = '5.*' 6 | # 'Az' = 'MAJOR_VERSION.*' 7 | } 8 | -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/Resources/FileProvisioning/PowerShell/requirements_PSGalleryOnline.psd1: -------------------------------------------------------------------------------- 1 | # This file enables modules to be automatically managed by the Functions service. 2 | # See https://aka.ms/functionsmanageddependency for additional information. 3 | # 4 | @{ 5 | # For latest supported version, go to 'https://www.powershellgallery.com/packages/Az'. 6 | # To use the Az module in your function app, please uncomment the line below. 7 | # 'Az' = '5.*' 8 | } 9 | -------------------------------------------------------------------------------- /sample/CSharp/HttpTrigger-CustomRoute/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "info", 6 | "direction": "in", 7 | "methods": [ "get" ], 8 | "route": "csharp/products/{category:alpha?}/{id:int?}/{extra?}" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "res", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /sample/CSharp/MobileTable/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "name": "input", 6 | "direction": "in", 7 | "queueName": "samples-mobiletables-csharp" 8 | }, 9 | { 10 | "type": "mobileTable", 11 | "name": "$return", 12 | "direction": "out", 13 | "connection": "AzureWebJobs_TestMobileUri" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Standby/IStandbyManager.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.Tasks; 6 | 7 | namespace Microsoft.Azure.WebJobs.Script.WebHost 8 | { 9 | public interface IStandbyManager 10 | { 11 | Task InitializeAsync(); 12 | 13 | Task SpecializeHostAsync(); 14 | } 15 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/MobileTableOut/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | }, 8 | { 9 | "type": "mobileTable", 10 | "direction": "out", 11 | "name": "item", 12 | "tableName": "Item", 13 | "connection": "AzureWebJobs_TestMobileUri" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/NodeWithBundles/HttpTriggerNoAuth/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "request", 6 | "direction": "in", 7 | "methods": [ "get", "post" ], 8 | "authLevel": "anonymous" 9 | }, 10 | { 11 | "type": "http", 12 | "name": "response", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests.Shared/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.WebJobs.Script.Tests")] 7 | [assembly: InternalsVisibleTo("Microsoft.Azure.WebJobs.Script.Tests.Integration")] 8 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /src/WebJobs.Script.Grpc/Rpc/IRpcWorkerProcessFactory.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.Script.Workers.Rpc 5 | { 6 | internal interface IRpcWorkerProcessFactory 7 | { 8 | IWorkerProcess Create(string workerId, string runtime, string scriptRootPath, RpcWorkerConfig rpcWorkerConfig); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Eventing/Host/HostStartEvent.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.Script.Eventing 5 | { 6 | public class HostStartEvent : ScriptEvent 7 | { 8 | public HostStartEvent() 9 | : base(nameof(HostStartEvent), EventSources.Host) 10 | { 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/QueueTriggerToBlob/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "name": "input", 6 | "queueName": "test-input-csharp", 7 | "direction": "in" 8 | }, 9 | { 10 | "type": "blob", 11 | "name": "$return", 12 | "path": "test-output-csharp/{id}", 13 | "direction": "out" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/Configuration/WebScriptHostConfigurationSourceTests.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.WebJobs.Script.Tests.Configuration 9 | { 10 | public class WebScriptHostConfigurationSourceTests 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /perf/Apps/HelloHttpNode/src/functions/Hello.js: -------------------------------------------------------------------------------- 1 | const { app } = require('@azure/functions'); 2 | 3 | app.http('Hello', { 4 | methods: ['GET', 'POST'], 5 | authLevel: 'anonymous', 6 | handler: async (request, context) => { 7 | context.log(`Http function processed request for url "${request.url}"`); 8 | 9 | const name = request.query.get('name') || await request.text() || 'world'; 10 | 11 | return { body: `Hello, ${name}!` }; 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/TestFixture/HostOptionsProviderTests/TestWihtoutExtensionsAttributeBindings.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": { 3 | "testNoExtensionAttributeConfigProvider": { 4 | "config1": "test1", 5 | "config2": "test2", 6 | "config3": "default" 7 | } 8 | }, 9 | "concurrency": { 10 | "dynamicConcurrencyEnabled": false, 11 | "maximumFunctionConcurrency": 500, 12 | "cpuThreshold": 0.8, 13 | "snapshotPersistenceEnabled": true 14 | } 15 | } -------------------------------------------------------------------------------- /perf/Apps/HelloHttpNode/src/functions/HelloAuth.js: -------------------------------------------------------------------------------- 1 | const { app } = require('@azure/functions'); 2 | 3 | app.http('HelloAuth', { 4 | methods: ['GET', 'POST'], 5 | authLevel: 'function', 6 | handler: async (request, context) => { 7 | context.log(`Http function processed request for url "${request.url}"`); 8 | 9 | const name = request.query.get('name') || await request.text() || 'world'; 10 | 11 | return { body: `Hello, ${name}!` }; 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /sample/CSharp/MobileTable/run.csx: -------------------------------------------------------------------------------- 1 | public static Item Run(string input) 2 | { 3 | return new Item 4 | { 5 | Text = "Hello from C#! " + input 6 | }; 7 | } 8 | 9 | public class Item 10 | { 11 | public string Id { get; set; } 12 | public string Text { get; set; } 13 | public bool IsProcessed { get; set; } 14 | public DateTimeOffset ProcessedAt { get; set; } 15 | 16 | // Mobile table properties 17 | public DateTimeOffset CreatedAt { get; set; } 18 | } -------------------------------------------------------------------------------- /sample/CSharp/SendGrid/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "name": "order", 6 | "direction": "in", 7 | "queueName": "samples-orders-csharp" 8 | }, 9 | { 10 | "type": "sendGrid", 11 | "name": "$return", 12 | "direction": "out", 13 | "apiKey": "MySendGridKey", 14 | "to": "{CustomerEmail}" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Diagnostics/LogType.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.Script.Diagnostics 5 | { 6 | /// 7 | /// Enumeration of the various log types we support. 8 | /// 9 | public enum LogType 10 | { 11 | Host, 12 | Function, 13 | Structured 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Http/DefaultHttpRouteManager.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.Script.Http 5 | { 6 | internal class DefaultHttpRouteManager : IHttpRoutesManager 7 | { 8 | public void InitializeHttpFunctionRoutes(IScriptJobHost host) 9 | { 10 | // noop 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WebJobs.Script/IHostOptionsProvider.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.DependencyInjection; 6 | using Newtonsoft.Json.Linq; 7 | 8 | namespace Microsoft.Azure.WebJobs.Script 9 | { 10 | public interface IHostOptionsProvider 11 | { 12 | JObject GetOptions(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WebJobs.Script/PlatformHelper.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.InteropServices; 6 | 7 | namespace Microsoft.Azure.WebJobs.Script 8 | { 9 | internal static class PlatformHelper 10 | { 11 | public static bool IsWindows { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Workers/ConsoleLog.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.Logging; 5 | 6 | namespace Microsoft.Azure.WebJobs.Script.Workers 7 | { 8 | public class ConsoleLog 9 | { 10 | public string Message { get; set; } 11 | 12 | public LogLevel Level { get; set; } = LogLevel.Information; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/CosmosDBIn/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, input) { 2 | 3 | context.log(context.bindings); 4 | 5 | var relatedCount = context.bindings.relatedItems.length; 6 | if (relatedCount !== 3) { 7 | throw Error("Expected 3 documents. Found " + relatedCount); 8 | } 9 | 10 | context.bindings.itemOut = context.bindings.itemIn; 11 | context.bindings.itemOut.text = "This was updated!"; 12 | 13 | context.done(); 14 | } -------------------------------------------------------------------------------- /sample/CSharp/HttpTrigger-CustomRoute/run.csx: -------------------------------------------------------------------------------- 1 | #r "Newtonsoft.Json" 2 | 3 | public class ProductInfo 4 | { 5 | public string Category { get; set; } 6 | public int? Id { get; set; } 7 | } 8 | 9 | public static ProductInfo Run(ProductInfo info, string category, int? id, string extra, TraceWriter log) 10 | { 11 | log.Info($"ProductInfo: Category={info.Category} Id={info.Id}"); 12 | log.Info($"Parameters: category={category} id={id} extra={extra}"); 13 | 14 | return info; 15 | } -------------------------------------------------------------------------------- /src/WebJobs.Script/Description/DotNet/RuntimeInfo.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.WebJobs.Script.Description.DotNet 7 | { 8 | internal sealed class RuntimeInfo 9 | { 10 | [JsonPropertyName("#import")] 11 | public string[] Imports { get; set; } = []; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Diagnostics/OpenTelemetry/TelemetryMode.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.Script.Diagnostics.OpenTelemetry 5 | { 6 | internal enum TelemetryMode 7 | { 8 | None = 0, // or Default 9 | Placeholder = 1, 10 | ApplicationInsights = 2, 11 | OpenTelemetry = 3 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WebJobs.Script/RuntimeInformation/ISystemRuntimeInformation.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.InteropServices; 5 | 6 | namespace Microsoft.Azure.WebJobs.Script 7 | { 8 | public interface ISystemRuntimeInformation 9 | { 10 | Architecture GetOSArchitecture(); 11 | 12 | OSPlatform GetOSPlatform(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/EventHubSender/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "manualTrigger", 5 | "name": "input", 6 | "direction": "in" 7 | }, 8 | { 9 | "type": "eventHub", 10 | "name": "output", 11 | "direction": "out", 12 | "connection": "AzureWebJobsEventHubSender", 13 | "eventHubName": "%AzureWebJobsEventHubPath%" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/WarmupFunction/Ping/function.json: -------------------------------------------------------------------------------- 1 | 2 | 3 | { 4 | "bindings": [ 5 | { 6 | "authLevel": "anonymous", 7 | "type": "httpTrigger", 8 | "route": "{*route}", 9 | "name": "req", 10 | "direction": "in", 11 | "methods": [ "get", "post" ] 12 | }, 13 | { 14 | "type": "http", 15 | "name": "res", 16 | "direction": "out" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Diagnostics/ILinuxAppServiceFileLoggerFactory.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.WebJobs.Script.WebHost.Diagnostics 7 | { 8 | public interface ILinuxAppServiceFileLoggerFactory 9 | { 10 | public ILinuxAppServiceFileLogger Create(string category, bool backoffEnabled); 11 | } 12 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Management/LinuxSpecialization/IBashCommandHandler.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.Script.WebHost.Management.LinuxSpecialization 5 | { 6 | public interface IBashCommandHandler 7 | { 8 | (string Output, string Error, int ExitCode) RunBashCommand(string command, string metricName); 9 | } 10 | } -------------------------------------------------------------------------------- /src/WebJobs.Script/Workers/IWorkerConsoleLogSource.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.Dataflow; 5 | 6 | namespace Microsoft.Azure.WebJobs.Script.Workers 7 | { 8 | public interface IWorkerConsoleLogSource 9 | { 10 | ISourceBlock LogStream { get; } 11 | 12 | void Log(ConsoleLog consoleLog); 13 | } 14 | } -------------------------------------------------------------------------------- /sample/NodeDrain/HttpTrigger-LongRun/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "direction": "in", 6 | "name": "req", 7 | "methods": [ 8 | "get", 9 | "post" 10 | ] 11 | }, 12 | { 13 | "type": "http", 14 | "direction": "out", 15 | "name": "res" 16 | } 17 | ], 18 | "retry": { 19 | "strategy": "fixedDelay", 20 | "maxRetryCount": 2, 21 | "delayInterval": "00:00:03" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/EventHubTrigger/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, workItem) { 2 | context.log('Node.js eventhub trigger function processed work item', workItem.id); 3 | 4 | context.log('Sequence Number: ', context.bindingData.sequenceNumber); 5 | context.log('Enqueued Time: ', context.bindingData.enqueuedTimeUtc); 6 | 7 | var result = { 8 | id: workItem.id, 9 | bindingData: context.bindingData 10 | }; 11 | context.done(null, result); 12 | } -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/Description/DotNet/TestFiles/PackageReferences/ProjectWithMismatchedLock/MismatchedProjectDependencies/function.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/Node/MobileTable/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "name": "input", 6 | "direction": "in", 7 | "queueName": "samples-mobiletables-node" 8 | }, 9 | { 10 | "type": "mobileTable", 11 | "direction": "out", 12 | "name": "$return", 13 | "tableName": "Item", 14 | "connection": "AzureWebJobs_TestMobileUri" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Security/Authentication/Keys/AuthLevelAuthenticationDefaults.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.WebJobs.Script.WebHost.Authentication 7 | { 8 | public static class AuthLevelAuthenticationDefaults 9 | { 10 | public const string AuthenticationScheme = "WebJobsAuthLevel"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Binding/Manual/ManualTriggerAttribute.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.WebJobs.Description; 6 | 7 | namespace Microsoft.Azure.WebJobs.Script.Binding 8 | { 9 | [AttributeUsage(AttributeTargets.Parameter)] 10 | [Binding] 11 | public sealed class ManualTriggerAttribute : Attribute 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/BlobTriggerToBlob/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "blobTrigger", 5 | "name": "input", 6 | "direction": "in", 7 | "dataType": "binary", 8 | "path": "test-input-node/{name}" 9 | }, 10 | { 11 | "type": "blob", 12 | "name": "output", 13 | "direction": "out", 14 | "path": "test-output-node/{name}" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /sample/NodeRetry/HttpTrigger-RetryFunctionJson/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "direction": "in", 6 | "name": "req", 7 | "methods": [ 8 | "get", 9 | "post" 10 | ] 11 | }, 12 | { 13 | "type": "http", 14 | "direction": "out", 15 | "name": "res" 16 | } 17 | ], 18 | "retry": { 19 | "strategy": "fixedDelay", 20 | "maxRetryCount": 4, 21 | "delayInterval": "00:00:03" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/WebJobs.Script.Grpc/Http/IHttpWorkerChannel.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.WebJobs.Script.Description; 6 | 7 | namespace Microsoft.Azure.WebJobs.Script.Workers 8 | { 9 | internal interface IHttpWorkerChannel : IWorkerChannel 10 | { 11 | Task InvokeAsync(ScriptInvocationContext context); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/DependencyInjection/DependencyValidator/IDependencyValidator.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 | 6 | namespace Microsoft.Azure.WebJobs.Script.WebHost.DependencyInjection 7 | { 8 | public interface IDependencyValidator 9 | { 10 | void Validate(IServiceCollection services); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Diagnostics/HostStartedEvent.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.Script.Diagnostics 5 | { 6 | public class HostStarted : MetricEvent 7 | { 8 | public HostStarted(ScriptHost host) 9 | { 10 | Host = host; 11 | } 12 | 13 | public ScriptHost Host { get; private set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/MobileTableIn/index.js: -------------------------------------------------------------------------------- 1 | // Mobile table node scripts cannot Update values 2 | // because output bindings perform an insert rather 3 | // than an upsert. 4 | // So we'll insert with a known id that we can query 5 | // from the test. That'll confirm this was called as 6 | // expected. 7 | 8 | module.exports = function (context, input) { 9 | 10 | context.bindings.itemOut = { 11 | id: context.bindings.itemIn.id + "-success" 12 | }; 13 | 14 | context.done(); 15 | } -------------------------------------------------------------------------------- /test/TestWorkers/ProbingPaths/functionsworkers/node/3.10.1/worker.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": { 3 | "language": "node", 4 | "extensions": [".js", ".mjs", ".cjs"], 5 | "defaultExecutablePath": "node", 6 | "defaultWorkerPath": "worker.config.json", 7 | "workerIndexing": "true" 8 | }, 9 | "hostRequirements": [], 10 | "processOptions": { 11 | "initializationTimeout": "00:02:00", 12 | "environmentReloadTimeout": "00:02:00" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tools/ExtensionsMetadataGenerator/test/TestProject_Core22/TestProject_Core22.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Library 5 | netcoreapp2.2 6 | 7 | 8 | true 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/CSharp/HttpTrigger-Cancellation/run.csx: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Threading; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.Extensions.Primitives; 5 | 6 | public static async Task Run(HttpRequest req, ILogger log, CancellationToken token) 7 | { 8 | log.LogInformation("C# HTTP trigger cancellation function processing a request."); 9 | await Task.Delay(10000, token); 10 | log.LogInformation("Function invocation successful."); 11 | return new OkResult(); 12 | } 13 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/IFileMonitoringService.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.Tasks; 6 | using Microsoft.Extensions.Hosting; 7 | 8 | namespace Microsoft.Azure.WebJobs.Script.WebHost 9 | { 10 | public interface IFileMonitoringService : IHostedService 11 | { 12 | IDisposable SuspendRestart(bool autoResume); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Models/ResumeStatus.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 Newtonsoft.Json; 5 | using Newtonsoft.Json.Converters; 6 | 7 | namespace Microsoft.Azure.WebJobs.Script.WebHost.Models 8 | { 9 | public class ResumeStatus 10 | { 11 | [JsonConverter(typeof(StringEnumConverter))] 12 | public ScriptHostState State { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Diagnostics/IHostDiagnosticEvent.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 | using Microsoft.Extensions.Logging; 8 | 9 | namespace Microsoft.Azure.WebJobs.Script.Diagnostics 10 | { 11 | internal interface IHostDiagnosticEvent 12 | { 13 | void LogEvent(ILogger logger); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/TimeoutStopHost/run.csx: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Threading; 4 | using Microsoft.Azure.WebJobs.Host; 5 | 6 | public static void Run(string input, TextWriter writer, TraceWriter log) 7 | { 8 | log.Info(input); 9 | 10 | while (true) 11 | { 12 | log.Info("Waiting"); 13 | Thread.Sleep(100); 14 | } 15 | } 16 | 17 | public class Context 18 | { 19 | public string Scenario { get; set; } 20 | public string Data { get; set; } 21 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/HttpTriggerToBlob/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, req) { 2 | console.log(context.bindingData); 3 | var result = req.body.value + req.body.id + context.bindingData.headers.value, 4 | response = { 5 | status: 200, 6 | body: result, 7 | headers: { 8 | 'Content-Type': 'text/plain' 9 | } 10 | }; 11 | 12 | context.bindings.outBlob = result; 13 | 14 | context.done(null, response); 15 | }; -------------------------------------------------------------------------------- /src/WebJobs.Script.Abstractions/Description/Binding/DataType.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.Script.Description 5 | { 6 | /// 7 | /// Enumeration of binding value data types. 8 | /// 9 | public enum DataType 10 | { 11 | Undefined, 12 | String, 13 | Binary, 14 | Stream 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WebJobs.Script.Grpc/Http/IHttpWorkerChannelFactory.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.WebJobs.Script.Diagnostics; 5 | 6 | namespace Microsoft.Azure.WebJobs.Script.Workers 7 | { 8 | internal interface IHttpWorkerChannelFactory 9 | { 10 | IHttpWorkerChannel Create(string scriptRootPath, IMetricsLogger metricsLogger, int attemptCount); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Management/LinuxSpecialization/IManagedIdentityTokenProvider.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.WebJobs.Script.WebHost.Management.LinuxSpecialization 7 | { 8 | public interface IManagedIdentityTokenProvider 9 | { 10 | Task GetManagedIdentityToken(string resourceUrl); 11 | } 12 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/MultipleExports/index.js: -------------------------------------------------------------------------------- 1 | var util = require('util'); 2 | 3 | module.exports = { 4 | doIt: doIt, 5 | foo: foo, 6 | bar: bar, 7 | baz: function () { 8 | } 9 | } 10 | 11 | function doIt(context) { 12 | var log = util.format("Exports: IsObject=%s, Count=%d", 13 | util.isObject(module.exports), 14 | Object.keys(module.exports).length); 15 | context.log(log); 16 | context.done(); 17 | } 18 | 19 | function foo() { 20 | } 21 | 22 | function bar() { 23 | } -------------------------------------------------------------------------------- /sample/HttpWorker/server.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | const url = require('url'); 3 | const port = process.env.FUNCTIONS_HTTPWORKER_PORT; 4 | console.log("port" + port); 5 | //create a server object: 6 | http.createServer(function (req, res) { 7 | const reqUrl = url.parse(req.url, true); 8 | console.log("Request handler random was called."); 9 | res.writeHead(200, {"Content-Type": "application/json"}); 10 | var json = JSON.stringify({ functionName : req.url.replace("/","")}); 11 | res.end(json); 12 | }).listen(port); -------------------------------------------------------------------------------- /sample/Node/SendGrid/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "name": "order", 6 | "direction": "in", 7 | "queueName": "samples-orders" 8 | }, 9 | { 10 | "type": "sendGrid", 11 | "name": "$return", 12 | "direction": "out", 13 | "apiKey" : "MySendGridKey", 14 | "to": "{customerEmail}", 15 | "from": "functions@azure.com" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/WebJobs.Script.Abstractions/WebJobs.Script.Abstractions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Microsoft.Azure.WebJobs.Script.Abstractions 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/WebJobs.Script.Grpc/Http/IHttpWorkerProcessFactory.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.WebJobs.Script.Workers.Http; 5 | 6 | namespace Microsoft.Azure.WebJobs.Script.Workers 7 | { 8 | internal interface IHttpWorkerProcessFactory 9 | { 10 | IWorkerProcess Create(string workerId, string scriptRootPath, HttpWorkerOptions httpWorkerOptions); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Configuration/HostCorsOptions.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.WebJobs.Script.WebHost.Configuration 7 | { 8 | public class HostCorsOptions 9 | { 10 | public IEnumerable AllowedOrigins { get; set; } 11 | 12 | public bool SupportCredentials { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Resources/Functions/WarmUp/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "authLevel": "anonymous", 6 | "name": "req", 7 | "direction": "in", 8 | "methods": [ "get", "post" ], 9 | "route": "{x:regex(^(warmup|csharphttpwarmup)$)}" 10 | }, 11 | { 12 | "type": "http", 13 | "name": "$return", 14 | "direction": "out" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Description/DotNet/DotNetScriptTypes.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.Script.Description 5 | { 6 | public class DotNetScriptTypes 7 | { 8 | public const string CSharp = "CSharp"; 9 | public const string DotNetAssembly = "DotNetAssembly"; 10 | public const string RawDotNetAssembly = "RawDotNetAssembly"; 11 | } 12 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/CosmosDBTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "cosmosDBTrigger", 5 | "name": "input", 6 | "direction": "in", 7 | "databaseName": "ItemDb", 8 | "collectionName": "ItemCollection", 9 | "createLeaseCollectionIfNotExists": true 10 | }, 11 | { 12 | "type": "blob", 13 | "name": "completed", 14 | "direction": "out", 15 | "path": "test-output-csharp/cosmosdbtriggere2e-completed" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/QueueTriggerToBlobRichTypes/run.csx: -------------------------------------------------------------------------------- 1 | #r "Microsoft.Azure.Storage.Blob" 2 | using Microsoft.Azure.Storage.Blob; 3 | 4 | public static async Task Run(WorkItem input, CloudBlockBlob output, TraceWriter log) 5 | { 6 | string json = string.Format("{{ \"id\": \"{0}\" }}", input.Id); 7 | 8 | log.Info($"C# script processed queue message. Item={json}"); 9 | 10 | await output.UploadTextAsync(json); 11 | } 12 | 13 | public class WorkItem 14 | { 15 | public string Id { get; set; } 16 | } -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/HttpTriggerByteArray/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, req) { 2 | var body = req.body; 3 | 4 | context.log("TestResult:", { 5 | isBuffer: Buffer.isBuffer(body), 6 | length: body.length 7 | }); 8 | 9 | context.res = { 10 | status: 200, 11 | body: { 12 | isBuffer: Buffer.isBuffer(body), 13 | length: body.length, 14 | rawBody: context.req.rawBody 15 | } 16 | }; 17 | 18 | context.done(); 19 | } -------------------------------------------------------------------------------- /sample/CustomHandler/server.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | const url = require('url'); 3 | const port = process.env.FUNCTIONS_HTTPWORKER_PORT; 4 | console.log("port" + port); 5 | //create a server object: 6 | http.createServer(function (req, res) { 7 | const reqUrl = url.parse(req.url, true); 8 | console.log("Request handler random was called."); 9 | res.writeHead(200, {"Content-Type": "application/json"}); 10 | var json = JSON.stringify({ functionName : req.url.replace("/","")}); 11 | res.end(json); 12 | }).listen(port); -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Configuration/HostEasyAuthOptions.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.Configuration; 5 | 6 | namespace Microsoft.Azure.WebJobs.Script.WebHost.Configuration 7 | { 8 | public class HostEasyAuthOptions 9 | { 10 | public bool SiteAuthEnabled { get; set; } 11 | 12 | public string SiteAuthClientId { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Security/KeyManagement/IKeyValueReader.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.WebJobs.Script.WebHost 11 | { 12 | public interface IKeyValueReader 13 | { 14 | Key ReadValue(Key key); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Security/KeyManagement/IKeyValueWriter.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.WebJobs.Script.WebHost 11 | { 12 | public interface IKeyValueWriter 13 | { 14 | Key WriteValue(Key key); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Description/DotNet/IFunctionEntryPointResolver.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.Reflection; 6 | 7 | namespace Microsoft.Azure.WebJobs.Script.Description 8 | { 9 | public interface IFunctionEntryPointResolver 10 | { 11 | T GetFunctionEntryPoint(IEnumerable methods) where T : class, IMethodReference; 12 | } 13 | } -------------------------------------------------------------------------------- /src/WebJobs.Script/RpcWorkerConfig.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.Script.Workers.Rpc 5 | { 6 | public class RpcWorkerConfig 7 | { 8 | public RpcWorkerDescription Description { get; set; } 9 | 10 | public WorkerProcessArguments Arguments { get; set; } 11 | 12 | public WorkerProcessCountOptions CountOptions { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /tools/Clean.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Models/Link.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 Newtonsoft.Json; 6 | 7 | namespace Microsoft.Azure.WebJobs.Script.WebHost.Models 8 | { 9 | public class Link 10 | { 11 | [JsonProperty("rel")] 12 | public string Relation { get; set; } 13 | 14 | [JsonProperty("href")] 15 | public Uri Href { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Security/Authorization/Policies/PolicyNames.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.Script.WebHost.Security.Authorization.Policies 5 | { 6 | public static class PolicyNames 7 | { 8 | public const string AdminAuthLevel = "AuthLevelAdmin"; 9 | public const string ExtensionWebhookInvoke = "Extension.Webhook.Invoke"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/FunctionIndexingError/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "name": "input", 6 | "queueName": "test-input-csharp", 7 | "direction": "in", 8 | "connection": "setting_does_not_exist" 9 | }, 10 | { 11 | "type": "blob", 12 | "name": "$return", 13 | "path": "test-output-csharp/{id}", 14 | "direction": "out" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/MissingAssemblies/run.csx: -------------------------------------------------------------------------------- 1 | #r "MissingDependency.dll" 2 | 3 | using MissingDependency; 4 | using Microsoft.AspNetCore.Mvc; 5 | 6 | /// 7 | /// This is a function to test that the correct warning and link to documentation gets sent over. 8 | /// 9 | /// 10 | /// 11 | /// 12 | public static IActionResult Run(HttpRequest req, TraceWriter log) 13 | { 14 | return new OkObjectResult(new Primary().GetValue()); 15 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.Grpc/ProcessManagement/EmptyProcessRegistry.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.Diagnostics; 5 | 6 | namespace Microsoft.Azure.WebJobs.Script.Workers 7 | { 8 | internal class EmptyProcessRegistry : IProcessRegistry 9 | { 10 | public bool Register(WorkerProcess process) => true; 11 | 12 | public void Close() 13 | { 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Diagnostics/ForwardingLoggerAttribute.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.Extensions.Logging 8 | { 9 | [AttributeUsage(AttributeTargets.Parameter)] 10 | internal class ForwardingLoggerAttribute() 11 | : FromKeyedServicesAttribute(ForwardingLogger.ServiceKey) 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Diagnostics/ISystemLoggerFactory.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.Logging; 5 | 6 | namespace Microsoft.Azure.WebJobs.Script.Diagnostics 7 | { 8 | /// 9 | /// A logger factory which is used to create loggers for system-only logs. 10 | /// 11 | internal interface ISystemLoggerFactory : ILoggerFactory 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <_GrpcCoreLibs Include="$(OutputPath)Grpc.Core.*" /> 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /sample/CSharp/ApiHubFileTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "apiHubFileTrigger", 5 | "name": "input", 6 | "connection": "AzureWebJobsDropBox", 7 | "direction": "in", 8 | "path": "test/{name}" 9 | }, 10 | { 11 | "type": "apiHubFile", 12 | "name": "$return", 13 | "connection": "AzureWebJobsDropBox", 14 | "direction": "out", 15 | "path": "testOut/{name}" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /sample/Node/DocumentDB/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "name": "input", 6 | "direction": "in", 7 | "queueName": "samples-documentdb-node" 8 | }, 9 | { 10 | "type": "documentDB", 11 | "direction": "out", 12 | "name": "$return", 13 | "databaseName": "ItemDb", 14 | "collectionName": "ItemCollection", 15 | "createIfNotExists": false 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /sample/Node/SendGrid/index.js: -------------------------------------------------------------------------------- 1 | var util = require('util'); 2 | 3 | module.exports = function (context, order) { 4 | context.log('Node.js queue trigger function processed order', order.orderId); 5 | 6 | var message = { 7 | subject: util.format('Thanks for your order (#%d)!', order.orderId), 8 | content: [{ 9 | type: 'text/plain', 10 | value: util.format("%s, your order (%d) is being processed!", order.customerName, order.orderId) 11 | }] 12 | }; 13 | 14 | context.done(null, message); 15 | } -------------------------------------------------------------------------------- /sample/Node/ServiceBusTopicTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "serviceBusTrigger", 5 | "name": "message", 6 | "direction": "in", 7 | "topicName": "samples-topic", 8 | "subscriptionName": "samples", 9 | "accessRights": "manage" 10 | }, 11 | { 12 | "type": "blob", 13 | "name": "$return", 14 | "direction": "out", 15 | "path": "samples-output/{id}" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Extensions/VfsStringExtensions.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.WebJobs.Script.WebHost.Extensions 7 | { 8 | public static class VfsStringExtensions 9 | { 10 | public static string EscapeHashCharacter(this string str) 11 | { 12 | return str.Replace("#", Uri.EscapeDataString("#")); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/WebJobs.Script/Host/ScriptInvocationArguments.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 | 7 | namespace Microsoft.Azure.WebJobs.Script.Host 8 | { 9 | internal class ScriptInvocationArguments(IServiceProvider serviceProvider) : Dictionary 10 | { 11 | public IServiceProvider ServiceProvider { get; } = serviceProvider; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/CosmosDBTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "cosmosDBTrigger", 5 | "name": "input", 6 | "direction": "in", 7 | "databaseName": "ItemDb", 8 | "collectionName": "ItemCollection", 9 | "createLeaseCollectionIfNotExists": true 10 | }, 11 | { 12 | "type": "blob", 13 | "name": "blob", 14 | "direction": "out", 15 | "path": "test-output-node/cosmosdbtriggere2e-completed" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /tools/ExtensionsMetadataGenerator/test/TestProject_Core21/TestProject_Core21.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Library 5 | netcoreapp2.1 6 | 7 | 8 | $(MSBuildThisFileDirectory)..\..\..\..\src.ruleset 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /sample/CSharp/DocumentDB/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "name": "input", 6 | "direction": "in", 7 | "queueName": "samples-documentdb-csharp" 8 | }, 9 | { 10 | "type": "documentDB", 11 | "direction": "out", 12 | "name": "$return", 13 | "databaseName": "ItemDb", 14 | "collectionName": "ItemCollection", 15 | "createIfNotExists": false 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /sample/CSharp/HttpTrigger/run.csx: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Extensions.Primitives; 4 | 5 | public static IActionResult Run(HttpRequest req, TraceWriter log) 6 | { 7 | log.Info("C# HTTP trigger function processed a request."); 8 | 9 | if (req.Query.TryGetValue("name", out StringValues value)) 10 | { 11 | return new OkObjectResult($"Hello {value.ToString()}"); 12 | } 13 | 14 | return new BadRequestObjectResult("Please pass a name on the query string or in the request body"); 15 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.Grpc/ProcessManagement/IWorkerProcessFactory.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.Diagnostics; 5 | 6 | namespace Microsoft.Azure.WebJobs.Script.Workers 7 | { 8 | internal interface IWorkerProcessFactory 9 | { 10 | // TODO: create an abstraction like Executable in the cli which wraps the process 11 | Process CreateWorkerProcess(WorkerContext context); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/Node/ServiceBusTopicTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "serviceBusTrigger", 5 | "name": "trigger", 6 | "direction": "in", 7 | "topicName": "core-test-topic1", 8 | "subscriptionName": "sub1" 9 | }, 10 | { 11 | "type": "blob", 12 | "name": "completed", 13 | "direction": "out", 14 | "path": "test-output-node/servicebuse2e-topic-completed" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /eng/ci/templates/install-dotnet.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | 3 | - task: UseDotNet@2 # Needed by some of our test resources 4 | displayName: Install .NET 3.1 5 | inputs: 6 | packageType: sdk 7 | version: 3.1.x 8 | 9 | - task: UseDotNet@2 # Needed by our projects and CI steps 10 | displayName: Install .NET 6 11 | inputs: 12 | packageType: sdk 13 | version: 6.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 | -------------------------------------------------------------------------------- /sample/Node/ApiHubFileTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "apiHubFileTrigger", 5 | "name": "input", 6 | "connection": "AzureWebJobsDropBox", 7 | "direction": "in", 8 | "path": "testinnode/{name}" 9 | }, 10 | { 11 | "type": "apiHubFile", 12 | "name": "$return", 13 | "connection": "AzureWebJobsDropBox", 14 | "direction": "out", 15 | "path": "testoutnode/{name}" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/ContainerManagement/ILinuxContainerActivityPublisher.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.WebJobs.Script.WebHost.Models; 5 | 6 | namespace Microsoft.Azure.WebJobs.Script.WebHost.ContainerManagement 7 | { 8 | public interface ILinuxContainerActivityPublisher 9 | { 10 | void PublishFunctionExecutionActivity(ContainerFunctionExecutionActivity activity); 11 | } 12 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Middleware/JobHostMiddleware/IJobHostMiddlewarePipeline.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 | using Microsoft.AspNetCore.Http; 8 | 9 | namespace Microsoft.Azure.WebJobs.Script.Middleware 10 | { 11 | internal interface IJobHostMiddlewarePipeline 12 | { 13 | RequestDelegate Pipeline { get; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Description/DotNet/ScriptRuntimeAssembly.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.WebJobs.Script.Description 9 | { 10 | internal sealed class ScriptRuntimeAssembly 11 | { 12 | public string Name { get; set; } 13 | 14 | public string ResolutionPolicy { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WebJobs.Script/ExtensionRequirements/BundleRequirement.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.WebJobs.Script.ExtensionRequirements 9 | { 10 | public sealed class BundleRequirement 11 | { 12 | public string Id { get; set; } 13 | 14 | public string MinimumVersion { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Host/Kubernetes/KubernetesLockHandle.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.WebJobs.Host; 5 | 6 | namespace Microsoft.Azure.WebJobs.Script 7 | { 8 | internal class KubernetesLockHandle : IDistributedLock 9 | { 10 | public string LockId { get; set; } 11 | 12 | public string Owner { get; set; } 13 | 14 | public string LockPeriod { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/MobileTableIn/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "queueTrigger", 5 | "name": "input", 6 | "queueName": "mobiletables-input", 7 | "direction": "in" 8 | }, 9 | { 10 | "type": "mobileTable", 11 | "name": "item", 12 | "direction": "in", 13 | "tableName": "Item", 14 | "id": "{recordId}", 15 | "connection": "AzureWebJobs_TestMobileUri" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /test/Resources/TestScripts/CSharp/ServiceBusTopicTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "serviceBusTrigger", 5 | "name": "trigger", 6 | "direction": "in", 7 | "topicName": "core-test-topic1", 8 | "subscriptionName": "sub1" 9 | }, 10 | { 11 | "type": "blob", 12 | "name": "completed", 13 | "direction": "out", 14 | "path": "test-output-csharp/servicebuse2e-topic-completed" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /sample/CSharp/HttpTrigger-AdminLevel/run.csx: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Extensions.Primitives; 4 | 5 | public static IActionResult Run(HttpRequest req, TraceWriter log) 6 | { 7 | log.Info("C# HTTP trigger function processed a request."); 8 | 9 | if (req.Query.TryGetValue("name", out StringValues value)) 10 | { 11 | return new OkObjectResult($"Hello {value.ToString()}"); 12 | } 13 | 14 | return new BadRequestObjectResult("Please pass a name on the query string or in the request body"); 15 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.Grpc/Rpc/FunctionRegistration/IRpcFunctionInvocationDispatcherLoadBalancer.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.WebJobs.Script.Workers.Rpc 7 | { 8 | internal interface IRpcFunctionInvocationDispatcherLoadBalancer 9 | { 10 | IRpcWorkerChannel GetLanguageWorkerChannel(IEnumerable languageWorkers); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/WebJobs.Script.Tests/TestFixture/HostOptionsProviderTests/TestMultipleBindings.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": { 3 | "test": { 4 | "config1": "test1", 5 | "config2": "test2", 6 | "config3": "default" 7 | }, 8 | "eventHubs": { 9 | "config1": "test0", 10 | "config2": "test2", 11 | "config3": "default" 12 | } 13 | }, 14 | "concurrency": { 15 | "dynamicConcurrencyEnabled": false, 16 | "maximumFunctionConcurrency": 500, 17 | "cpuThreshold": 0.8, 18 | "snapshotPersistenceEnabled": true 19 | } 20 | } -------------------------------------------------------------------------------- /sample/CSharp/HttpTrigger-AnonymousLevel/run.csx: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Extensions.Primitives; 4 | 5 | public static IActionResult Run(HttpRequest req, TraceWriter log) 6 | { 7 | log.Info("C# HTTP trigger function processed a request."); 8 | 9 | if (req.Query.TryGetValue("name", out StringValues value)) 10 | { 11 | return new OkObjectResult($"Hello {value.ToString()}"); 12 | } 13 | 14 | return new BadRequestObjectResult("Please pass a name on the query string or in the request body"); 15 | } -------------------------------------------------------------------------------- /sample/CSharpBenchmark/HttpTriggerAnon/run.csx: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Extensions.Primitives; 4 | 5 | public static IActionResult Run(HttpRequest req, TraceWriter log) 6 | { 7 | log.Info("C# HTTP trigger function processed a request."); 8 | 9 | if (req.Query.TryGetValue("name", out StringValues value)) 10 | { 11 | return new OkObjectResult($"Hello {value.ToString()}"); 12 | } 13 | 14 | return new BadRequestObjectResult("Please pass a name on the query string or in the request body"); 15 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.Grpc/Rpc/IRpcWorkerChannelDictionary.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 | 6 | namespace Microsoft.Azure.WebJobs.Script.Workers.Rpc 7 | { 8 | /// 9 | /// Class to hold list of 10 | /// 11 | internal class IRpcWorkerChannelDictionary : ConcurrentDictionary 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WebJobs.Script.WebHost/Configuration/CustomHttpHeadersOptions.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.WebJobs.Script.WebHost.Configuration 7 | { 8 | /// 9 | /// Gets or sets the list of headers to add to every HTTP response. 10 | /// 11 | public class CustomHttpHeadersOptions : Dictionary 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WebJobs.Script/ExtensionBundle/IExtensionBundleContentProvider.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.WebJobs.Script.ExtensionBundle 7 | { 8 | public interface IExtensionBundleContentProvider 9 | { 10 | Task GetTemplates(); 11 | 12 | Task GetBindings(); 13 | 14 | Task GetResources(string fileName = null); 15 | } 16 | } -------------------------------------------------------------------------------- /src/WebJobs.Script/Host/IScriptJobHost.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.WebJobs.Script.Description; 6 | 7 | namespace Microsoft.Azure.WebJobs.Script 8 | { 9 | public interface IScriptJobHost : IJobHost 10 | { 11 | ICollection Functions { get; } 12 | 13 | IDictionary> FunctionErrors { get; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/WebJobs.Script.Grpc/Eventing/InboundGrpcEvent.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.WebJobs.Script.Grpc.Messages; 5 | 6 | namespace Microsoft.Azure.WebJobs.Script.Grpc.Eventing 7 | { 8 | internal class InboundGrpcEvent : GrpcEvent 9 | { 10 | public InboundGrpcEvent(string workerId, StreamingMessage message) : base(workerId, message, MessageOrigin.Worker) 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WebJobs.Script.Grpc/Eventing/OutboundGrpcEvent.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.WebJobs.Script.Grpc.Messages; 5 | 6 | namespace Microsoft.Azure.WebJobs.Script.Grpc.Eventing 7 | { 8 | internal class OutboundGrpcEvent : GrpcEvent 9 | { 10 | public OutboundGrpcEvent(string workerId, StreamingMessage message) : base(workerId, message, MessageOrigin.Host) 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WebJobs.Script.Grpc/ProcessManagement/IProcessRegistry.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.Diagnostics; 6 | 7 | namespace Microsoft.Azure.WebJobs.Script.Workers 8 | { 9 | internal interface IProcessRegistry 10 | { 11 | // Registers processes to ensure that they are cleaned up on host exit. 12 | bool Register(WorkerProcess process); 13 | 14 | void Close(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WebJobs.Script/Models/ExtensionReferencesJsonContext.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.WebJobs.Script.Models 7 | { 8 | [JsonSourceGenerationOptions(PropertyNameCaseInsensitive = true, AllowTrailingCommas = true)] 9 | [JsonSerializable(typeof(ExtensionReferences))] 10 | public partial class ExtensionReferencesJsonContext : JsonSerializerContext; 11 | } 12 | -------------------------------------------------------------------------------- /test/Resources/TestProjects/DotNetCustomHandler/Program.cs: -------------------------------------------------------------------------------- 1 | var app = WebApplication.CreateBuilder(args).Build(); 2 | 3 | var port = Environment.GetEnvironmentVariable("FUNCTIONS_CUSTOMHANDLER_PORT") 4 | ?? throw new InvalidOperationException("FUNCTIONS_CUSTOMHANDLER_PORT environment variable is not set."); 5 | 6 | app.Urls.Add($"http://localhost:{port}"); 7 | 8 | app.MapGet("/api/SimpleHttpTrigger", () => "Hello from .NET custom handler"); 9 | 10 | Console.WriteLine($".NET server listening on FUNCTIONS_CUSTOMHANDLER_PORT: {port}"); 11 | await app.RunAsync(); 12 | -------------------------------------------------------------------------------- /sample/CSharp/HttpTrigger-Poco/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "name": "data", 6 | "direction": "in", 7 | "methods": [ "get", "post" ] 8 | }, 9 | { 10 | "type": "http", 11 | "name": "res", 12 | "direction": "out" 13 | }, 14 | { 15 | "type": "blob", 16 | "name": "outBlob", 17 | "direction": "out", 18 | "path": "samples-output/{Id}" 19 | } 20 | ] 21 | } 22 | --------------------------------------------------------------------------------