From 6faaf4a282a86996b2d7c04e5ae2589053cf7a26 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Tue, 25 Jun 2024 20:59:49 -0700 Subject: [PATCH 01/19] initial commit --- .../AzureStorageDurabilityProvider.cs | 4 - .../EntityTriggerAttributeBindingProvider.cs | 2 - .../DurableEntityContext.cs | 6 -- .../IDurableEntityContext.cs | 2 - .../DurabilityProvider.cs | 4 - .../DurableTaskExtension.cs | 85 ------------------- ...rableTaskJobHostConfigurationExtensions.cs | 29 ------- .../DurableTaskWebJobsStartup.cs | 4 +- .../HostLifecycleService.cs | 6 -- .../LinuxAppServiceFileLogger.cs | 4 - .../Listener/DurableTaskListener.cs | 4 - .../Listener/DurableTaskMetricsProvider.cs | 4 +- .../Listener/DurableTaskScaleMonitor.cs | 4 +- .../Listener/DurableTaskTriggerMetrics.cs | 2 - .../Listener/TaskEntityShim.cs | 2 - .../Listener/TaskOrchestrationShim.cs | 6 -- .../LocalHttpListener.cs | 10 --- .../Options/TraceOptions.cs | 2 - .../Scale/ScaleUtils.cs | 4 - .../StorageServiceClientProviderFactory.cs | 15 ---- .../ActivityTriggerAttribute.cs | 4 - .../EntityTriggerAttribute.cs | 4 - .../OrchestrationTriggerAttribute.cs | 4 - .../WebJobs.Extensions.DurableTask.csproj | 71 +--------------- .../WebJobsConnectionInfoProvider.cs | 8 +- .../WebJobsConnectionStringProvider.cs | 8 -- test/Common/DurableClientBaseTests.cs | 4 - test/Common/DurableTaskEndToEndTests.cs | 18 ---- ...torageServiceClientProviderFactoryTests.cs | 14 --- test/Common/TestDataGenerator.cs | 4 - test/Common/TestEntityClasses.cs | 24 ------ test/Common/TestOrchestrations.cs | 8 -- .../WebJobsConnectionInfoProviderTests.cs | 18 ---- 33 files changed, 8 insertions(+), 380 deletions(-) diff --git a/src/WebJobs.Extensions.DurableTask/AzureStorageDurabilityProvider.cs b/src/WebJobs.Extensions.DurableTask/AzureStorageDurabilityProvider.cs index 5ef9ed716..21ceffd41 100644 --- a/src/WebJobs.Extensions.DurableTask/AzureStorageDurabilityProvider.cs +++ b/src/WebJobs.Extensions.DurableTask/AzureStorageDurabilityProvider.cs @@ -16,9 +16,7 @@ using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Serialization; -#if !FUNCTIONS_V1 using Microsoft.Azure.WebJobs.Host.Scale; -#endif using AzureStorage = DurableTask.AzureStorage; using DTCore = DurableTask.Core; @@ -223,7 +221,6 @@ internal static OrchestrationInstanceStatusQueryCondition ConvertWebjobsDurableC }; } -#if !FUNCTIONS_V1 internal DurableTaskMetricsProvider GetMetricsProvider( string functionName, @@ -254,7 +251,6 @@ public override bool TryGetScaleMonitor( return true; } -#endif #if FUNCTIONS_V3_OR_GREATER public override bool TryGetTargetScaler( string functionId, diff --git a/src/WebJobs.Extensions.DurableTask/Bindings/EntityTriggerAttributeBindingProvider.cs b/src/WebJobs.Extensions.DurableTask/Bindings/EntityTriggerAttributeBindingProvider.cs index 8e30157c8..be6743ca1 100644 --- a/src/WebJobs.Extensions.DurableTask/Bindings/EntityTriggerAttributeBindingProvider.cs +++ b/src/WebJobs.Extensions.DurableTask/Bindings/EntityTriggerAttributeBindingProvider.cs @@ -109,9 +109,7 @@ public Task BindAsync(object value, ValueBindingContext context) if (destinationType == typeof(IDurableEntityContext)) { convertedValue = entityContext; -#if !FUNCTIONS_V1 ((IDurableEntityContext)value).FunctionBindingContext = context.FunctionContext; -#endif } else if (destinationType == typeof(string)) { diff --git a/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableEntityContext.cs b/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableEntityContext.cs index 0b658eca5..557935802 100644 --- a/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableEntityContext.cs +++ b/src/WebJobs.Extensions.DurableTask/ContextImplementations/DurableEntityContext.cs @@ -115,9 +115,7 @@ bool IDurableEntityContext.HasState internal int OutboxPosition => this.outbox.Count; -#if !FUNCTIONS_V1 public FunctionBindingContext FunctionBindingContext { get; set; } -#endif public void CaptureInternalError(Exception e, TaskEntityShim shim) { @@ -520,11 +518,7 @@ async Task IDurableEntityContext.DispatchAsync(params object[] constructorPar args = Array.Empty(); } -#if !FUNCTIONS_V1 T Constructor() => (T)context.FunctionBindingContext.CreateObjectInstance(typeof(T), constructorParameters); -#else - T Constructor() => (T)Activator.CreateInstance(typeof(T), constructorParameters); -#endif var state = ((Extensions.DurableTask.DurableEntityContext)context).GetStateWithInjectedDependencies(Constructor); diff --git a/src/WebJobs.Extensions.DurableTask/ContextInterfaces/IDurableEntityContext.cs b/src/WebJobs.Extensions.DurableTask/ContextInterfaces/IDurableEntityContext.cs index 36a258905..079a992f3 100644 --- a/src/WebJobs.Extensions.DurableTask/ContextInterfaces/IDurableEntityContext.cs +++ b/src/WebJobs.Extensions.DurableTask/ContextInterfaces/IDurableEntityContext.cs @@ -37,12 +37,10 @@ public interface IDurableEntityContext /// string OperationName { get; } -#if !FUNCTIONS_V1 /// /// Contains function invocation context to assist with dependency injection at Entity construction time. /// FunctionBindingContext FunctionBindingContext { get; set; } -#endif /// /// Whether this entity has a state. diff --git a/src/WebJobs.Extensions.DurableTask/DurabilityProvider.cs b/src/WebJobs.Extensions.DurableTask/DurabilityProvider.cs index 9adc6cf84..ddcab0233 100644 --- a/src/WebJobs.Extensions.DurableTask/DurabilityProvider.cs +++ b/src/WebJobs.Extensions.DurableTask/DurabilityProvider.cs @@ -11,9 +11,7 @@ using DurableTask.Core.Query; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -#if !FUNCTIONS_V1 using Microsoft.Azure.WebJobs.Host.Scale; -#endif namespace Microsoft.Azure.WebJobs.Extensions.DurableTask { @@ -562,7 +560,6 @@ internal virtual bool ConnectionNameMatches(DurabilityProvider durabilityProvide return this.ConnectionName.Equals(durabilityProvider.ConnectionName); } -#if !FUNCTIONS_V1 /// /// Tries to obtain a scale monitor for autoscaling. /// @@ -582,7 +579,6 @@ public virtual bool TryGetScaleMonitor( scaleMonitor = null; return false; } -#endif #if FUNCTIONS_V3_OR_GREATER /// diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs index 17c085a8b..ef9985251 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs @@ -18,10 +18,8 @@ using DurableTask.Core.History; using DurableTask.Core.Middleware; using Microsoft.Azure.WebJobs.Description; -#if !FUNCTIONS_V1 using Microsoft.Azure.WebJobs.Extensions.DurableTask.Correlation; using Microsoft.Azure.WebJobs.Host.Scale; -#endif using Microsoft.Azure.WebJobs.Extensions.DurableTask.Listener; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Storage; using Microsoft.Azure.WebJobs.Host; @@ -38,9 +36,7 @@ namespace Microsoft.Azure.WebJobs.Extensions.DurableTask /// /// Configuration for the Durable Functions extension. /// -#if !FUNCTIONS_V1 [Extension("DurableTask", "DurableTask")] -#endif public class DurableTaskExtension : IExtensionConfigProvider, IDisposable, @@ -92,7 +88,6 @@ public class DurableTaskExtension : private HttpClient durableHttpClient; private EventSourceListener eventSourceListener; -#if FUNCTIONS_V1 private IConnectionInfoResolver connectionInfoResolver; /// @@ -105,7 +100,6 @@ public DurableTaskExtension() this.Options = new DurableTaskOptions(); this.isOptionsConfigured = false; } -#endif /// /// Initializes a new instance of the . @@ -176,24 +170,20 @@ public DurableTaskExtension( this.TypedCodeProvider.Initialize(); this.HttpApiHandler = new HttpApiHandler(this, logger); -#if !FUNCTIONS_V1 // This line ensure every time we need the webhook URI, we get it directly from the // function runtime, which has the most up-to-date knowledge about the site hostname. Func webhookDelegate = () => webhookProvider.GetUrl(this); this.HttpApiHandler.RegisterWebhookProvider( this.Options.WebhookUriProviderOverride ?? webhookDelegate); -#endif this.HostLifetimeService = hostLifetimeService; -#if !FUNCTIONS_V1 // The RPC server is started when the extension is initialized. // The RPC server is stopped when the host has finished shutting down. this.HostLifetimeService.OnStopped.Register(this.StopLocalHttpServer); this.telemetryActivator = telemetryActivator; this.telemetryActivator?.Initialize(logger); -#endif // Starting with .NET isolated and Java, we have a more efficient out-of-process // function invocation protocol. Other languages will use the existing protocol. @@ -214,39 +204,6 @@ public DurableTaskExtension( } } -#if FUNCTIONS_V1 - internal DurableTaskExtension( - IOptions options, - ILoggerFactory loggerFactory, - INameResolver nameResolver, - IEnumerable orchestrationServiceFactories, - IConnectionInfoResolver connectionInfoResolver, - IApplicationLifetimeWrapper shutdownNotification, - IDurableHttpMessageHandlerFactory durableHttpMessageHandlerFactory, -#pragma warning disable CS0612 // Type or member is obsolete - IPlatformInformation platformInformationService) -#pragma warning restore CS0612 // Type or member is obsolete - - : this(options, loggerFactory, nameResolver, orchestrationServiceFactories, shutdownNotification, durableHttpMessageHandlerFactory) - { - this.connectionInfoResolver = connectionInfoResolver; - } - - /// - /// Gets or sets default task hub name to be used by all , , , - /// , and instances. - /// - /// - /// A task hub is a logical grouping of storage resources. Alternate task hub names can be used to isolate - /// multiple Durable Functions applications from each other, even if they are using the same storage backend. - /// - /// The name of the default task hub. - public string HubName - { - get { return this.Options.HubName; } - set { this.Options.HubName = value; } - } -#endif internal DurableTaskOptions Options { get; } @@ -341,14 +298,12 @@ internal string GetBackendInfo() /// Extension context provided by WebJobs. void IExtensionConfigProvider.Initialize(ExtensionConfigContext context) { -#if !FUNCTIONS_V1 // Functions V1 is not supported in linux, so this is conditionally compiled // We initialize linux logging early on in case any initialization steps below were to trigger a log event. if (this.PlatformInformationService.GetOperatingSystem() == OperatingSystem.Linux) { this.InitializeLinuxLogging(); } -#endif ConfigureLoaderHooks(); @@ -367,16 +322,6 @@ void IExtensionConfigProvider.Initialize(ExtensionConfigContext context) // Invoke webhook handler to make functions runtime register extension endpoints. var initialWebhookUri = context.GetWebhookHandler(); -#if FUNCTIONS_V1 - // In Functions V1, there is no notion of an IWebhookProvider that - // we can dynamically call to fetch the webhook URI, and since context.GetWebhookHandler() - // only works in the scope of the Initialize() function, we just have to live with the static URI - // we grab now. - Func staticWebhookHandler = () => initialWebhookUri; - this.HttpApiHandler.RegisterWebhookProvider( - this.Options.WebhookUriProviderOverride ?? - staticWebhookHandler); -#endif #pragma warning restore CS0618 // Type or member is obsolete this.TraceConfigurationSettings(); @@ -584,31 +529,6 @@ private void StopLocalGrpcServer() private void InitializeForFunctionsV1(ExtensionConfigContext context) { -#if FUNCTIONS_V1 - context.ApplyConfig(this.Options, "DurableTask"); - this.nameResolver = context.Config.NameResolver; - this.loggerFactory = context.Config.LoggerFactory; - DurableTaskOptions.ResolveAppSettingOptions(this.Options, this.nameResolver); - ILogger logger = this.loggerFactory.CreateLogger(LoggerCategoryName); - this.TraceHelper = new EndToEndTraceHelper(logger, this.Options.Tracing.TraceReplayEvents); - this.connectionInfoResolver = new WebJobsConnectionInfoProvider(); - this.PlatformInformationService = new DefaultPlatformInformation(this.nameResolver, this.loggerFactory); - this.durabilityProviderFactory = new AzureStorageDurabilityProviderFactory( - new OptionsWrapper(this.Options), - new StorageServiceClientProviderFactory(this.connectionInfoResolver), - this.nameResolver, - this.loggerFactory, - this.PlatformInformationService); - this.defaultDurabilityProvider = this.durabilityProviderFactory.GetDurabilityProvider(); - this.LifeCycleNotificationHelper = this.CreateLifeCycleNotificationHelper(); - var messageSerializerSettingsFactory = new MessageSerializerSettingsFactory(); - var errorSerializerSettingsFactory = new ErrorSerializerSettingsFactory(); - this.MessageDataConverter = new MessagePayloadDataConverter(messageSerializerSettingsFactory.CreateJsonSerializerSettings(), true); - this.ErrorDataConverter = new MessagePayloadDataConverter(errorSerializerSettingsFactory.CreateJsonSerializerSettings(), true); - this.HttpApiHandler = new HttpApiHandler(this, logger); - this.TypedCodeProvider = new TypedCodeProvider(); - this.TypedCodeProvider.Initialize(); -#endif } private void TraceConfigurationSettings() @@ -1169,9 +1089,6 @@ internal RegisteredFunctionInfo GetEntityInfo(FunctionName entityFunction) // This is temporary until script loading private static void ConfigureLoaderHooks() { -#if FUNCTIONS_V1 - AppDomain.CurrentDomain.AssemblyResolve += ResolveAssembly; -#endif } private static Assembly ResolveAssembly(object sender, ResolveEventArgs args) @@ -1538,7 +1455,6 @@ internal static string ValidatePayloadSize(string payload) return payload; } -#if !FUNCTIONS_V1 /// /// Tags the current Activity with metadata: DurableFunctionsType, DurableFunctionsInstanceId, DurableFunctionsRuntimeStatus. /// This metadata will show up in Application Insights, if enabled. @@ -1558,6 +1474,5 @@ internal static void TagActivityWithOrchestrationStatus(OrchestrationRuntimeStat activity.AddTag("DurableFunctionsRuntimeStatus", statusStr); } } -#endif } } diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs index fdc925fbd..c0e864bdd 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Linq; -#if !FUNCTIONS_V1 using Microsoft.Azure.WebJobs.Extensions.DurableTask.ContextImplementations; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Correlation; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Options; @@ -24,7 +23,6 @@ using Microsoft.Azure.WebJobs.Host.Config; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; -#endif namespace Microsoft.Azure.WebJobs.Extensions.DurableTask { @@ -48,9 +46,7 @@ public static IServiceCollection AddDurableClientFactory(this IServiceCollection serviceCollection.TryAddSingleton(); serviceCollection.TryAddSingleton(); serviceCollection.TryAddSingleton(); -#if !FUNCTIONS_V1 serviceCollection.AddAzureClientsCore(); -#endif serviceCollection.TryAddSingleton(); serviceCollection.TryAddSingleton(); serviceCollection.TryAddSingleton(); @@ -75,7 +71,6 @@ public static IServiceCollection AddDurableClientFactory(this IServiceCollection return serviceCollection; } -#if !FUNCTIONS_V1 /// /// Adds the Durable Task extension to the provided . /// @@ -179,29 +174,5 @@ public static IWebJobsBuilder AddDurableTask(this IWebJobsBuilder builder, Actio return builder; } -#else - /// - /// Enable running durable orchestrations implemented as functions. - /// - /// Configuration settings of the current JobHost instance. - /// Durable Functions configuration. - public static void UseDurableTask( - this JobHostConfiguration hostConfig, - DurableTaskExtension listenerConfig) - { - if (hostConfig == null) - { - throw new ArgumentNullException(nameof(hostConfig)); - } - - if (listenerConfig == null) - { - throw new ArgumentNullException(nameof(listenerConfig)); - } - - IExtensionRegistry extensions = hostConfig.GetService(); - extensions.RegisterExtension(listenerConfig); - } -#endif } } diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskWebJobsStartup.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskWebJobsStartup.cs index 5180661ff..ad6415080 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskWebJobsStartup.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskWebJobsStartup.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -#if !FUNCTIONS_V1 using Microsoft.Azure.WebJobs.Extensions.DurableTask; using Microsoft.Azure.WebJobs.Hosting; @@ -16,5 +15,4 @@ public void Configure(IWebJobsBuilder builder) builder.AddDurableTask(); } } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/WebJobs.Extensions.DurableTask/HostLifecycleService.cs b/src/WebJobs.Extensions.DurableTask/HostLifecycleService.cs index a666091f3..a3b98b24d 100644 --- a/src/WebJobs.Extensions.DurableTask/HostLifecycleService.cs +++ b/src/WebJobs.Extensions.DurableTask/HostLifecycleService.cs @@ -9,14 +9,9 @@ namespace Microsoft.Azure.WebJobs.Extensions.DurableTask { -#if !FUNCTIONS_V1 internal class HostLifecycleService : IApplicationLifetimeWrapper -#else - internal class HostLifecycleService -#endif { internal static readonly IApplicationLifetimeWrapper NoOp = new NoOpLifetimeWrapper(); -#if !FUNCTIONS_V1 #pragma warning disable CS0618 // Type or member is obsolete (no alternatives in .NET Standard 2.0) private readonly IApplicationLifetime appLifetime; @@ -31,7 +26,6 @@ public HostLifecycleService(IApplicationLifetime appLifetime) public CancellationToken OnStopping => this.appLifetime.ApplicationStopping; public CancellationToken OnStopped => this.appLifetime.ApplicationStopped; -#endif private class NoOpLifetimeWrapper : IApplicationLifetimeWrapper { diff --git a/src/WebJobs.Extensions.DurableTask/LinuxAppServiceFileLogger.cs b/src/WebJobs.Extensions.DurableTask/LinuxAppServiceFileLogger.cs index 373a95440..efbe9a7f0 100644 --- a/src/WebJobs.Extensions.DurableTask/LinuxAppServiceFileLogger.cs +++ b/src/WebJobs.Extensions.DurableTask/LinuxAppServiceFileLogger.cs @@ -183,17 +183,13 @@ public void Dispose() private void RollFiles() { // Rename current file to older file. -#if !FUNCTIONS_V1 rename(this.logFilePath, this.archiveFilePath); -#endif } -#if !FUNCTIONS_V1 [DllImport("libc", SetLastError = true)] #pragma warning disable SA1300 // Element should begin with upper-case letter private static extern int rename(string oldPath, string newPath); #pragma warning restore SA1300 // Element should begin with upper-case letter -#endif } } diff --git a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskListener.cs b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskListener.cs index 4fa87cc07..77ae6dff3 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskListener.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskListener.cs @@ -6,9 +6,7 @@ using System.Threading.Tasks; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Scale; using Microsoft.Azure.WebJobs.Host.Listeners; -#if !FUNCTIONS_V1 using Microsoft.Azure.WebJobs.Host.Scale; -#endif namespace Microsoft.Azure.WebJobs.Extensions.DurableTask { @@ -26,9 +24,7 @@ internal sealed class DurableTaskListener : IListener private readonly FunctionType functionType; private readonly string connectionName; -#if !FUNCTIONS_V1 private readonly Lazy scaleMonitor; -#endif #if FUNCTIONS_V3_OR_GREATER private readonly Lazy targetScaler; diff --git a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskMetricsProvider.cs b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskMetricsProvider.cs index edfcd4d37..59e78794c 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskMetricsProvider.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskMetricsProvider.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -#if !FUNCTIONS_V1 using System; using System.Threading.Tasks; using Azure; @@ -80,5 +79,4 @@ internal DisconnectedPerformanceMonitor GetPerformanceMonitor() return this.performanceMonitor; } } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskScaleMonitor.cs b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskScaleMonitor.cs index 9d0155660..67d9aaef5 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskScaleMonitor.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskScaleMonitor.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -#if !FUNCTIONS_V1 using System; using System.Collections.Generic; using System.Linq; @@ -159,5 +158,4 @@ private ScaleStatus GetScaleStatusCore(int workerCount, DurableTaskTriggerMetric return scaleStatus; } } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTriggerMetrics.cs b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTriggerMetrics.cs index 68fa8a10c..1dd20b2ea 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTriggerMetrics.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTriggerMetrics.cs @@ -1,6 +1,5 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -#if !FUNCTIONS_V1 using System.Collections.Generic; using Microsoft.Azure.WebJobs.Host.Scale; @@ -38,4 +37,3 @@ internal class DurableTaskTriggerMetrics : ScaleMetrics public string WorkItemQueueLatency { get; set; } } } -#endif diff --git a/src/WebJobs.Extensions.DurableTask/Listener/TaskEntityShim.cs b/src/WebJobs.Extensions.DurableTask/Listener/TaskEntityShim.cs index 1e0998ce4..b88c1b2c5 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/TaskEntityShim.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/TaskEntityShim.cs @@ -191,13 +191,11 @@ internal void Rehydrate(string serializedInput) // synchronize with the DurableTask.Core API. public override async Task Execute(OrchestrationContext innerContext, string serializedInput) { -#if !FUNCTIONS_V1 // Adding "Tags" to activity allows using App Insights to query current state of entities var activity = Activity.Current; OrchestrationRuntimeStatus status = OrchestrationRuntimeStatus.Running; DurableTaskExtension.TagActivityWithOrchestrationStatus(status, this.context.InstanceId, true); -#endif try { if (this.operationBatch.Count == 0 diff --git a/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs b/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs index 8cb6a33ff..c03fcd3c5 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs @@ -79,7 +79,6 @@ public override async Task Execute(OrchestrationContext innerContext, st FunctionType.Orchestrator, this.context.IsReplaying); status = OrchestrationRuntimeStatus.Running; -#if !FUNCTIONS_V1 // On a replay, the orchestrator will either go into a 'Completed' // state or a 'Failed' state. We want to avoid tagging them as // 'Running' while replaying because this could result in @@ -88,7 +87,6 @@ public override async Task Execute(OrchestrationContext innerContext, st { DurableTaskExtension.TagActivityWithOrchestrationStatus(status, this.context.InstanceId); } -#endif var orchestratorInfo = this.Config.GetOrchestratorInfo(new FunctionName(this.context.Name)); @@ -128,9 +126,7 @@ public override async Task Execute(OrchestrationContext innerContext, st this.context.ContinuedAsNew, this.context.IsReplaying)); } -#if !FUNCTIONS_V1 DurableTaskExtension.TagActivityWithOrchestrationStatus(status, this.context.InstanceId); -#endif return serializedOutput; } @@ -199,9 +195,7 @@ private async Task InvokeUserCodeAndHandleResults( this.context.OrchestrationException = ExceptionDispatchInfo.Capture(orchestrationException); -#if !FUNCTIONS_V1 DurableTaskExtension.TagActivityWithOrchestrationStatus(OrchestrationRuntimeStatus.Failed, this.context.InstanceId); -#endif throw orchestrationException; } diff --git a/src/WebJobs.Extensions.DurableTask/LocalHttpListener.cs b/src/WebJobs.Extensions.DurableTask/LocalHttpListener.cs index 0d5f8782c..2d0c4662f 100644 --- a/src/WebJobs.Extensions.DurableTask/LocalHttpListener.cs +++ b/src/WebJobs.Extensions.DurableTask/LocalHttpListener.cs @@ -65,7 +65,6 @@ public async Task StartAsync() throw new InvalidOperationException("The local HTTP listener has already started."); } -#if !FUNCTIONS_V1 const int maxAttempts = 10; int numAttempts = 1; do @@ -109,10 +108,6 @@ public async Task StartAsync() { throw new IOException($"Unable to find a port to open an RPC endpoint on after {maxAttempts} attempts"); } -#else - // no-op: this is dummy code to make build warnings go away - await Task.Yield(); -#endif } private int GetRandomPort() @@ -131,12 +126,7 @@ private int GetRandomPort() public async Task StopAsync() { -#if !FUNCTIONS_V1 await this.localWebHost.StopAsync(); -#else - // no-op: this is dummy code to make build warnings go away - await Task.Yield(); -#endif this.IsListening = false; } diff --git a/src/WebJobs.Extensions.DurableTask/Options/TraceOptions.cs b/src/WebJobs.Extensions.DurableTask/Options/TraceOptions.cs index fb7c95366..0bab15219 100644 --- a/src/WebJobs.Extensions.DurableTask/Options/TraceOptions.cs +++ b/src/WebJobs.Extensions.DurableTask/Options/TraceOptions.cs @@ -51,7 +51,6 @@ public class TraceOptions /// public bool TraceReplayEvents { get; set; } -#if !FUNCTIONS_V1 /// /// Gets or sets a flag indicating whether to enable distributed tracing. /// The default value is false. @@ -72,7 +71,6 @@ public class TraceOptions /// public DurableDistributedTracingVersion Version { get; set; } = DurableDistributedTracingVersion.V1; -#endif internal void AddToDebugString(StringBuilder builder) { builder.Append(nameof(this.TraceReplayEvents)).Append(": ").Append(this.TraceReplayEvents).Append(", "); diff --git a/src/WebJobs.Extensions.DurableTask/Scale/ScaleUtils.cs b/src/WebJobs.Extensions.DurableTask/Scale/ScaleUtils.cs index 0d60da23f..1b786a715 100644 --- a/src/WebJobs.Extensions.DurableTask/Scale/ScaleUtils.cs +++ b/src/WebJobs.Extensions.DurableTask/Scale/ScaleUtils.cs @@ -5,15 +5,12 @@ using System; using System.Threading.Tasks; -#if !FUNCTIONS_V1 using Microsoft.Azure.WebJobs.Host.Scale; -#endif namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.Scale { internal static class ScaleUtils { -#if !FUNCTIONS_V1 internal static IScaleMonitor GetScaleMonitor(DurabilityProvider durabilityProvider, string functionId, FunctionName functionName, string? connectionName, string hubName) { if (durabilityProvider.TryGetScaleMonitor( @@ -53,7 +50,6 @@ public NoOpScaleMonitor(string name, string functionId) #pragma warning disable CS0618 // Type or member is obsolete this.Descriptor = new ScaleMonitorDescriptor(name); #pragma warning restore CS0618 // Type or member is obsolete -#endif } /// diff --git a/src/WebJobs.Extensions.DurableTask/Storage/StorageServiceClientProviderFactory.cs b/src/WebJobs.Extensions.DurableTask/Storage/StorageServiceClientProviderFactory.cs index e34fc1b65..58f3aaa96 100644 --- a/src/WebJobs.Extensions.DurableTask/Storage/StorageServiceClientProviderFactory.cs +++ b/src/WebJobs.Extensions.DurableTask/Storage/StorageServiceClientProviderFactory.cs @@ -6,9 +6,7 @@ using Azure.Storage.Blobs; using Azure.Storage.Queues; using DurableTask.AzureStorage; -#if !FUNCTIONS_V1 using Microsoft.Extensions.Azure; -#endif using Microsoft.Extensions.Configuration; namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.Storage @@ -18,7 +16,6 @@ internal sealed class StorageServiceClientProviderFactory : IStorageServiceClien { private readonly IConnectionInfoResolver connectionInfoResolver; -#if !FUNCTIONS_V1 private readonly AzureComponentFactory componentFactory; private readonly AzureEventSourceLogForwarder logForwarder; @@ -31,12 +28,6 @@ public StorageServiceClientProviderFactory(IConnectionInfoResolver connectionInf // Initialize the AzureEventSourceListener for all Azure Client SDKs, if it hasn't been started already this.logForwarder.Start(); } -#else - public StorageServiceClientProviderFactory(IConnectionInfoResolver connectionInfoResolver) - { - this.connectionInfoResolver = connectionInfoResolver ?? throw new ArgumentNullException(nameof(connectionInfoResolver)); - } -#endif /// public IStorageServiceClientProvider GetBlobClientProvider(string connectionName) @@ -48,13 +39,11 @@ public IStorageServiceClientProvider GetBl return StorageServiceClientProvider.ForBlob(connectionSection.Value); } -#if !FUNCTIONS_V1 // Otherwise, check if any account information has been specified, like account name or service URI if (connectionSection.Exists()) { return new BlobServiceClientProvider(connectionSection, this.componentFactory); } -#endif throw new InvalidOperationException($"Unable to resolve the Azure Storage connection named '{connectionName}'."); } @@ -68,13 +57,11 @@ public IStorageServiceClientProvider Get return StorageServiceClientProvider.ForQueue(connectionSection.Value); } -#if !FUNCTIONS_V1 // Otherwise, check if any account information has been specified, like account name or service URI if (connectionSection.Exists()) { return new QueueServiceClientProvider(connectionSection, this.componentFactory); } -#endif throw new InvalidOperationException($"Unable to resolve the Azure Storage connection named '{connectionName}'."); } @@ -88,13 +75,11 @@ public IStorageServiceClientProvider Get return StorageServiceClientProvider.ForTable(connectionSection.Value); } -#if !FUNCTIONS_V1 // Otherwise, check if any account information has been specified, like account name or service URI if (connectionSection.Exists()) { return new TableServiceClientProvider(connectionSection, this.componentFactory); } -#endif throw new InvalidOperationException($"Unable to resolve the Azure Storage connection named '{connectionName}'."); } } diff --git a/src/WebJobs.Extensions.DurableTask/TriggerAttributes/ActivityTriggerAttribute.cs b/src/WebJobs.Extensions.DurableTask/TriggerAttributes/ActivityTriggerAttribute.cs index 3f2e67ce8..75161cea2 100644 --- a/src/WebJobs.Extensions.DurableTask/TriggerAttributes/ActivityTriggerAttribute.cs +++ b/src/WebJobs.Extensions.DurableTask/TriggerAttributes/ActivityTriggerAttribute.cs @@ -12,13 +12,9 @@ namespace Microsoft.Azure.WebJobs.Extensions.DurableTask /// [AttributeUsage(AttributeTargets.Parameter)] [DebuggerDisplay("{Activity}")] -#if !FUNCTIONS_V1 #pragma warning disable CS0618 // Type or member is obsolete [Binding(TriggerHandlesReturnValue = true)] #pragma warning restore CS0618 // Type or member is obsolete -#else - [Binding] -#endif public sealed class ActivityTriggerAttribute : Attribute { /// diff --git a/src/WebJobs.Extensions.DurableTask/TriggerAttributes/EntityTriggerAttribute.cs b/src/WebJobs.Extensions.DurableTask/TriggerAttributes/EntityTriggerAttribute.cs index d24a17c77..28c0ecde0 100644 --- a/src/WebJobs.Extensions.DurableTask/TriggerAttributes/EntityTriggerAttribute.cs +++ b/src/WebJobs.Extensions.DurableTask/TriggerAttributes/EntityTriggerAttribute.cs @@ -12,13 +12,9 @@ namespace Microsoft.Azure.WebJobs.Extensions.DurableTask /// [AttributeUsage(AttributeTargets.Parameter)] [DebuggerDisplay("{EntityName} ({Version})")] -#if !FUNCTIONS_V1 #pragma warning disable CS0618 // Type or member is obsolete [Binding(TriggerHandlesReturnValue = true)] #pragma warning restore CS0618 // Type or member is obsolete -#else - [Binding] -#endif public sealed class EntityTriggerAttribute : Attribute { /// diff --git a/src/WebJobs.Extensions.DurableTask/TriggerAttributes/OrchestrationTriggerAttribute.cs b/src/WebJobs.Extensions.DurableTask/TriggerAttributes/OrchestrationTriggerAttribute.cs index 70caade8d..03a9584da 100644 --- a/src/WebJobs.Extensions.DurableTask/TriggerAttributes/OrchestrationTriggerAttribute.cs +++ b/src/WebJobs.Extensions.DurableTask/TriggerAttributes/OrchestrationTriggerAttribute.cs @@ -12,13 +12,9 @@ namespace Microsoft.Azure.WebJobs.Extensions.DurableTask /// [AttributeUsage(AttributeTargets.Parameter)] [DebuggerDisplay("{Orchestration}")] -#if !FUNCTIONS_V1 #pragma warning disable CS0618 // Type or member is obsolete [Binding(TriggerHandlesReturnValue = true)] #pragma warning restore CS0618 // Type or member is obsolete -#else - [Binding] -#endif public sealed class OrchestrationTriggerAttribute : Attribute { /// diff --git a/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj b/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj index 5bbf2feae..540005a7e 100644 --- a/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj +++ b/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;netstandard2.0;net462 + net6.0 Microsoft.Azure.WebJobs.Extensions.DurableTask Microsoft.Azure.WebJobs.Extensions.DurableTask 3 @@ -46,67 +46,8 @@ true - - - $(DefineConstants);FUNCTIONS_V1 - false - - - - - - - - - - - - - - - - - - - - - - - - - - $(DefineConstants);FUNCTIONS_V2_OR_GREATER - - $(AssemblyName).xml - - - - - - - - - - - - - - - - - - $(DefineConstants);FUNCTIONS_V2_OR_GREATER;FUNCTIONS_V3_OR_GREATER - - + + @@ -120,11 +61,7 @@ - - - - - + diff --git a/src/WebJobs.Extensions.DurableTask/WebJobsConnectionInfoProvider.cs b/src/WebJobs.Extensions.DurableTask/WebJobsConnectionInfoProvider.cs index 65984a78e..59218598b 100644 --- a/src/WebJobs.Extensions.DurableTask/WebJobsConnectionInfoProvider.cs +++ b/src/WebJobs.Extensions.DurableTask/WebJobsConnectionInfoProvider.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.WebJobs.Extensions.DurableTask /// public class WebJobsConnectionInfoProvider : IConnectionInfoResolver { -#if !FUNCTIONS_V1 private readonly IConfiguration hostConfiguration; /// @@ -22,15 +21,11 @@ public WebJobsConnectionInfoProvider(IConfiguration hostConfiguration) { this.hostConfiguration = hostConfiguration ?? throw new ArgumentNullException(nameof(hostConfiguration)); } -#endif /// public IConfigurationSection Resolve(string name) { -#if FUNCTIONS_V1 - // The returned key doesn't reflect whether the ConnectionString section was used or if the name was ultimately prefixed. - return new ReadOnlyConfigurationValue(name, Host.AmbientConnectionStringProvider.Instance.GetConnectionString(name)); -#else + // The below represents the implementation of this.hostConfiguration.GetWebJobsConnectionSection(name), defined in the WebJobs SDK // but not available to Functions v3 at runtime. // Source: https://github.com/Azure/azure-webjobs-sdk/blob/b6d5b52da5d2fb457efbf359cbdd733186aacf7c/src/Microsoft.Azure.WebJobs.Host/Extensions/IConfigurationExtensions.cs#L103-L133 @@ -56,7 +51,6 @@ static IConfigurationSection GetConnectionStringOrSettingSection(IConfiguration } return section; -#endif } } } diff --git a/src/WebJobs.Extensions.DurableTask/WebJobsConnectionStringProvider.cs b/src/WebJobs.Extensions.DurableTask/WebJobsConnectionStringProvider.cs index b5786fda7..7a6ca672c 100644 --- a/src/WebJobs.Extensions.DurableTask/WebJobsConnectionStringProvider.cs +++ b/src/WebJobs.Extensions.DurableTask/WebJobsConnectionStringProvider.cs @@ -12,7 +12,6 @@ namespace Microsoft.Azure.WebJobs.Extensions.DurableTask [Obsolete("Please use WebJobsConnectionInfoProvider instead.")] public class WebJobsConnectionStringProvider : IConnectionStringResolver { -#if !FUNCTIONS_V1 private readonly IConfiguration hostConfiguration; /// @@ -29,12 +28,5 @@ public string Resolve(string connectionStringName) { return this.hostConfiguration.GetWebJobsConnectionString(connectionStringName); } -#else - /// - public string Resolve(string connectionStringName) - { - return Microsoft.Azure.WebJobs.Host.AmbientConnectionStringProvider.Instance.GetConnectionString(connectionStringName); - } -#endif } } \ No newline at end of file diff --git a/test/Common/DurableClientBaseTests.cs b/test/Common/DurableClientBaseTests.cs index 1552e5b95..d8b1589c2 100644 --- a/test/Common/DurableClientBaseTests.cs +++ b/test/Common/DurableClientBaseTests.cs @@ -7,11 +7,9 @@ using System.Net.Http; using System.Threading.Tasks; using DurableTask.Core; -#if !FUNCTIONS_V1 using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Options; -#endif using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; @@ -165,7 +163,6 @@ public async Task TerminateAsync_NonRunningOrchestrator_ThrowsException() orchestrationServiceClientMock.Verify(x => x.ForceTerminateTaskOrchestrationAsync(It.IsAny(), It.IsAny()), Times.Never()); } -#if !FUNCTIONS_V1 [Fact] [Trait("Category", PlatformSpecificHelpers.TestCategory)] public async Task DurableClient_ExternalApp_StartNewAsync_ReturnsInstanceId() @@ -310,7 +307,6 @@ private static async Task ConvertHttpRequestMessageAsync(HttpReques return context.Request; } -#endif private static async Task AssertHttpResponsesEqual(HttpResponseMessage response1, HttpResponseMessage response2) { diff --git a/test/Common/DurableTaskEndToEndTests.cs b/test/Common/DurableTaskEndToEndTests.cs index 9b5d279a6..eea80def7 100644 --- a/test/Common/DurableTaskEndToEndTests.cs +++ b/test/Common/DurableTaskEndToEndTests.cs @@ -20,10 +20,8 @@ using Microsoft.Azure.WebJobs.Host; using Microsoft.Azure.WebJobs.Host.TestCommon; using Microsoft.Diagnostics.Tracing; -#if !FUNCTIONS_V1 using Microsoft.Extensions.Hosting; using WebJobs.Extensions.DurableTask.Tests.V2; -#endif using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; @@ -92,10 +90,8 @@ private void OnEventSourceListenerTraceLog(object sender, LogEventTraceListener. [Trait("Category", PlatformSpecificHelpers.TestCategory)] [InlineData(true, TestHelpers.AzureStorageProviderType)] [InlineData(false, TestHelpers.AzureStorageProviderType)] -#if !FUNCTIONS_V1 [InlineData(true, TestHelpers.EmulatorProviderType)] [InlineData(false, TestHelpers.EmulatorProviderType)] -#endif public async Task HelloWorldOrchestration_Inline(bool extendedSessions, string storageProviderType) { string[] orchestratorFunctionNames = @@ -220,7 +216,6 @@ public async Task DurableClient_AzureStorage_SuccessfulSetup() } } -#if !FUNCTIONS_V1 /// /// End to end test that ensures that customers can configure custom connection string names /// using DurableClientOptions when they create a DurableClient from an external app (e.g. ASP.NET Core app). @@ -259,7 +254,6 @@ public async Task DurableClient_AzureStorage__ReadsCustomStorageConnString() await clientHost.StopAsync(); } } -#endif /// /// End-to-end test which validates a simple orchestrator function does not have assigned value for . @@ -292,7 +286,6 @@ public async Task ParentInstanceId_Not_Assigned_In_Orchestrator(bool extendedSes } } -#if !FUNCTIONS_V1 /// /// By simulating the appropiate environment variables for Linux Consumption, /// this test checks that we are emitting logs from DurableTask.AzureStorage @@ -787,7 +780,6 @@ await TestHelpers.WaitUntilTrue( conditionDescription: "Log file contains all required fields and expected events", timeout: TimeSpan.FromSeconds(35)); } -#endif /// /// End-to-end test which runs a simple orchestrator function that calls a single activity function. @@ -2459,7 +2451,6 @@ public async Task StartOrchestration_OnUnregisteredOrchestrator(bool extendedSes } } -#if !FUNCTIONS_V1 /// /// End-to-end test which creates an external client that calls a non-existent orchestrator function. /// @@ -2589,7 +2580,6 @@ public async Task NonexistentActivity_OrchestratorFunctionFails(bool extendedSes await newHost.StopAsync(); } } -#endif /// /// End-to-end test which runs a orchestrator function that calls a non-existent activity function. @@ -2724,11 +2714,7 @@ public async Task HandleUncallableOrchestrator(bool extendedSessions, string sto Assert.NotNull(status); Assert.Equal(OrchestrationRuntimeStatus.Failed, status.RuntimeStatus); -#if FUNCTIONS_V1 - Assert.Equal("Orchestrator function 'UncallableOrchestrator' failed: Exception has been thrown by the target of an invocation.", status.Output.ToString()); -#else Assert.Equal("Orchestrator function 'UncallableOrchestrator' failed: Exception of type 'System.Exception' was thrown.", status.Output.ToString()); -#endif await host.StopAsync(); } @@ -5783,11 +5769,7 @@ public async Task ReplaySafeLogger_LogsOnlyOnce() var status = await client.WaitForCompletionAsync(this.output); Assert.Equal(OrchestrationRuntimeStatus.Completed, status?.RuntimeStatus); -#if FUNCTIONS_V1 - var logger = this.loggerProvider.CreatedLoggers.FirstOrDefault(l => l.Category.Equals("Function")); -#else var logger = this.loggerProvider.CreatedLoggers.FirstOrDefault(l => l.Category.Equals("Function.ReplaySafeLogger_OneLogMessage.User")); -#endif var logMessages = logger.LogMessages.Where( msg => msg.FormattedMessage.Contains("ReplaySafeLogger Test: About to say Hello")).ToList(); Assert.Single(logMessages); diff --git a/test/Common/StorageServiceClientProviderFactoryTests.cs b/test/Common/StorageServiceClientProviderFactoryTests.cs index 6f273dbcb..b3608fc74 100644 --- a/test/Common/StorageServiceClientProviderFactoryTests.cs +++ b/test/Common/StorageServiceClientProviderFactoryTests.cs @@ -2,10 +2,8 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using System; -#if !FUNCTIONS_V1 using System.Collections.Generic; using System.Linq; -#endif using System.Linq.Expressions; using System.Reflection; using Azure.Data.Tables; @@ -13,18 +11,14 @@ using Azure.Storage.Queues; using DurableTask.AzureStorage; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Storage; -#if !FUNCTIONS_V1 using Microsoft.Extensions.Azure; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -#endif using Moq; -#if !FUNCTIONS_V1 using Newtonsoft.Json; using Newtonsoft.Json.Converters; -#endif using Xunit; namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.Tests @@ -33,7 +27,6 @@ public class StorageServiceClientProviderFactoryTests { private const string EmulatorKey = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="; -#if !FUNCTIONS_V1 private readonly AzureComponentFactory componentFactory; private readonly AzureEventSourceLogForwarder logForwarder; @@ -49,7 +42,6 @@ public StorageServiceClientProviderFactoryTests() this.componentFactory = provider.GetRequiredService(); this.logForwarder = provider.GetRequiredService(); } -#endif [Fact] [Trait("Category", PlatformSpecificHelpers.TestCategory)] @@ -126,7 +118,6 @@ public void GetTableClientProvider_ConnectionString(string connectionString, str Assert.Equal(new Uri(expectedEndpoint, UriKind.Absolute), actual.Uri); } -#if !FUNCTIONS_V1 [Theory] [Trait("Category", PlatformSpecificHelpers.TestCategory)] @@ -251,18 +242,13 @@ private static Dictionary Serialize(T value) settings); } -#endif private StorageServiceClientProviderFactory SetupClientProviderFactory(string connectionName, string connectionString) { var mock = new Mock(MockBehavior.Strict); mock.Setup(r => r.Resolve(connectionName)).Returns(new ReadOnlyConfigurationValue(connectionName, connectionString)); -#if FUNCTIONS_V1 - return new StorageServiceClientProviderFactory(mock.Object); -#else return new StorageServiceClientProviderFactory(mock.Object, this.componentFactory, this.logForwarder); -#endif } private sealed class AzureStorageAccountOptions diff --git a/test/Common/TestDataGenerator.cs b/test/Common/TestDataGenerator.cs index 8d20d0d1a..47f606f5b 100644 --- a/test/Common/TestDataGenerator.cs +++ b/test/Common/TestDataGenerator.cs @@ -9,11 +9,7 @@ public class TestDataGenerator { private static readonly object[] BoolOptions = new object[] { true, false }; private static readonly object[] FullFeaturedStorageProviders = new object[] { TestHelpers.AzureStorageProviderType }; -#if !FUNCTIONS_V1 private static readonly object[] AllStorageProviders = new object[] { TestHelpers.AzureStorageProviderType, TestHelpers.RedisProviderType }; -#else - private static readonly object[] AllStorageProviders = new object[] { TestHelpers.AzureStorageProviderType }; -#endif public static IEnumerable GetFullFeaturedStorageProviderOptions() { diff --git a/test/Common/TestEntityClasses.cs b/test/Common/TestEntityClasses.cs index 32ee6c651..665a7f968 100644 --- a/test/Common/TestEntityClasses.cs +++ b/test/Common/TestEntityClasses.cs @@ -6,16 +6,11 @@ using System.IO; using System.Linq; using System.Reflection; -#if !FUNCTIONS_V1 using System.Text; -#endif -using System.Threading.Tasks; -#if !FUNCTIONS_V1 using Azure.Storage.Blobs; using Azure.Storage.Blobs.Specialized; #else using Microsoft.WindowsAzure.Storage.Blob; -#endif using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Serialization; @@ -143,11 +138,7 @@ public static Task JobFunction([EntityTrigger] IDurableEntityContext context) [FunctionName(nameof(StorageBackedCounter))] public static Task StorageBackedCounterFunction( [EntityTrigger] IDurableEntityContext context, -#if FUNCTIONS_V1 - [Blob(BlobContainerPath)] CloudBlobContainer blobContainer) -#else [Blob(BlobContainerPath)] BlobContainerClient blobContainer) -#endif { return context.DispatchAsync(blobContainer); } @@ -569,15 +560,9 @@ public class StorageBackedCounter : IAsyncCounter { private const string BlobName = "counter"; -#if FUNCTIONS_V1 - private readonly CloudBlobContainer blobContainer; - - public StorageBackedCounter(CloudBlobContainer blobContainer) -#else private readonly BlobContainerClient blobContainer; public StorageBackedCounter(BlobContainerClient blobContainer) -#endif { this.blobContainer = blobContainer; } @@ -598,11 +583,7 @@ public async Task Add(int value) public async Task Get() { -#if FUNCTIONS_V1 - CloudBlockBlob environmentVariableBlob = this.blobContainer.GetBlockBlobReference(BlobName); -#else BlockBlobClient environmentVariableBlob = this.blobContainer.GetBlockBlobClient(BlobName); -#endif if (await environmentVariableBlob.ExistsAsync()) { var readStream = await environmentVariableBlob.OpenReadAsync(); @@ -627,16 +608,11 @@ public async Task Get() public async Task Set(int newValue) { this.Value = newValue; -#if FUNCTIONS_V1 - CloudBlockBlob environmentVariableBlob = this.blobContainer.GetBlockBlobReference(BlobName); - await environmentVariableBlob.UploadTextAsync(newValue.ToString()); -#else BlockBlobClient environmentVariableBlob = this.blobContainer.GetBlockBlobClient(BlobName); using (var buffer = new MemoryStream(Encoding.UTF8.GetBytes(newValue.ToString()))) { await environmentVariableBlob.UploadAsync(buffer); } -#endif } public void Delete() diff --git a/test/Common/TestOrchestrations.cs b/test/Common/TestOrchestrations.cs index bfd4d8170..ef456818c 100644 --- a/test/Common/TestOrchestrations.cs +++ b/test/Common/TestOrchestrations.cs @@ -1094,11 +1094,7 @@ public static async Task HandleUncallableFunctions([OrchestrationTrigger { var result = await ctx.CallEntityAsync(entityId, "get"); } -#if FUNCTIONS_V1 - catch (Exception e) when (e.Message == "Exception has been thrown by the target of an invocation.") -#else catch (Exception e) when (e.Message == "Exception of type 'System.Exception' was thrown.") -#endif { } } @@ -1116,11 +1112,7 @@ public static async Task HandleUncallableFunctions([OrchestrationTrigger { var result = await ctx.CallActivityAsync(nameof(UnconstructibleClass.UncallableActivity), null); } -#if FUNCTIONS_V1 - catch (FunctionFailedException e) when (e.Message == "The activity function 'UncallableActivity' failed: \"Exception has been thrown by the target of an invocation.\". See the function execution logs for additional details.") -#else catch (FunctionFailedException e) when (e.Message == "The activity function 'UncallableActivity' failed: \"Exception of type 'System.Exception' was thrown.\". See the function execution logs for additional details.") -#endif { } diff --git a/test/Common/WebJobsConnectionInfoProviderTests.cs b/test/Common/WebJobsConnectionInfoProviderTests.cs index 82bc4e850..904e6ca9f 100644 --- a/test/Common/WebJobsConnectionInfoProviderTests.cs +++ b/test/Common/WebJobsConnectionInfoProviderTests.cs @@ -17,23 +17,6 @@ public class WebJobsConnectionInfoProviderTests [InlineData(true)] public void Resolve(bool prefixNames) { -#if FUNCTIONS_V1 - // Instead of mocking ConfigurationManager.ConnectionStrings, use environment variables - string connectionName = Guid.NewGuid().ToString(); - string previousValue = Environment.GetEnvironmentVariable(AddPrefix(connectionName, prefixNames), EnvironmentVariableTarget.Process); - Environment.SetEnvironmentVariable(AddPrefix(connectionName, prefixNames), "Foo=Bar;Baz", EnvironmentVariableTarget.Process); - - try - { - var provider = new WebJobsConnectionInfoProvider(); - Assert.Equal("Foo=Bar;Baz", provider.Resolve(connectionName).Value); - Assert.Null(provider.Resolve(Guid.NewGuid().ToString()).Value); - } - finally - { - Environment.SetEnvironmentVariable(AddPrefix(connectionName, prefixNames), previousValue, EnvironmentVariableTarget.Process); - } -#else IConfiguration config = new ConfigurationBuilder() .AddInMemoryCollection( new KeyValuePair[] @@ -51,7 +34,6 @@ public void Resolve(bool prefixNames) Assert.Equal("https://foo.bar/baz", provider.Resolve("MyOtherConnectionString").Value); Assert.Equal("MyAccount", provider.Resolve("MyConnection")["AccountName"]); Assert.Equal("MyOtherAccount", provider.Resolve("MyOtherConnection")["AccountName"]); -#endif } private static string AddPrefix(string name, bool prefix) => From 1ff4833151a77c9725660c9e37c4cc40d5199ff7 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Tue, 25 Jun 2024 21:00:35 -0700 Subject: [PATCH 02/19] delete v1 test --- .../PlatformSpecificHelpers.FunctionsV1.cs | 136 ------------------ ...obs.Extensions.DurableTask.Tests.V1.csproj | 62 -------- test/FunctionsV1/app.config | 14 -- 3 files changed, 212 deletions(-) delete mode 100644 test/FunctionsV1/PlatformSpecificHelpers.FunctionsV1.cs delete mode 100644 test/FunctionsV1/WebJobs.Extensions.DurableTask.Tests.V1.csproj delete mode 100644 test/FunctionsV1/app.config diff --git a/test/FunctionsV1/PlatformSpecificHelpers.FunctionsV1.cs b/test/FunctionsV1/PlatformSpecificHelpers.FunctionsV1.cs deleted file mode 100644 index 59ed65ae8..000000000 --- a/test/FunctionsV1/PlatformSpecificHelpers.FunctionsV1.cs +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; -using Microsoft.ApplicationInsights.Channel; -using Microsoft.Azure.WebJobs.Extensions.DurableTask.Storage; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; - -namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.Tests -{ - /// - /// These helpers are specific to Functions v1. - /// IMPORTANT: Method signatures must be kept source compatible with the Functions v2 version. - /// - public static class PlatformSpecificHelpers - { - public const string VersionSuffix = "V1"; - public const string TestCategory = "Functions" + VersionSuffix; - public const string FlakeyTestCategory = TestCategory + "_Flakey"; - - public static ITestHost CreateJobHost( - IOptions options, - string storageProvider, - ILoggerProvider loggerProvider, - INameResolver nameResolver, - IDurableHttpMessageHandlerFactory durableHttpMessageHandler, - ILifeCycleNotificationHelper lifeCycleNotificationHelper, - IMessageSerializerSettingsFactory serializerSettingsFactory, - IApplicationLifetimeWrapper shutdownNotificationService = null, - Action onSend = null, -#pragma warning disable CS0612 // Type or member is obsolete - IPlatformInformation platformInformationService = null) -#pragma warning restore CS0612 // Type or member is obsolete - { - var config = new JobHostConfiguration { HostId = "durable-task-host" }; - config.TypeLocator = TestHelpers.GetTypeLocator(); - - var clientProviderFactory = new StorageServiceClientProviderFactory(new WebJobsConnectionInfoProvider()); - - var loggerFactory = new LoggerFactory(); - loggerFactory.AddProvider(loggerProvider); - - // Unless specified, use table partition management for tests as it makes the task hubs start up faster. - // These tests run on a single task hub workers, so they don't test partition management anyways, and that is tested - // in the DTFx repo. - if (options.Value.StorageProvider.ContainsKey(nameof(AzureStorageOptions.UseLegacyPartitionManagement))) - { - options.Value.StorageProvider.Add(nameof(AzureStorageOptions.UseTablePartitionManagement), false); - } - - platformInformationService = platformInformationService ?? new DefaultPlatformInformation(nameResolver, loggerFactory); - - IDurabilityProviderFactory orchestrationServiceFactory = new AzureStorageDurabilityProviderFactory( - options, - clientProviderFactory, - nameResolver, - loggerFactory, - platformInformationService); - - var extension = new DurableTaskExtension( - options, - loggerFactory, - nameResolver, - new[] { orchestrationServiceFactory }, - shutdownNotificationService ?? new TestHostShutdownNotificationService(), - durableHttpMessageHandler, - lifeCycleNotificationHelper, - serializerSettingsFactory, - platformInformationService); - config.UseDurableTask(extension); - - // Mock INameResolver for not setting EnvironmentVariables. - if (nameResolver != null) - { - config.AddService(nameResolver); - } - - // Performance is *significantly* worse when dashboard logging is enabled, at least - // when running in the storage emulator. Disabling to keep tests running quickly. - config.DashboardConnectionString = null; - - // Add test logger - config.LoggerFactory = loggerFactory; - - var host = new JobHost(config); - return new FunctionsV1HostWrapper(host, options, clientProviderFactory); - } - - private class FunctionsV1HostWrapper : ITestHost - { - private readonly JobHost innerHost; - private readonly DurableTaskOptions options; - private readonly IStorageServiceClientProviderFactory clientProviderFactory; - - public FunctionsV1HostWrapper( - JobHost innerHost, - IOptions options, - IStorageServiceClientProviderFactory clientProviderFactory) - { - this.innerHost = innerHost ?? throw new ArgumentNullException(nameof(innerHost)); - this.options = options.Value; - this.clientProviderFactory = clientProviderFactory; - } - - public Task CallAsync(string methodName, IDictionary args) - => this.innerHost.CallAsync(methodName, args); - - public Task CallAsync(MethodInfo method, IDictionary args) - => this.innerHost.CallAsync(method, args); - - public void Dispose() - { - this.innerHost.Dispose(); - } - - public Task StartAsync() => this.innerHost.StartAsync(); - - public async Task StopAsync() - { - try - { - await this.innerHost.StopAsync(); - } - catch (OperationCanceledException) - { - // ignore - } - } - } - } -} \ No newline at end of file diff --git a/test/FunctionsV1/WebJobs.Extensions.DurableTask.Tests.V1.csproj b/test/FunctionsV1/WebJobs.Extensions.DurableTask.Tests.V1.csproj deleted file mode 100644 index a28682cf5..000000000 --- a/test/FunctionsV1/WebJobs.Extensions.DurableTask.Tests.V1.csproj +++ /dev/null @@ -1,62 +0,0 @@ - - - - net462 - Microsoft Corporation - SA0001;SA1600;SA1615 - true - ..\..\sign.snk - 10.0 - - - - true - - true - - - - - - - - - - - - - - - - - - - - - - - - - FUNCTIONS_V1 - - - - - - - - - - - - - PreserveNewest - - - - - - - - - \ No newline at end of file diff --git a/test/FunctionsV1/app.config b/test/FunctionsV1/app.config deleted file mode 100644 index d78fa8803..000000000 --- a/test/FunctionsV1/app.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - From bec2fe9cfd3eaef76bcf87e014ece2401b6c972f Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Tue, 25 Jun 2024 21:14:22 -0700 Subject: [PATCH 03/19] delete v1 tests and update test framework --- ...rableTaskJobHostConfigurationExtensions.cs | 1 - .../WebJobs.Extensions.DurableTask.csproj | 2 +- test/DFPerfScenariosV1/Common.cs | 27 ------ test/DFPerfScenariosV1/DFPerfScenarios.sln | 31 ------- .../DFPerfScenariosV1.csproj | 27 ------ test/DFPerfScenariosV1/Tests/Counter.cs | 70 --------------- test/DFPerfScenariosV1/Tests/FanOutFanIn.cs | 58 ------------- .../Tests/ManySequencesTest.cs | 85 ------------------- .../Tests/SubOrchestrationFanOutFanIn.cs | 51 ----------- test/DFPerfScenariosV1/host.json | 20 ----- test/DFPerfScenariosV1/local.settings.json | 7 -- .../durableJS/extensions.csproj | 2 +- .../durablePy/extensions.csproj | 2 +- test/SmokeTests/SmokeTestsV1/HelloSequence.cs | 40 --------- test/SmokeTests/SmokeTestsV1/HttpStart.cs | 30 ------- .../SmokeTests/SmokeTestsV1/VSSampleV1.csproj | 23 ----- test/SmokeTests/SmokeTestsV1/host.json | 5 -- .../SmokeTestsV1/local.settings.json | 7 -- .../SmokeTests/SmokeTestsV2/VSSampleV2.csproj | 2 +- .../SmokeTests/SmokeTestsV3/VSSampleV3.csproj | 2 +- test/TimeoutTests/CSharp/TimeoutTests.csproj | 4 +- test/TimeoutTests/Python/extensions.csproj | 2 +- 22 files changed, 8 insertions(+), 490 deletions(-) delete mode 100644 test/DFPerfScenariosV1/Common.cs delete mode 100644 test/DFPerfScenariosV1/DFPerfScenarios.sln delete mode 100644 test/DFPerfScenariosV1/DFPerfScenariosV1.csproj delete mode 100644 test/DFPerfScenariosV1/Tests/Counter.cs delete mode 100644 test/DFPerfScenariosV1/Tests/FanOutFanIn.cs delete mode 100644 test/DFPerfScenariosV1/Tests/ManySequencesTest.cs delete mode 100644 test/DFPerfScenariosV1/Tests/SubOrchestrationFanOutFanIn.cs delete mode 100644 test/DFPerfScenariosV1/host.json delete mode 100644 test/DFPerfScenariosV1/local.settings.json delete mode 100644 test/SmokeTests/SmokeTestsV1/HelloSequence.cs delete mode 100644 test/SmokeTests/SmokeTestsV1/HttpStart.cs delete mode 100644 test/SmokeTests/SmokeTestsV1/VSSampleV1.csproj delete mode 100644 test/SmokeTests/SmokeTestsV1/host.json delete mode 100644 test/SmokeTests/SmokeTestsV1/local.settings.json diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs index c0e864bdd..8a99065fb 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs @@ -15,7 +15,6 @@ using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -#else using Microsoft.Azure.WebJobs.Extensions.DurableTask.ContextImplementations; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Options; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Storage; diff --git a/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj b/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj index 540005a7e..21dbbc153 100644 --- a/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj +++ b/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj @@ -62,7 +62,7 @@ - + diff --git a/test/DFPerfScenariosV1/Common.cs b/test/DFPerfScenariosV1/Common.cs deleted file mode 100644 index 681128179..000000000 --- a/test/DFPerfScenariosV1/Common.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.Azure.WebJobs; -using Microsoft.Azure.WebJobs.Extensions.DurableTask; - -namespace DFPerfScenarios -{ - public static class Common - { - [FunctionName(nameof(HelloSequence))] - public static async Task> HelloSequence( - [OrchestrationTrigger] IDurableOrchestrationContext context) - { - List outputs = new List(); - outputs.Add(await context.CallActivityAsync("SayHello", "Tokyo")); - outputs.Add(await context.CallActivityAsync("SayHello", "Seattle")); - outputs.Add(await context.CallActivityAsync("SayHello", "London")); - return outputs; - } - - [FunctionName(nameof(SayHello))] - public static string SayHello([ActivityTrigger] string name) => $"Hello {name}!"; - } -} diff --git a/test/DFPerfScenariosV1/DFPerfScenarios.sln b/test/DFPerfScenariosV1/DFPerfScenarios.sln deleted file mode 100644 index fa09670db..000000000 --- a/test/DFPerfScenariosV1/DFPerfScenarios.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29324.140 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DFPerfScenarios", "DFPerfScenarios.csproj", "{59185532-DA62-4870-BED0-4D7E7871BA6A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebJobs.Extensions.DurableTask", "..\..\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj", "{0D3C23B4-49AA-4D03-9869-E693687A432A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {59185532-DA62-4870-BED0-4D7E7871BA6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {59185532-DA62-4870-BED0-4D7E7871BA6A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {59185532-DA62-4870-BED0-4D7E7871BA6A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {59185532-DA62-4870-BED0-4D7E7871BA6A}.Release|Any CPU.Build.0 = Release|Any CPU - {0D3C23B4-49AA-4D03-9869-E693687A432A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0D3C23B4-49AA-4D03-9869-E693687A432A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0D3C23B4-49AA-4D03-9869-E693687A432A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0D3C23B4-49AA-4D03-9869-E693687A432A}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {4584B3DE-C5E0-4647-ADD0-2334CEAC7869} - EndGlobalSection -EndGlobal diff --git a/test/DFPerfScenariosV1/DFPerfScenariosV1.csproj b/test/DFPerfScenariosV1/DFPerfScenariosV1.csproj deleted file mode 100644 index 9706a9569..000000000 --- a/test/DFPerfScenariosV1/DFPerfScenariosV1.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - net462 - v1 - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - - - - - diff --git a/test/DFPerfScenariosV1/Tests/Counter.cs b/test/DFPerfScenariosV1/Tests/Counter.cs deleted file mode 100644 index de8b2dd9d..000000000 --- a/test/DFPerfScenariosV1/Tests/Counter.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Threading.Tasks; -using Microsoft.Azure.WebJobs; -using Microsoft.Azure.WebJobs.Extensions.DurableTask; -using Microsoft.Azure.WebJobs.Extensions.Http; -using Microsoft.Extensions.Logging; -using Newtonsoft.Json; - -namespace DFPerfScenarios -{ - public static class CounterTest - { - [FunctionName("StartCounter")] - public static HttpResponseMessage Start( - [HttpTrigger(AuthorizationLevel.Function, methods: "post", Route = "StartCounter")] HttpRequestMessage req, - [DurableClient] IDurableClient starter, - ILogger log) - { - if (!int.TryParse(req.GetQueryNameValuePairs().First(q => q.Key == "count").Value, out int count) || count < 1) - { - return new HttpResponseMessage - { - StatusCode = HttpStatusCode.BadRequest, - ReasonPhrase = "A 'count' query string parameter is required and it must contain a positive number." - }; - } - - var entityId = new EntityId("Counter", Guid.NewGuid().ToString("N")); - - log.LogInformation($"Sending {count} messages..."); - var parallelOptions = new ParallelOptions - { - MaxDegreeOfParallelism = 200 - }; - - Parallel.For(0, count, parallelOptions, delegate (int i) - { - starter.SignalEntityAsync(entityId, "add", 1).GetAwaiter().GetResult(); - }); - - return req.CreateResponse(HttpStatusCode.Accepted); - } - - private class Input - { - public int EventCount { get; set; } = 100; - - public int Instances { get; set; } = 1; - } - } - - public class Counter - { - [JsonProperty("value")] - public int CurrentValue { get; set; } - - public void Add(int amount) => this.CurrentValue += amount; - - public void Reset() => this.CurrentValue = 0; - - public int Get() => this.CurrentValue; - - [FunctionName(nameof(Counter))] - public static Task Run([EntityTrigger] IDurableEntityContext ctx) - => ctx.DispatchAsync(); - } -} diff --git a/test/DFPerfScenariosV1/Tests/FanOutFanIn.cs b/test/DFPerfScenariosV1/Tests/FanOutFanIn.cs deleted file mode 100644 index d236d8d2c..000000000 --- a/test/DFPerfScenariosV1/Tests/FanOutFanIn.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Microsoft.Azure.WebJobs; -using Microsoft.Azure.WebJobs.Extensions.DurableTask; -using Microsoft.Azure.WebJobs.Extensions.Http; -using Microsoft.Azure.WebJobs.Host; -using Microsoft.Extensions.Logging; -using System; -using System.Diagnostics; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Threading.Tasks; - -namespace DFPerfScenarios -{ - public static class FanOutFanIn - { - [FunctionName("StartFanOutFanIn")] - public static async Task Start( - [HttpTrigger(AuthorizationLevel.Function, methods: "post", Route = "StartFanOutFanIn")] HttpRequestMessage req, - [DurableClient] IDurableOrchestrationClient starter, - ILogger log) - { - if (!int.TryParse(req.GetQueryNameValuePairs().First(q => q.Key == "count").Value, out int count) || count < 1) - { - return new HttpResponseMessage - { - StatusCode = HttpStatusCode.BadRequest, - ReasonPhrase = "A 'count' query string parameter is required and it must contain a positive number." - }; - } - - string instanceId = await starter.StartNewAsync("FanOutFanIn", count); - log.LogInformation("Started FanOutFanIn orchestration with ID = '" + instanceId + "'."); - return starter.CreateCheckStatusResponse(req, instanceId); - } - - [FunctionName("FanOutFanIn")] - public static async Task FanOutFanInOrchestration([OrchestrationTrigger] IDurableOrchestrationContext context) - { - Stopwatch sw = new Stopwatch(); - if (!context.IsReplaying) - { - sw = Stopwatch.StartNew(); - } - - int count = context.GetInput(); - - Task[] tasks = new Task[count]; - for (int i = 0; i < tasks.Length; i++) - { - tasks[i] = context.CallActivityAsync("SayHello", i.ToString("0000")); - } - - await Task.WhenAll(tasks); - return sw.Elapsed; - } - } -} diff --git a/test/DFPerfScenariosV1/Tests/ManySequencesTest.cs b/test/DFPerfScenariosV1/Tests/ManySequencesTest.cs deleted file mode 100644 index 600722896..000000000 --- a/test/DFPerfScenariosV1/Tests/ManySequencesTest.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Azure.WebJobs; -using Microsoft.Azure.WebJobs.Extensions.DurableTask; -using Microsoft.Azure.WebJobs.Extensions.Http; -using Microsoft.Extensions.Logging; - -namespace DFPerfScenarios.Tests -{ - public static class ManySequencesTest - { - [FunctionName(nameof(StartManySequences))] - public static HttpResponseMessage StartManySequences( - [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequestMessage req, - [DurableClient] IDurableClient starter, - ILogger log) - { - if (!int.TryParse(req.GetQueryNameValuePairs().First(q => q.Key == "count").Value, out int count) || count < 1) - { - return new HttpResponseMessage - { - StatusCode = HttpStatusCode.BadRequest, - ReasonPhrase = "A 'count' query string parameter is required and it must contain a positive number." - }; - } - - string orchestratorName = nameof(ManySequencesOrchestrator); - string instanceId = $"{orchestratorName}-{DateTime.UtcNow:yyyyMMdd-hhmmss}"; - starter.StartNewAsync(orchestratorName, instanceId, count); - - return starter.CreateCheckStatusResponse(req, instanceId); - } - - [FunctionName(nameof(ManySequencesOrchestrator))] - public static async Task ManySequencesOrchestrator( - [OrchestrationTrigger] IDurableOrchestrationContext context) - { - int count = context.GetInput(); - - context.SetCustomStatus( - $"Scheduling {count:N0} {nameof(Common.HelloSequence)} sequences..."); - - var instances = new List(capacity: count); - for (int i = 0; i < count; i++) - { - string instanceId = $"{context.InstanceId}-sub{i:X16}"; - instances.Add(context.CallSubOrchestratorAsync(nameof(Common.HelloSequence), input: null)); - - // Checkpoint every 1K instances to avoid an overly long persistence pauses - if (i > 0 && i % 1000 == 0) - { - await context.CreateTimer(context.CurrentUtcDateTime, CancellationToken.None); - } - } - - context.SetCustomStatus( - $"All {count:N0} {nameof(Common.HelloSequence)} sequences were scheduled successfully. Waiting for completion..."); - - try - { - // wait for all instances to complete - await Task.WhenAll(instances); - } - catch - { - // ignore failures - } - - int succeeded = instances.Count(i => i.IsCompleted); - int failed = instances.Count(i => i.IsFaulted); - - context.SetCustomStatus( - $"All {count:N0} {nameof(Common.HelloSequence)} sequences have completed. Succeeded: **{succeeded}**. Failed: **{failed}**."); - } - } -} \ No newline at end of file diff --git a/test/DFPerfScenariosV1/Tests/SubOrchestrationFanOutFanIn.cs b/test/DFPerfScenariosV1/Tests/SubOrchestrationFanOutFanIn.cs deleted file mode 100644 index 09a5b25ac..000000000 --- a/test/DFPerfScenariosV1/Tests/SubOrchestrationFanOutFanIn.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Microsoft.Azure.WebJobs; -using Microsoft.Azure.WebJobs.Extensions.Http; -using Microsoft.Extensions.Logging; -using System.Net; -using System.Net.Http; -using System.Threading.Tasks; -using System.Linq; -using Microsoft.Azure.WebJobs.Extensions.DurableTask; - -namespace DFPerfScenarios -{ - public static class SubOrchestrationFanOutFanIn - { - [FunctionName("StartSubOrchestrationFanOutFanIn")] - public static async Task Start( - [HttpTrigger(AuthorizationLevel.Function, methods: "post", Route = "StartSubOrchestrationFanOutFanIn")] HttpRequestMessage req, - [DurableClient] IDurableOrchestrationClient starter, - ILogger log) - { - if (!int.TryParse(req.GetQueryNameValuePairs().First(q => q.Key == "count").Value, out int count) || count < 1) - { - return new HttpResponseMessage - { - StatusCode = HttpStatusCode.BadRequest, - ReasonPhrase = "A 'count' query string parameter is required and it must contain a positive number." - }; - } - - string instanceId = await starter.StartNewAsync("FanOutFanInOrchestration", count); - log.LogWarning("Started FanOutFanInOrchestration orchestration with ID = '" + instanceId + "'."); - return starter.CreateCheckStatusResponse(req, instanceId); - } - - [FunctionName("FanOutFanInOrchestration")] - public static async Task FanOutFanInOrchestration([OrchestrationTrigger] IDurableOrchestrationContext context) - { - Task[] array = new Task[context.GetInput()]; - for (int i = 0; i < array.Length; i++) - { - array[i] = context.CallSubOrchestratorAsync("NoOpOrchestration", (object)i); - } - await Task.WhenAll(array); - } - - [FunctionName("NoOpOrchestration")] - public static int NoOpOrchestration([OrchestrationTrigger] IDurableOrchestrationContext ctx) - { - return ctx.GetInput(); - } - } -} diff --git a/test/DFPerfScenariosV1/host.json b/test/DFPerfScenariosV1/host.json deleted file mode 100644 index eb932b2b9..000000000 --- a/test/DFPerfScenariosV1/host.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "http": { - "routePrefix": "tests" - }, - "durableTask": { - "maxConcurrentActivityFunctions": 400, - "maxConcurrentOrchestratorFunctions": 400, - "extendedSessionsEnabled": true, - "extendedSessionIdleTimeoutInSeconds": 30, - "storageProvider": { - "partitionCount": 6, - "controlQueueBufferThreshold": 1000 - } - }, - "applicationInsights": { - "sampling": { - "isEnabled": true - } - } -} \ No newline at end of file diff --git a/test/DFPerfScenariosV1/local.settings.json b/test/DFPerfScenariosV1/local.settings.json deleted file mode 100644 index ec1826b46..000000000 --- a/test/DFPerfScenariosV1/local.settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "IsEncrypted": false, - "Values": { - "AzureWebJobsStorage": "UseDevelopmentStorage=true", - "FUNCTIONS_WORKER_RUNTIME": "dotnet" - } -} \ No newline at end of file diff --git a/test/SmokeTests/OOProcSmokeTests/durableJS/extensions.csproj b/test/SmokeTests/OOProcSmokeTests/durableJS/extensions.csproj index aa60480cd..aa1d20318 100644 --- a/test/SmokeTests/OOProcSmokeTests/durableJS/extensions.csproj +++ b/test/SmokeTests/OOProcSmokeTests/durableJS/extensions.csproj @@ -1,6 +1,6 @@  - netstandard2.0 + net6.0 ** diff --git a/test/SmokeTests/OOProcSmokeTests/durablePy/extensions.csproj b/test/SmokeTests/OOProcSmokeTests/durablePy/extensions.csproj index 1bf7fc655..49d0b92c1 100644 --- a/test/SmokeTests/OOProcSmokeTests/durablePy/extensions.csproj +++ b/test/SmokeTests/OOProcSmokeTests/durablePy/extensions.csproj @@ -1,6 +1,6 @@  - netstandard2.0 + net6.0 ** diff --git a/test/SmokeTests/SmokeTestsV1/HelloSequence.cs b/test/SmokeTests/SmokeTestsV1/HelloSequence.cs deleted file mode 100644 index 25a8f431d..000000000 --- a/test/SmokeTests/SmokeTestsV1/HelloSequence.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.Azure.WebJobs; -using Microsoft.Azure.WebJobs.Extensions.DurableTask; - -namespace VSSample -{ - public static class HelloSequence - { - [FunctionName("E1_HelloSequence")] - public static async Task> Run( - [OrchestrationTrigger] IDurableOrchestrationContext context) - { - var outputs = new List(); - - outputs.Add(await context.CallActivityAsync("E1_SayHello", "Tokyo")); - outputs.Add(await context.CallActivityAsync("E1_SayHello", "Seattle")); - outputs.Add(await context.CallActivityAsync("E1_SayHello_DirectInput", "London")); - - // returns ["Hello Tokyo!", "Hello Seattle!", "Hello London!"] - return outputs; - } - - [FunctionName("E1_SayHello")] - public static string SayHello([ActivityTrigger] IDurableActivityContext context) - { - string name = context.GetInput(); - return $"Hello {name}!"; - } - - [FunctionName("E1_SayHello_DirectInput")] - public static string SayHelloDirectInput([ActivityTrigger] string name) - { - return $"Hello {name}!"; - } - } - } diff --git a/test/SmokeTests/SmokeTestsV1/HttpStart.cs b/test/SmokeTests/SmokeTestsV1/HttpStart.cs deleted file mode 100644 index 1c66c7ea8..000000000 --- a/test/SmokeTests/SmokeTestsV1/HttpStart.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System.Net.Http; -using System.Threading.Tasks; -using Microsoft.Azure.WebJobs; -using Microsoft.Azure.WebJobs.Extensions.DurableTask; -using Microsoft.Azure.WebJobs.Extensions.Http; -using Microsoft.Extensions.Logging; - -namespace VSSample -{ - public static class HttpStart - { - [FunctionName("HttpStart")] - public static async Task Run( - [HttpTrigger(AuthorizationLevel.Function, methods: "post")] HttpRequestMessage req, - [DurableClient] IDurableClient starter, - ILogger log) - { - // Function input comes from the request content. - object eventData = await req.Content.ReadAsAsync(); - string instanceId = await starter.StartNewAsync("E1_HelloSequence", eventData); - - log.LogInformation($"Started orchestration with ID = '{instanceId}'."); - - return starter.CreateCheckStatusResponse(req, instanceId); - } - } -} diff --git a/test/SmokeTests/SmokeTestsV1/VSSampleV1.csproj b/test/SmokeTests/SmokeTestsV1/VSSampleV1.csproj deleted file mode 100644 index 1d2b30732..000000000 --- a/test/SmokeTests/SmokeTestsV1/VSSampleV1.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - net462 - v1 - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - \ No newline at end of file diff --git a/test/SmokeTests/SmokeTestsV1/host.json b/test/SmokeTests/SmokeTestsV1/host.json deleted file mode 100644 index ef5aa023d..000000000 --- a/test/SmokeTests/SmokeTestsV1/host.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "durableTask": { - "hubName": "DotNetSmokeTestV1" - } -} \ No newline at end of file diff --git a/test/SmokeTests/SmokeTestsV1/local.settings.json b/test/SmokeTests/SmokeTestsV1/local.settings.json deleted file mode 100644 index 1eaca38d6..000000000 --- a/test/SmokeTests/SmokeTestsV1/local.settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "IsEncrypted": false, - "Values": { - "FUNCTIONS_WORKER_RUNTIME": "dotnet", - "AzureWebJobsStorage": "UseDevelopmentStorage=true" - } -} diff --git a/test/SmokeTests/SmokeTestsV2/VSSampleV2.csproj b/test/SmokeTests/SmokeTestsV2/VSSampleV2.csproj index 3900e876f..024ccbd1e 100644 --- a/test/SmokeTests/SmokeTestsV2/VSSampleV2.csproj +++ b/test/SmokeTests/SmokeTestsV2/VSSampleV2.csproj @@ -1,6 +1,6 @@  - netstandard2.0 + net6.0 v2 diff --git a/test/SmokeTests/SmokeTestsV3/VSSampleV3.csproj b/test/SmokeTests/SmokeTestsV3/VSSampleV3.csproj index 8a5ebe832..0381cd963 100644 --- a/test/SmokeTests/SmokeTestsV3/VSSampleV3.csproj +++ b/test/SmokeTests/SmokeTestsV3/VSSampleV3.csproj @@ -1,6 +1,6 @@  - netcoreapp3.1 + net6.0 v3 diff --git a/test/TimeoutTests/CSharp/TimeoutTests.csproj b/test/TimeoutTests/CSharp/TimeoutTests.csproj index a3f4e882a..e754db3a2 100644 --- a/test/TimeoutTests/CSharp/TimeoutTests.csproj +++ b/test/TimeoutTests/CSharp/TimeoutTests.csproj @@ -1,11 +1,11 @@  - netstandard2.0 + net6.0 v3 - + diff --git a/test/TimeoutTests/Python/extensions.csproj b/test/TimeoutTests/Python/extensions.csproj index ec887eddc..dbe31cd06 100644 --- a/test/TimeoutTests/Python/extensions.csproj +++ b/test/TimeoutTests/Python/extensions.csproj @@ -1,6 +1,6 @@  - netstandard2.0 + net6.0 ** From f7b95a6cea876a0542df7f488fad210d5a4ab597 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Tue, 25 Jun 2024 21:24:36 -0700 Subject: [PATCH 04/19] continue delete functions v1 block --- .../DurableTaskExtension.cs | 10 ---------- .../HostLifecycleService.cs | 2 -- .../HttpApiHandler.cs | 2 -- .../Listener/DurableTaskListener.cs | 4 ---- test/Common/TestHelpers.cs | 18 ------------------ 5 files changed, 36 deletions(-) diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs index ef9985251..46baad069 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs @@ -63,11 +63,9 @@ public class DurableTaskExtension : new ConcurrentDictionary(); private readonly AsyncLock taskHubLock = new AsyncLock(); -#if FUNCTIONS_V2_OR_GREATER #pragma warning disable CS0169 private readonly ITelemetryActivator telemetryActivator; #pragma warning restore CS0169 -#endif #if FUNCTIONS_V3_OR_GREATER private readonly LocalGrpcListener localGrpcListener; #endif @@ -128,15 +126,11 @@ public DurableTaskExtension( #pragma warning disable CS0612 // Type or member is obsolete IPlatformInformation platformInformationService = null, #pragma warning restore CS0612 // Type or member is obsolete -#if FUNCTIONS_V2_OR_GREATER IErrorSerializerSettingsFactory errorSerializerSettingsFactory = null, #pragma warning disable CS0618 // Type or member is obsolete IWebHookProvider webhookProvider = null, #pragma warning restore CS0618 // Type or member is obsolete ITelemetryActivator telemetryActivator = null) -#else - IErrorSerializerSettingsFactory errorSerializerSettingsFactory = null) -#endif { this.extensionGuid = Guid.NewGuid(); @@ -419,12 +413,10 @@ void IExtensionConfigProvider.Initialize(ExtensionConfigContext context) this.StartLocalGrpcServer(); } #endif -#if FUNCTIONS_V2_OR_GREATER if (this.OutOfProcProtocol == OutOfProcOrchestrationProtocol.OrchestratorShim) { this.StartLocalHttpServer(); } -#endif } internal string GetLocalRpcAddress() @@ -478,7 +470,6 @@ public void Dispose() this.eventSourceListener?.Dispose(); } -#if FUNCTIONS_V2_OR_GREATER private void StartLocalHttpServer() { bool? shouldEnable = this.Options.LocalRpcEndpointEnabled; @@ -513,7 +504,6 @@ private void StopLocalHttpServer() { this.HttpApiHandler.StopLocalHttpServerAsync().GetAwaiter().GetResult(); } -#endif #if FUNCTIONS_V3_OR_GREATER private void StartLocalGrpcServer() diff --git a/src/WebJobs.Extensions.DurableTask/HostLifecycleService.cs b/src/WebJobs.Extensions.DurableTask/HostLifecycleService.cs index a3b98b24d..83505a82e 100644 --- a/src/WebJobs.Extensions.DurableTask/HostLifecycleService.cs +++ b/src/WebJobs.Extensions.DurableTask/HostLifecycleService.cs @@ -3,9 +3,7 @@ using System; using System.Threading; -#if !FUNCTIONS_V1 using Microsoft.Extensions.Hosting; -#endif namespace Microsoft.Azure.WebJobs.Extensions.DurableTask { diff --git a/src/WebJobs.Extensions.DurableTask/HttpApiHandler.cs b/src/WebJobs.Extensions.DurableTask/HttpApiHandler.cs index 538f473ee..8f290f4aa 100644 --- a/src/WebJobs.Extensions.DurableTask/HttpApiHandler.cs +++ b/src/WebJobs.Extensions.DurableTask/HttpApiHandler.cs @@ -1257,7 +1257,6 @@ internal bool TryGetRpcBaseUrl(out Uri rpcBaseUrl) return false; } -#if !FUNCTIONS_V1 internal async Task StartLocalHttpServerAsync() { if (!this.localHttpListener.IsListening) @@ -1287,6 +1286,5 @@ internal async Task StopLocalHttpServerAsync() await this.localHttpListener.StopAsync(); } } -#endif } } diff --git a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskListener.cs b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskListener.cs index 77ae6dff3..60d6c5cd4 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskListener.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskListener.cs @@ -49,7 +49,6 @@ public DurableTaskListener( this.functionType = functionType; this.connectionName = connectionName; -#if !FUNCTIONS_V1 this.scaleMonitor = new Lazy(() => ScaleUtils.GetScaleMonitor( this.config.DefaultDurabilityProvider, @@ -58,7 +57,6 @@ public DurableTaskListener( this.connectionName, this.config.Options.HubName)); -#endif #if FUNCTIONS_V3_OR_GREATER this.targetScaler = new Lazy(() => ScaleUtils.GetTargetScaler( @@ -105,12 +103,10 @@ public void Dispose() { } -#if !FUNCTIONS_V1 public IScaleMonitor GetMonitor() { return this.scaleMonitor.Value; } -#endif #if FUNCTIONS_V3_OR_GREATER public ITargetScaler GetTargetScaler() diff --git a/test/Common/TestHelpers.cs b/test/Common/TestHelpers.cs index ac9d7feaa..af871fd55 100644 --- a/test/Common/TestHelpers.cs +++ b/test/Common/TestHelpers.cs @@ -15,10 +15,8 @@ using Azure.Storage.Blobs.Specialized; using DurableTask.AzureStorage; using Microsoft.ApplicationInsights.Channel; -#if !FUNCTIONS_V1 using Microsoft.Extensions.Hosting; using Microsoft.Azure.WebJobs.Host.Scale; -#endif using Microsoft.Azure.WebJobs.Extensions.DurableTask.Storage; using Microsoft.Azure.WebJobs.Host.TestCommon; using Microsoft.Extensions.Logging; @@ -70,18 +68,14 @@ public static ITestHost GetJobHost( int entityMessageReorderWindowInMinutes = 30, string exactTaskHubName = null, bool addDurableClientFactory = false, -#if !FUNCTIONS_V1 Action configureScaleOptions = null, -#endif Type[] types = null) { switch (storageProviderType) { case AzureStorageProviderType: -#if !FUNCTIONS_V1 case RedisProviderType: case EmulatorProviderType: -#endif break; default: throw new InvalidOperationException($"Storage provider {storageProviderType} is not supported for testing infrastructure."); @@ -163,11 +157,9 @@ public static ITestHost GetJobHost( lifeCycleNotificationHelper: lifeCycleNotificationHelper, serializerSettings: serializerSettings, onSend: onSend, -#if !FUNCTIONS_V1 addDurableClientFactory: addDurableClientFactory, types: types, configureScaleOptions: configureScaleOptions, -#endif durabilityProviderFactoryType: durabilityProviderFactoryType); } @@ -182,9 +174,7 @@ public static ITestHost GetJobHostWithOptions( Action onSend = null, Type durabilityProviderFactoryType = null, bool addDurableClientFactory = false, -#if !FUNCTIONS_V1 Action configureScaleOptions = null, -#endif Type[] types = null) { if (serializerSettings == null) @@ -204,12 +194,10 @@ public static ITestHost GetJobHostWithOptions( return PlatformSpecificHelpers.CreateJobHost( options: optionsWrapper, storageProvider: storageProviderType, -#if !FUNCTIONS_V1 durabilityProviderFactoryType: durabilityProviderFactoryType, addDurableClientFactory: addDurableClientFactory, typeLocator: typeLocator, configureScaleOptions: configureScaleOptions, -#endif loggerProvider: loggerProvider, nameResolver: testNameResolver, durableHttpMessageHandler: durableHttpMessageHandler, @@ -218,7 +206,6 @@ public static ITestHost GetJobHostWithOptions( onSend: onSend); } -#if !FUNCTIONS_V1 public static IHost GetJobHostExternalEnvironment(IStorageServiceClientProviderFactory clientProviderFactory = null) { if (clientProviderFactory == null) @@ -258,7 +245,6 @@ public static ITestHost GetJobHostWithOptionsWithMultipleDurabilityProviders( optionsWrapper, durabilityProviderFactories); } -#endif #pragma warning disable CS0612 // Type or member is obsolete public static IPlatformInformation GetMockPlatformInformationService( @@ -285,10 +271,8 @@ public static DurableTaskOptions GetDurableTaskOptionsForStorageProvider(string switch (storageProvider) { case AzureStorageProviderType: -#if !FUNCTIONS_V1 case RedisProviderType: case EmulatorProviderType: -#endif return new DurableTaskOptions(); default: throw new InvalidOperationException($"Storage provider {storageProvider} is not supported for testing infrastructure."); @@ -401,9 +385,7 @@ public static ITypeLocator GetTypeLocator() typeof(TestEntityClasses), typeof(ClientFunctions), typeof(UnconstructibleClass), -#if !FUNCTIONS_V1 typeof(TestEntityWithDependencyInjectionHelpers), -#endif }; ITypeLocator typeLocator = new ExplicitTypeLocator(types); From a10f392d5846fff68fb0e710294e5a7fe0784ea4 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Tue, 25 Jun 2024 21:43:47 -0700 Subject: [PATCH 05/19] further update --- ....WebJobs.Extensions.DurableTask-net462.xml | 4678 ---------------- ....Extensions.DurableTask-netstandard2.0.xml | 4896 ----------------- .../WebJobs.Extensions.DurableTask.csproj | 27 +- test/Common/TestEntityClasses.cs | 2 - test/DFPerfScenarios/DFPerfScenariosV4.csproj | 2 +- .../durableJS/extensions.csproj | 4 +- .../durableJava/extensions.csproj | 4 +- .../durablePy/extensions.csproj | 4 +- test/SmokeTests/SmokeTestsV2/Dockerfile | 20 - test/SmokeTests/SmokeTestsV2/HelloSequence.cs | 40 - test/SmokeTests/SmokeTestsV2/HttpStart.cs | 30 - .../SmokeTests/SmokeTestsV2/VSSampleV2.csproj | 22 - test/SmokeTests/SmokeTestsV2/host.json | 19 - .../SmokeTestsV2/local.settings.json | 7 - test/SmokeTests/SmokeTestsV3/Dockerfile | 16 - test/SmokeTests/SmokeTestsV3/HelloSequence.cs | 40 - test/SmokeTests/SmokeTestsV3/HttpStart.cs | 30 - .../SmokeTests/SmokeTestsV3/VSSampleV3.csproj | 22 - test/SmokeTests/SmokeTestsV3/host.json | 19 - .../SmokeTestsV3/local.settings.json | 7 - test/TimeoutTests/CSharp/TimeoutTests.csproj | 2 +- test/TimeoutTests/Python/extensions.csproj | 1 + 22 files changed, 25 insertions(+), 9867 deletions(-) delete mode 100644 src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net462.xml delete mode 100644 src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-netstandard2.0.xml delete mode 100644 test/SmokeTests/SmokeTestsV2/Dockerfile delete mode 100644 test/SmokeTests/SmokeTestsV2/HelloSequence.cs delete mode 100644 test/SmokeTests/SmokeTestsV2/HttpStart.cs delete mode 100644 test/SmokeTests/SmokeTestsV2/VSSampleV2.csproj delete mode 100644 test/SmokeTests/SmokeTestsV2/host.json delete mode 100644 test/SmokeTests/SmokeTestsV2/local.settings.json delete mode 100644 test/SmokeTests/SmokeTestsV3/Dockerfile delete mode 100644 test/SmokeTests/SmokeTestsV3/HelloSequence.cs delete mode 100644 test/SmokeTests/SmokeTestsV3/HttpStart.cs delete mode 100644 test/SmokeTests/SmokeTestsV3/VSSampleV3.csproj delete mode 100644 test/SmokeTests/SmokeTestsV3/host.json delete mode 100644 test/SmokeTests/SmokeTestsV3/local.settings.json diff --git a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net462.xml b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net462.xml deleted file mode 100644 index 713d2c834..000000000 --- a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-net462.xml +++ /dev/null @@ -1,4678 +0,0 @@ - - - - Microsoft.Azure.WebJobs.Extensions.DurableTask - - - - - - - - The Azure Storage implementation of additional methods not required by IOrchestrationService. - - - - - The app setting containing the Azure Storage connection string. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The URL used by the client binding object to use when calling back into - the extension. For the original out-of-proc implementation, this is a simple - HTTP endpoint. For out-of-proc "v2" (middelware passthrough), this is a gRPC endpoint. - - - - - The result of a clean entity storage operation. - - - - - The number of orphaned locks that were removed. - - - - - The number of entities whose metadata was removed from storage. - - - - - The default parameter type for activity functions. - - - - - - - - - - - Returns the input of the task activity in its raw JSON string value. - - - The raw JSON-formatted activity input as a string value. - - - - - Gets the input of the current activity function instance as a JToken. - - - The parsed JToken representation of the activity input. - - - - - - - - Sets the JSON-serializeable output of the activity function. - - - If this method is not called explicitly, the return value of the activity function is used as the output. - - - The JSON-serializeable value to use as the activity function output. - - - - - Client for starting, querying, terminating, and raising events to orchestration instances. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Factory class to create Durable Client to start works outside an azure function context. - - - - - Initializes a new instance of the class. - - Default Options to Build Durable Clients. - The factory used to create orchestration service based on the configured storage provider. - The logger factory used for extension-specific logging and orchestration tracking. - The configuration options for this extension. - The factory used to create for message settings. - - - - Gets a using configuration from a instance. - - options containing the client configuration parameters. - Returns a instance. The returned instance may be a cached instance. - - - - Gets a using configuration from a instance. - - Returns a instance. The returned instance may be a cached instance. - - - - - - - Factory class to create Durable Client to start works outside an azure function context. - - - - - Gets a using configuration from a instance. - - options containing the client configuration parameters. - Returns a instance. The returned instance may be a cached instance. - - - - Gets a using configuration from a instance. - - Returns a instance. The returned instance may be a cached instance. - - - - Common functionality used by both - and . - - - - - Context object passed to application code executing entity operations. - - - - - - - - - - - - - - Parameter data for orchestration bindings that can be used to schedule function-based activities. - - - - - - - - - - - - - - - - - - - - Returns the orchestrator function input as a raw JSON string value. - - - The raw JSON-formatted orchestrator function input. - - - - - Gets the input of the current orchestrator function instance as a JToken. - - - The parsed JToken representation of the orchestrator function input. - - - - - - - - Sets the JSON-serializeable output of the current orchestrator function. - - - If this method is not called explicitly, the return value of the orchestrator function is used as the output. - - The JSON-serializeable value to use as the orchestrator function output. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A non-generic tcs interface. - - - - - The type of the event stored in the completion source. - - - - - The next task completion source in the stack. - - - - - Tries to set the result on tcs. - - The result. - - - - Defines convenient overloads for calling the context methods, for all the contexts. - - - - - Returns an instance of ILogger that is replay safe, ensuring the logger logs only when the orchestrator - is not replaying that line of code. - - The context object. - An instance of ILogger. - An instance of a replay safe ILogger. - - - - Provides functionality available to durable activities. - - - - - Gets the name of the current activity function. - - - - - Gets the instance ID of the currently executing orchestration. - - - The instance ID is generated and fixed when the orchestrator function is scheduled. It can be either - auto-generated, in which case it is formatted as a GUID, or it can be user-specified with any format. - - - The ID of the current orchestration instance. - - - - - Gets the input of the current activity function as a deserialized value. - - Any data contract type that matches the JSON input. - The deserialized input value. - - - - Provides functionality available to durable orchestration and entity clients. - - - - - Gets the name of the task hub configured on this client instance. - - - The name of the task hub. - - - - - Provides functionality available to durable entity clients. - - - - - Gets the name of the task hub configured on this client instance. - - - The name of the task hub. - - - - - Signals an entity to perform an operation. - - The target entity. - The name of the operation. - The input for the operation. - The TaskHubName of the target entity. - The name of the connection string associated with . - A task that completes when the message has been reliably enqueued. - - - - Signals an entity to perform an operation, at a specified time. - - The target entity. - The time at which to start the operation. - The name of the operation. - The input for the operation. - The TaskHubName of the target entity. - The name of the connection string associated with . - A task that completes when the message has been reliably enqueued. - - - - Signals an entity to perform an operation. - - Entity interface. - The target entity key. - A delegate that performs the desired operation on the entity. - A task that completes when the message has been reliably enqueued. - - - - Signals an entity to perform an operation, at a specified time. - - Entity interface. - The target entity key. - The time at which to start the operation. - A delegate that performs the desired operation on the entity. - A task that completes when the message has been reliably enqueued. - - - - Signals an entity to perform an operation. - - Entity interface. - The target entity. - A delegate that performs the desired operation on the entity. - A task that completes when the message has been reliably enqueued. - - - - Signals an entity to perform an operation, at a specified time. - - Entity interface. - The target entity. - The time at which to start the operation. - A delegate that performs the desired operation on the entity. - A task that completes when the message has been reliably enqueued. - - - - Tries to read the current state of an entity. Returns default() if the entity does not exist. - - The JSON-serializable type of the entity. - The target entity. - The TaskHubName of the target entity. - The name of the connection string associated with . - a response containing the current state of the entity. - - - - Gets the status of all entity instances with paging that match the specified query conditions. - - Return entity instances that match the specified query conditions. - Cancellation token that can be used to cancel the query operation. - Returns a page of entity instances and a continuation token for fetching the next page. - - - - Removes empty entities from storage and releases orphaned locks. - - An entity is considered empty, and is removed, if it has no state, is not locked, and has - been idle for more than minutes. - Locks are considered orphaned, and are released, if the orchestration that holds them is not in state . This - should not happen under normal circumstances, but can occur if the orchestration instance holding the lock - exhibits replay nondeterminism failures, or if it is explicitly purged. - Whether to remove empty entities. - Whether to release orphaned locks. - Cancellation token that can be used to cancel the operation. - A task that completes when the operation is finished. - - - - Provides functionality for application code implementing an entity operation. - - - - - Gets the name of the currently executing entity. - - - - - Gets the key of the currently executing entity. - - - - - Gets the id of the currently executing entity. - - - - - Gets the name of the operation that was called. - - - An operation invocation on an entity includes an operation name, which states what - operation to perform, and optionally an operation input. - - - - - Whether this entity has a state. - - - - - The size of the current batch of operations. - - - - - The position of the currently executing operation within the current batch of operations. - - - - - Gets the current state of this entity, for reading and/or updating. - If this entity has no state yet, creates it. - - The JSON-serializable type of the entity state. - Provides an initial value to use for the state, instead of default(). - The current state of this entity. - If the current state has an incompatible type. - - - - Sets the current state of this entity. - - The JSON-serializable state of the entity. - - - - Deletes the state of this entity. - - - - - Gets the input for this operation, as a deserialized value. - - The JSON-serializable type used for the operation input. - The operation input, or default() if none. - - An operation invocation on an entity includes an operation name, which states what - operation to perform, and optionally an operation input. - - - - - Gets the input for this operation, as a deserialized value. - - The JSON-serializable type used for the operation input. - The operation input, or default() if none. - - An operation invocation on an entity includes an operation name, which states what - operation to perform, and optionally an operation input. - - - - - Returns the given result to the caller of this operation. - - the result to return. - - - - Signals an entity to perform an operation, without waiting for a response. Any result or exception is ignored (fire and forget). - - The target entity. - The name of the operation. - The operation input. - - - - Signals an entity to perform an operation, at a specified time. Any result or exception is ignored (fire and forget). - - The target entity. - The time at which to start the operation. - The name of the operation. - The input for the operation. - - - - Signals an entity to perform an operation. - - The target entity key. - A delegate that performs the desired operation on the entity. - Entity interface. - - - - Signals an entity to perform an operation, at a specified time. - - The target entity key. - The time at which to start the operation. - A delegate that performs the desired operation on the entity. - Entity interface. - - - - Signals an entity to perform an operation. - - The target entity. - A delegate that performs the desired operation on the entity. - Entity interface. - - - - Signals an entity to perform an operation, at a specified time. - - The target entity. - The time at which to start the operation. - A delegate that performs the desired operation on the entity. - Entity interface. - - - - Schedules an orchestration function named for execution./>. - Any result or exception is ignored (fire and forget). - - The name of the orchestrator function to call. - the input to pass to the orchestrator function. - optionally, an instance id for the orchestration. By default, a random GUID is used. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - The instance id of the new orchestration. - - - - Dynamically dispatches the incoming entity operation using reflection. - - The class to use for entity instances. - A task that completes when the dispatched operation has finished. - If there is more than one method with the given operation name. - If there is no method with the given operation name. - If the method has more than one argument. - - If the entity's state is null, an object of type is created first. Then, reflection - is used to try to find a matching method. This match is based on the method name - (which is the operation name) and the argument list (which is the operation content, deserialized into - an object array). - - Parameters to feed to the entity constructor. Should be primarily used for - output bindings. Parameters must match the order in the constructor after ignoring parameters populated on - constructor via dependency injection. - - - - Provides functionality available to durable orchestration clients. - - - - - Gets the name of the task hub configured on this client instance. - - - The name of the task hub. - - - - - Creates an HTTP response that is useful for checking the status of the specified instance. - - - The payload of the returned contains HTTP API URLs that can - be used to query the status of the orchestration, raise events to the orchestration, or - terminate the orchestration. - - The HTTP request that triggered the current orchestration instance. - The ID of the orchestration instance to check. - Optional parameter that configures the http response code returned. Defaults to false. - If true, the returned http response code will be a 500 when the orchestrator is in a failed state, when false it will - return 200. - An HTTP 202 response with a Location header and a payload containing instance control URLs. - - - - Creates an HTTP response that is useful for checking the status of the specified instance. - - - The payload of the returned contains HTTP API URLs that can - be used to query the status of the orchestration, raise events to the orchestration, or - terminate the orchestration. - - The HTTP request that triggered the current orchestration instance. - The ID of the orchestration instance to check. - Optional parameter that configures the http response code returned. Defaults to false. - If true, the returned http response code will be a 500 when the orchestrator is in a failed state, when false it will - return 200. - An HTTP 202 response with a Location header and a payload containing instance control URLs. - - - - Creates a object that contains status, terminate and send external event HTTP endpoints. - - The ID of the orchestration instance to check. - Instance of the class. - - - - Creates an HTTP response which either contains a payload of management URLs for a non-completed instance - or contains the payload containing the output of the completed orchestration. - - - If the orchestration instance completes within the specified timeout, then the HTTP response payload will - contain the output of the orchestration instance formatted as JSON. However, if the orchestration does not - complete within the specified timeout, then the HTTP response will be identical to that of the - API. - - The HTTP request that triggered the current function. - The unique ID of the instance to check. - Total allowed timeout for output from the durable function. The default value is 10 seconds. - The timeout between checks for output from the durable function. The default value is 1 second. - Optional parameter that configures the http response code returned. Defaults to false. - If true, the returned http response code will be a 500 when the orchestrator is in a failed state, when false it will - return 200. - An HTTP response which may include a 202 and location header or a 200 with the durable function output in the response body. - - - - Creates an HTTP response which either contains a payload of management URLs for a non-completed instance - or contains the payload containing the output of the completed orchestration. - - - If the orchestration instance completes within the specified timeout, then the HTTP response payload will - contain the output of the orchestration instance formatted as JSON. However, if the orchestration does not - complete within the specified timeout, then the HTTP response will be identical to that of the - API. - - The HTTP request that triggered the current function. - The unique ID of the instance to check. - Total allowed timeout for output from the durable function. The default value is 10 seconds. - The timeout between checks for output from the durable function. The default value is 1 second. - Optional parameter that configures the http response code returned. Defaults to false. - If true, the returned http response code will be a 500 when the orchestrator is in a failed state, when false it will - return 200. - An HTTP response which may include a 202 and location header or a 200 with the durable function output in the response body. - - - - Starts a new execution of the specified orchestrator function. - - The name of the orchestrator function to start. - The ID to use for the new orchestration instance. - A task that completes when the orchestration is started. The task contains the instance id of the started - orchestratation instance. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - - - Starts a new execution of the specified orchestrator function. - - The name of the orchestrator function to start. - JSON-serializeable input value for the orchestrator function. - The type of the input value for the orchestrator function. - A task that completes when the orchestration is started. The task contains the instance id of the started - orchestratation instance. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - - - Starts a new instance of the specified orchestrator function. - - - If an orchestration instance with the specified ID already exists, the existing instance - will be silently replaced by this new instance. - - The name of the orchestrator function to start. - The ID to use for the new orchestration instance. - JSON-serializable input value for the orchestrator function. - The type of the input value for the orchestrator function. - A task that completes when the orchestration is started. The task contains the instance id of the started - orchestratation instance. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - - - Sends an event notification message to a waiting orchestration instance. - - - - In order to handle the event, the target orchestration instance must be waiting for an - event named using the - API. - - - The instance id does not corespond to a valid orchestration instance. - The orchestration instance with the provided instance id is not running. - The ID of the orchestration instance that will handle the event. - The name of the event. - The JSON-serializeable data associated with the event. - A task that completes when the event notification message has been enqueued. - - - - Sends an event notification message to a waiting orchestration instance. - - - - In order to handle the event, the target orchestration instance must be waiting for an - event named using the - API. - - If the specified instance is not found or not running, this operation will throw an exception. - - - The instance id does not corespond to a valid orchestration instance. - The orchestration instance with the provided instance id is not running. - The TaskHubName of the orchestration that will handle the event. - The ID of the orchestration instance that will handle the event. - The name of the event. - The JSON-serializeable data associated with the event. - The name of the connection string associated with . - A task that completes when the event notification message has been enqueued. - - - - Terminates a running orchestration instance. - - - - A terminated instance will eventually transition into the state. - However, this transition will not happen immediately. Rather, the terminate operation will be queued in the task hub - along with other operations for that instance. You can use the - method to know when a terminated instance has actually reached the Terminated state. - - - Terminating an orchestration instance has no effect on any in-flight activity function executions - or sub-orchestrations that were started by the current orchestration instance. - - - The instance id does not corespond to a valid orchestration instance. - The orchestration instance with the provided instance id is not running. - The ID of the orchestration instance to terminate. - The reason for terminating the orchestration instance. - A task that completes when the terminate message is enqueued if necessary. - - - - Rewinds the specified failed orchestration instance with a reason. - - The ID of the orchestration instance to rewind. - The reason for rewinding the orchestration instance. - A task that completes when the rewind message is enqueued. - - - - Gets the status of the specified orchestration instance. - - The ID of the orchestration instance to query. - Boolean marker for including execution history in the response. - Boolean marker for including input and output in the execution history response. - If set, fetch and return the input for the orchestration instance. - Returns a task which completes when the status has been fetched. - - - - Gets the status of all orchestration instances that match the specified conditions. - - If specified, return orchestration instances which were created after this DateTime. - If specified, return orchestration instances which were created before this DateTime. - If specified, return orchestration instances which matches the runtimeStatus. - If specified, this ancellation token can be used to cancel the status query operation. - Returns orchestration status for all instances. - - - - Purge the history for a concrete instance. - - The ID of the orchestration instance to purge. - Returns an instance of . - - - - Purge the orchestration history for instances that match the conditions. - - Start creation time for querying instances for purging. - End creation time for querying instances for purging. - List of runtime status for querying instances for purging. Only Completed, Terminated, or Failed will be processed. - Returns an instance of . - - - - Gets the status of all orchestration instances with paging that match the specified conditions. - - Return orchestration instances that match the specified conditions. - Cancellation token that can be used to cancel the status query operation. - Returns each page of orchestration status for all instances and continuation token of next page. - - - - Gets the status of all orchestration instances with paging that match the specified conditions. - - Return orchestration instances that match the specified conditions. - Cancellation token that can be used to cancel the status query operation. - Returns each page of orchestration status for all instances and continuation token of next page. - - - - Restarts an existing orchestrator with the original input. - - InstanceId of a previously run orchestrator to restart. - Optional parameter that configures if restarting an orchestration will use a new instanceId or if it will - reuse the old instanceId. Defaults to true. - A task that completes when the orchestration is started. The task contains the instance id of the started - orchestratation instance. - - - - Makes the current app the primary app, if it isn't already. Must be using the AppLease feature by setting UseAppLease to true in host.json. - - A task that completes when the operation has started. - - - - Provides functionality available to orchestration code. - - - - - Gets the name of the current orchestration function. - - - - - Gets the instance ID of the currently executing orchestration. - - - The instance ID is generated and fixed when the orchestrator function is scheduled. It can be either - auto-generated, in which case it is formatted as a GUID, or it can be user-specified with any format. - - - The ID of the current orchestration instance. - - - - - Gets the parent instance ID of the currently executing sub-orchestration. - - - The parent instance ID is generated and fixed when the parent orchestrator function is scheduled. It can be either - auto-generated, in which case it is formatted as a GUID, or it can be user-specified with any format. - - - The ID of the parent orchestration of the current sub-orchestration instance. The value will be available only in sub-orchestrations. - - - - - Gets the current date/time in a way that is safe for use in orchestrations and entity operations. - - - This date/time value is derived from the orchestration or entity history. It always returns the same value - at specific points in the orchestrator function code, making it deterministic and safe for replay. - - The orchestration or entity's current date/time in UTC. - - - - Gets a value indicating whether the orchestration or operation is currently replaying itself. - - - This property is useful when there is logic that needs to run only when *not* replaying. For example, certain types of application logging may become too noisy when duplicated - as part of replay. The application code could check to see whether the function is - being replayed and then issue the log statements when this value is false. - - - true if the orchestration or operation is currently being replayed; otherwise false. - - - - - Gets the input of the current orchestrator function as a deserialized value. - - Any data contract type that matches the JSON input. - The deserialized input value. - - - - Sets the output for the current orchestration. - - The JSON-serializeable output of the orchestration. - - - - Restarts the orchestration by clearing its history. - - - Large orchestration histories can consume a lot of memory and cause delays in - instance load times. This method can be used to periodically truncate the stored - history of an orchestration instance. - Note that any unprocessed external events will be discarded when an orchestration - instance restarts itself using this method. - - The JSON-serializeable data to re-initialize the instance with. - - If set to true, re-adds any unprocessed external events into the new execution - history when the orchestration instance restarts. If false, any unprocessed - external events will be discarded when the orchestration instance restarts. - - - - - Sets the JSON-serializeable status of the current orchestrator function. - - - The value is serialized to JSON and will - be made available to the orchestration status query APIs. The serialized JSON - value must not exceed 16 KB of UTF-16 encoded text. - - The JSON-serializeable value to use as the orchestrator function's custom status. - - - - Makes an HTTP call to the specified uri. - - HttpMethod used for api call. - uri used to make the HTTP call. - Content passed in the HTTP request. - The retry option for the HTTP task. - A Result of the HTTP call. - - - - Makes an HTTP call using the information in the DurableHttpRequest. - - The DurableHttpRequest used to make the HTTP call. - A Result of the HTTP call. - - - - Calls an operation on an entity and returns the result asynchronously. - - The JSON-serializable result type of the operation. - The target entity. - The name of the operation. - A task representing the result of the operation. - - - - Calls an operation on an entity and waits for it to complete. - - The target entity. - The name of the operation. - A task representing the completion of the operation on the entity. - - - - Calls an operation on an entity, passing an argument, and returns the result asynchronously. - - The JSON-serializable result type of the operation. - The target entity. - The name of the operation. - The input for the operation. - A task representing the result of the operation. - if the context already holds some locks, but not the one for . - - - - Calls an operation on an entity, passing an argument, and waits for it to complete. - - The target entity. - The name of the operation. - The input for the operation. - A task representing the completion of the operation on the entity. - if the context already holds some locks, but not the one for . - - - - Schedules an orchestrator function named for execution. - - The return type of the scheduled orchestrator function. - The name of the orchestrator function to call. - The JSON-serializeable input to pass to the orchestrator function. - A durable task that completes when the called orchestrator function completes or fails. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The sub-orchestrator function failed with an unhandled exception. - - - - - Schedules an orchestration function named for execution. - - The return type of the scheduled orchestrator function. - The name of the orchestrator function to call. - A unique ID to use for the sub-orchestration instance. - The JSON-serializeable input to pass to the orchestrator function. - A durable task that completes when the called orchestrator function completes or fails. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Schedules an orchestrator function named for execution. - - The name of the orchestrator function to call. - The JSON-serializeable input to pass to the orchestrator function. - A durable task that completes when the called orchestrator function completes or fails. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The sub-orchestrator function failed with an unhandled exception. - - - - - Schedules an orchestrator function named for execution. - - The name of the orchestrator function to call. - A unique ID to use for the sub-orchestration instance. - The JSON-serializeable input to pass to the orchestrator function. - A durable task that completes when the called orchestrator function completes or fails. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Schedules an orchestrator function named for execution with retry options. - - The return type of the scheduled orchestrator function. - The name of the orchestrator function to call. - The retry option for the orchestrator function. - A unique ID to use for the sub-orchestration instance. - The JSON-serializeable input to pass to the orchestrator function. - A durable task that completes when the called orchestrator function completes or fails. - - The retry option object is null. - - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Schedules an orchestrator function named for execution with retry options. - - The name of the orchestrator function to call. - The retry option for the orchestrator function. - The JSON-serializeable input to pass to the orchestrator function. - A durable task that completes when the called orchestrator function completes or fails. - - The retry option object is null. - - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Schedules an orchestrator function named for execution with retry options. - - The name of the orchestrator function to call. - The retry option for the orchestrator function. - A unique ID to use for the sub-orchestration instance. - The JSON-serializeable input to pass to the orchestrator function. - A durable task that completes when the called orchestrator function completes or fails. - - The retry option object is null. - - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Schedules an orchestrator function named for execution with retry options. - - The return type of the scheduled orchestrator function. - The name of the orchestrator function to call. - The retry option for the orchestrator function. - The JSON-serializeable input to pass to the orchestrator function. - A durable task that completes when the called orchestrator function completes or fails. - - The retry option object is null. - - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Creates a durable timer that expires at a specified time. - - - All durable timers created using this method must either expire or be cancelled - using the before the orchestrator function completes. - Otherwise the underlying framework will keep the instance in the "Running" state - even after the orchestrator function has completed. - - The type of . - The time at which the timer should expire. - Any state to be preserved by the timer. - The CancellationToken to use for cancelling the timer. - A durable task that completes when the durable timer expires. - - - - Creates a durable timer that expires at a specified time. - - - All durable timers created using this method must either expire or be cancelled - using the before the orchestrator function completes. - Otherwise the underlying framework will keep the instance in the "Running" state - even after the orchestrator function has completed. - - The time at which the timer should expire. - The CancellationToken to use for cancelling the timer. - A durable task that completes when the durable timer expires. - - - - Waits asynchronously for an event to be raised with name and returns the event data. - - - External clients can raise events to a waiting orchestration instance using - . - - The name of the event to wait for. - Any serializeable type that represents the JSON event payload. - A durable task that completes when the external event is received. - - - - Waits asynchronously for an event to be raised with name . - - - External clients can raise events to a waiting orchestration instance using - with the object parameter set to null. - - The name of the event to wait for. - A durable task that completes when the external event is received. - - - - Waits asynchronously for an event to be raised with name . - - - External clients can raise events to a waiting orchestration instance using - with the object parameter set to null. - - The name of the event to wait for. - The duration after which to throw a TimeoutException. - The CancellationToken to use for cancelling 's internal timer. - A durable task that completes when the external event is received. - - The external event was not received before the timeout expired. - - - - - Waits asynchronously for an event to be raised with name and returns the event data. - - - External clients can raise events to a waiting orchestration instance using - . - - The name of the event to wait for. - The duration of time to wait for the event. - The CancellationToken to use for cancelling 's internal timer. - Any serializeable type that represents the JSON event payload. - A durable task that completes when the external event is received, or throws a timeout exception"/> - if the timeout expires. - - - - Waits asynchronously for an event to be raised with name and returns the event data. - - - External clients can raise events to a waiting orchestration instance using - . - - The name of the event to wait for. - The duration of time to wait for the event. - If specified, the default value to return if the timeout expires before the external event is received. - Otherwise, a timeout exception will be thrown instead. - The CancellationToken to use for cancelling 's internal timer. - Any serializeable type that represents the JSON event payload. - A durable task that completes when the external event is received, or returns the value of - if the timeout expires. - - - - Acquires one or more locks, for the specified entities. - - - Locks can only be acquired if the current context does not hold any locks already. - - The entities whose locks should be acquired. - An IDisposable that releases the lock when disposed. - if the context already holds some locks. - - - - Determines whether the current context is locked, and if so, what locks are currently owned. - - The collection of owned locks. - - Note that the collection of owned locks can be empty even if the context is locked. This happens - if an orchestration calls a suborchestration without lending any locks. - - true if the context already holds some locks. - - - - Creates a new GUID that is safe for replay within an orchestration or operation. - - - The default implementation of this method creates a name-based UUID using the algorithm from - RFC 4122 §4.3. The name input used to generate this value is a combination of the orchestration - instance ID and an internally managed sequence number. - - The new value. - - - - Schedules an activity function named for execution. - - The return type of the scheduled activity function. - The name of the activity function to call. - The JSON-serializeable input to pass to the activity function. - A durable task that completes when the called activity function completes or fails. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Schedules an activity function named for execution. - - The name of the activity function to call. - The JSON-serializeable input to pass to the activity function. - A durable task that completes when the called function completes or fails. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Schedules an activity function named for execution with retry options. - - The return type of the scheduled activity function. - The name of the activity function to call. - The retry option for the activity function. - The JSON-serializeable input to pass to the activity function. - A durable task that completes when the called activity function completes or fails. - - The retry option object is null. - - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Schedules an activity function named for execution with retry options. - - The name of the activity function to call. - The retry option for the activity function. - The JSON-serializeable input to pass to the activity function. - A durable task that completes when the called activity function completes or fails. - - The retry option object is null. - - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Signals an entity to perform an operation, without waiting for a response. Any result or exception is ignored (fire and forget). - - The target entity. - The name of the operation. - The input for the operation. - - - - Signals an operation to be performed by an entity at a specified time. Any result or exception is ignored (fire and forget). - - The target entity. - The time at which to start the operation. - The name of the operation. - The input for the operation. - - - - Schedules a orchestration function named for execution./>. - Any result or exception is ignored (fire and forget). - - The name of the orchestrator function to call. - the input to pass to the orchestrator function. - optionally, an instance id for the orchestration. By default, a random GUID is used. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - The instance id of the new orchestration. - - - - Create an entity proxy. - - The target entity key. - Entity interface. - Entity proxy. - - - - Create an entity proxy. - - The target entity. - Entity interface. - Entity proxy. - - - - Formerly, the abstract base class for DurableOrchestrationContext. - Now obsolete: use instead. - - - - - Formerly, the abstract base class for DurableActivityContext. - Now obsolete: use instead. - - - - - Formerly, the abstract base class for DurableOrchestrationClient. - Now obsolete: use instead. - - - - - Provides information about the enviroment (OS, app service plan, user-facing PL) - using the DI-injected INameResolver. - - - - - Attribute used with the Durable Functions Analyzer to label a method as Deterministic. This allows the method to be called in an Orchestration function without causing a compiler warning. - - - - - The backend storage provider that provides the actual durability of Durable Functions. - This is functionally a superset of and . - If the storage provider does not any of the Durable Functions specific operations, they can use this class - directly with the expectation that only those interfaces will be implemented. All of the Durable Functions specific - methods/operations are virtual and can be overwritten by creating a subclass. - - - - - Creates the default . - - The name of the storage backend providing the durability. - The internal that provides functionality - for this classes implementions of . - The internal that provides functionality - for this classes implementions of . - The name of the app setting that stores connection details for the storage provider. - - - - The name of the environment variable that contains connection details for how to connect to storage providers. - Corresponds to the for binding data. - - - - - Specifies whether the durability provider supports Durable Entities. - - - - - Specifies whether the backend's WaitForOrchestration is implemented without polling. - - - - - Specifies whether this backend delivers messages in order. - - - - - JSON representation of configuration to emit in telemetry. - - - - - Value of maximum durable timer delay. Used for long running durable timers. - - - - - Interval time used for long running timers. - - - - - Event source name (e.g. DurableTask-AzureStorage). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gets the status of all orchestration instances. - - A token to cancel the request. - Returns a task which completes when the status has been fetched. - - - - Gets the status of all orchestration instances within the specified parameters. - - Return orchestration instances which were created after this DateTime. - Return orchestration instances which were created before this DateTime. - Return orchestration instances which matches the runtimeStatus. - A token to cancel the request. - Returns a task which completes when the status has been fetched. - - - - Gets the state of the specified orchestration instance. - - The ID of the orchestration instance to query. - If set, fetch and return the input for the orchestration instance. - Returns a task which completes when the state has been fetched. - - - - Gets paginated result of all orchestration instances that match query status parameters. - - The filtering conditions of the query. - A token to cancel the request. - Paginated result of orchestration state. - - - - Purges history that meet the required parameters. - - Purge the history of orchestration instances which were created after this DateTime. - Purge the history of orchestration instances which were created before this DateTime. - Purge the history of orchestration instances which matches the runtimeStatus. - The number of instances purged. - - - - Purges the instance history for the provided instance id. - - The instance id for the instance history to purge. - The number of instances purged. - - - - Retrieves the state for a serialized entity. - - Entity id to fetch state for. - JsonSerializerSettings for custom deserialization. - State for the entity. - - - - Rewinds the specified failed orchestration instance with a reason. - - The ID of the orchestration instance to rewind. - The reason for rewinding the orchestration instance. - A task that completes when the rewind message is enqueued. - - - - Makes the current app the primary app, if it isn't already. Must be using the AppLease feature. - - A task that completes when the operation has started. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Uses durability provider specific logic to verify whether a timespan for a timer, timeout - or retry interval is allowed by the provider. - - The timespan that the code will have to wait for. - The error message if the timespan is invalid. - A boolean indicating whether the time interval is valid. - - - - Returns true if the stored connection string, ConnectionName, matches the input DurabilityProvider ConnectionName. - - The DurabilityProvider used to check for matching connection string names. - A boolean indicating whether the connection names match. - - - - Attribute used to bind a function parameter to a , , or instance. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - Options to configure the IDurableClient created. - - - - Optional. Gets or sets the name of the task hub in which the orchestration data lives. - - The task hub used by this binding. - - The default behavior is to use the task hub name specified in . - If no value exists there, then a default value will be used. - - - - - Optional. Gets or sets the setting name for the app setting containing connection details used by this binding to connect - to instances of the storage provider other than the default one this application communicates with. - - The name of an app setting containing connection details. - - For Azure Storage the default behavior is to use the value of . - If no value exists there, then the default behavior is to use the standard `AzureWebJobsStorage` connection string for all storage usage. - - - - - Indicate if the client is External from the azure function where orchestrator functions are hosted. - - - - - Returns a hash code for this attribute. - - A hash code for this attribute. - - - - Compares two instances for value equality. - - The object to compare with. - true if the two attributes have the same configuration; otherwise false. - - - - Compares two instances for value equality. - - The object to compare with. - true if the two attributes have the same configuration; otherwise false. - - - - Represents the status of a durable entity instance. - - - - - Gets the EntityId of the queried entity instance. - - - The unique EntityId of the instance. - - - - - Gets the time of the last operation processed by the entity instance. - - - The last operation time in UTC. - - - - - Gets the state of the entity instance. - - - The state as either a JToken or null if no state was provided. - - - - - Request used to make an HTTP call through Durable Functions. - - - - - Initializes a new instance of the class. - - Method used for HTTP request. - Uri used to make the HTTP request. - Headers added to the HTTP request. - Content added to the body of the HTTP request. - AAD authentication attached to the HTTP request. - Specifies whether the DurableHttpRequest should handle the asynchronous pattern. - TimeSpan used for HTTP request timeout. - Retry options used for the HTTP request. - - - - HttpMethod used in the HTTP request made by the Durable Function. - - - - - Uri used in the HTTP request made by the Durable Function. - - - - - Headers passed with the HTTP request made by the Durable Function. - - - - - Content passed with the HTTP request made by the Durable Function. - - - - - Mechanism for attaching an OAuth token to the request. - - - - - Specifies whether the Durable HTTP APIs should automatically - handle the asynchronous HTTP pattern. - - - - - Defines retry policy for handling of failures in making the HTTP Request. These could be non-successful HTTP status codes - in the response, a timeout in making the HTTP call, or an exception raised from the HTTP Client library. - - - - - The total timeout for the original HTTP request and any - asynchronous polling. - - - - - Response received from the HTTP request made by the Durable Function. - - - - - Initializes a new instance of the class. - - HTTP Status code returned from the HTTP call. - Headers returned from the HTTP call. - Content returned from the HTTP call. - - - - Status code returned from an HTTP request. - - - - - Headers in the response from an HTTP request. - - - - - Content returned from an HTTP request. - - - - - Creates a DurableHttpResponse from an HttpResponseMessage. - - HttpResponseMessage returned from the HTTP call. - A representing the result of the asynchronous operation. - - - - Represents the status of a durable orchestration instance. - - - An external client can fetch the status of an orchestration instance using - . - - - - - Gets the name of the queried orchestrator function. - - - The orchestrator function name. - - - - - Gets the ID of the queried orchestration instance. - - - The instance ID is generated and fixed when the orchestrator function is scheduled. It can be either - auto-generated, in which case it is formatted as a GUID, or it can be user-specified with any format. - - - The unique ID of the instance. - - - - - Gets the time at which the orchestration instance was created. - - - If the orchestration instance is in the - status, this time represents the time at which the orchestration instance was scheduled. - - - The instance creation time in UTC. - - - - - Gets the time at which the orchestration instance last updated its execution history. - - - The last-updated time in UTC. - - - - - Gets the input of the orchestrator function instance. - - - The input as either a JToken or null if no input was provided. - - - - - Gets the output of the queried orchestration instance. - - - The output as either a JToken object or null if it has not yet completed. - - - - - Gets the runtime status of the queried orchestration instance. - - - Expected values include `Running`, `Pending`, `Failed`, `Canceled`, `Terminated`, `Completed`. - - - - - Gets the custom status payload (if any) that was set by the orchestrator function. - - - Orchestrator functions can set a custom status using . - - - The custom status as either a JToken object or null if no custom status has been set. - - - - - Gets the execution history of the orchestration instance. - - - The history log can be large and is therefore null by default. - It is populated only when explicitly requested in the call to - . - - - The output as a JArray object or null. - - - - - Configuration for the Durable Functions extension. - - - - - Obsolete. Please use an alternate constructor overload. - - - - - Initializes a new instance of the . - - The configuration options for this extension. - The logger factory used for extension-specific logging and orchestration tracking. - The name resolver to use for looking up application settings. - The factories used to create orchestration service based on the configured storage provider. - The HTTP message handler that handles HTTP requests and HTTP responses. - The host shutdown notification service for detecting and reacting to host shutdowns. - The lifecycle notification helper used for custom orchestration tracking. - The factory used to create for message settings. - The factory used to create for error settings. - Provides webhook urls for HTTP management APIs. - The activator of DistributedTracing. .netstandard2.0 only. - The platform information provider to inspect the OS, app service plan, and other enviroment information. - - - - Gets or sets default task hub name to be used by all , , , - , and instances. - - - A task hub is a logical grouping of storage resources. Alternate task hub names can be used to isolate - multiple Durable Functions applications from each other, even if they are using the same storage backend. - - The name of the default task hub. - - - - Internal initialization call from the WebJobs host. - - Extension context provided by WebJobs. - - - - Initializes the logging service for App Service if it detects that we are running in - the linux platform. - - - - - - - - Deletes all data stored in the current task hub. - - A task representing the async delete operation. - - - - Called by the Durable Task Framework: Not used. - - This parameter is not used. - - - - Called by the Durable Task Framework: Returns the specified . - - The name of the orchestration to return. - Not used. - An orchestration shim that delegates execution to an orchestrator function. - - - - Called by the durable task framework: Not used. - - This parameter is not used. - - - - Called by the Durable Task Framework: Returns the specified . - - The name of the activity to return. - Not used. - An activity shim that delegates execution to an activity function. - - - - This DTFx activity middleware allows us to add context to the activity function shim - before it actually starts running. - - A property bag containing useful DTFx context. - The handler for running the next middleware in the pipeline. - - - - This DTFx orchestration middleware allows us to initialize Durable Functions-specific context - and make the execution happen in a way that plays nice with the Azure Functions execution pipeline. - - A property bag containing useful DTFx context. - The handler for running the next middleware in the pipeline. - - - - This DTFx orchestration middleware (for entities) allows us to add context and set state - to the entity shim orchestration before it starts executing the actual entity logic. - - A property bag containing useful DTFx context. - The handler for running the next middleware in the pipeline. - - - - Gets a using configuration from a instance. - - The attribute containing the client configuration parameters. - Returns a instance. The returned instance may be a cached instance. - - - - - - - Extension for registering a Durable Functions configuration with JobHostConfiguration. - - - - - Adds the Durable Task extension to the provided . - - The to configure. - Returns the provided . - - - - Adds the Durable Task extension to the provided . - - The to configure. - Populate default configurations of to create Durable Clients. - Returns the provided . - - - - Enable running durable orchestrations implemented as functions. - - Configuration settings of the current JobHost instance. - Durable Functions configuration. - - - - Query condition for searching the status of entity instances. - - - - - Return entity instances associated with this entity name. - - - - - Return entity instances which had operations after this DateTime. - - - - - Return entity instances which had operations before this DateTime. - - - - - Number of records per one request. The default value is 100. - - - - - ContinuationToken of the pager. - - - - - Determines whether the query will include the state of the entity. - - - - - Determines whether the results should include recently deleted entities. - - - - - The status of all entity instances with paging for a given query. - - - - - Gets or sets a collection of statuses of entity instances matching the query description. - - A collection of entity instance status values. - - - - Gets or sets a token that can be used to resume the query with data not already returned by this query. - - A server-generated continuation token or null if there are no further continuations. - - - - Statically accessible context for entity operations. - - - - - The context of the currently executing entity. - - - - - Sets the current context to a mocked context for unit testing. - - The mocked context. - - - - Information about the current status of an operation executing on an entity. - Excludes potentially large data (such as the operation input) so it can be read with low latency. - - - - - The name of the operation. - - - - - The unique identifier for this operation. - - - - - The parent instance that called this operation. - - - - - The UTC time at which the entity started processing this operation. - - - - - A unique identifier for an entity, consisting of entity name and entity key. - - - - - Create an entity id for an entity. - - The name of this class of entities. - The entity key. - - - - The name for this class of entities. - - - - - The entity key. Uniquely identifies an entity among all entities of the same name. - - - - - - - - - - - - - - - - - - - - Determines event names to use for messages sent to and from entities. - - - - - Exception used to describe various issues encountered by the entity scheduler. - - - - - Initializes a new instance of the class. - - - - - Initializes an new instance of the class. - - The message that describes the error. - The exception that was caught. - - - - Initializes a new instance of the class with serialized data. - - The System.Runtime.Serialization.SerializationInfo that holds the serialized object data about the exception being thrown. - The System.Runtime.Serialization.StreamingContext that contains contextual information about the source or destination. - - - - The response returned by . - - The JSON-serializable type of the entity. - - - - Whether this entity exists or not. - - - - - The current state of the entity, if it exists, or default() otherwise. - - - - - Information about the current status of an entity. Excludes potentially large data - (such as the entity state, or the contents of the queue) so it can always be read with low latency. - - - - - Whether this entity exists or not. - - - - - The size of the queue, i.e. the number of operations that are waiting for the current operation to complete. - - - - - The instance id of the orchestration that currently holds the lock of this entity. - - - - - The operation that is currently executing on this entity. - - - - - The exception that is thrown when application code violates the locking rules. - - - - - provides message ordering and deduplication of request messages (operations or lock requests) - that are sent to entities, from other entities, or from orchestrations. - - - - - Used for testing purposes. - - - - - Called on the sending side, to fill in timestamp and predecessor fields. - - - - - Called on the receiving side, to reorder and deduplicate within the window. - - - - - Exception result representing an operation that failed, in case - the original exception is not serializable, or out-of-proc. - - - - - Initializes a new instance of the class. - - - - - Initializes an new instance of the class. - - The message that describes the error. - - - - Initializes a new instance of the class with serialized data. - - The System.Runtime.Serialization.SerializationInfo that holds the serialized object data about the exception being thrown. - The System.Runtime.Serialization.StreamingContext that contains contextual information about the source or destination. - - - - Provides the base implementation for the entity proxy. - - - - - Create an entity proxy. - - context. - Entity id. - - - - Call entity function. - - The name of the operation. - The input for the operation. - A representing the result of the asynchronous operation. - - - - Call entity function. - - The return type of the called entity function. - The name of the operation. - The input for the operation. - A representing the result of the asynchronous operation. - - - - Signal entity function. - - The name of the operation. - The input for the operation. - - - - Abstract entity proxy context. - - - - - Call entity function. - - Entity id. - Entity operation name. - Entity input value. - A representing the result of the asynchronous operation. - - - - Call entity function. - - Result type. - Entity id. - Entity operation name. - Entity input value. - A representing the result of the asynchronous operation. - - - - Signal entity function. - - Entity id. - Entity operation name. - Entity input value. - - - - A message sent to an entity, such as operation, signal, lock, release, or continue messages. - - - - - The name of the operation being called (if this is an operation message) or null - (if this is a lock request). - - - - - Whether or not this is a one-way message. - - - - - The operation input. - - - - - A unique identifier for this operation. - - - - - The parent instance that called this operation. - - - - - The parent instance that called this operation. - - - - - Optionally, a scheduled time at which to start the operation. - - - - - A timestamp for this request. - Used for duplicate filtering and in-order delivery. - - - - - A timestamp for the predecessor request in the stream, or DateTime.MinValue if none. - Used for duplicate filtering and in-order delivery. - - - - - For lock requests, the set of locks being acquired. Is sorted, - contains at least one element, and has no repetitions. - - - - - For lock requests involving multiple locks, the message number. - - - - - The persisted state of an entity scheduler, as handed forward between ContinueAsNew instances. - - - - - Whether this entity exists or not. - - - - - The last serialized entity state. - - - - - The queue of waiting operations, or null if none. - - - - - The instance id of the orchestration that currently holds the lock of this entity. - - - - - Whether processing on this entity is currently suspended. - - - - - The metadata used for reordering and deduplication of messages sent to entities. - - - - - ETW Event Provider for the WebJobs.Extensions.DurableTask extension. - - - - - An EventSource Listener. It sets up a callback for internal EventSource events - that we use to capture their data and log it in Linux App Service plans. - - - - - Create an EventSourceListener to capture and log Durable EventSource - data in Linux. - - A LinuxAppService logger configured for the current linux host. - If true, durableTask.Core verbose logs are enabled. The opposite if false. - A tracing client to log exceptions. - The durability provider's event source name. - - - - Gets called for every EventSource in the process, this method allows us to determine - if the listener will subscribe to a particular EventSource provider. - We only listen to DurableTask and DurableTask-Extension EventSource providers. - - An instance of EventSource. - - - - Gets called after every EventSource event. We capture that event's data and log it - using the appropiate strategy for the current linux host. - - The EventSource event data, for logging. - - - - The exception that is thrown when a sub-orchestrator or activity function fails - with an error. - - - The `InnerException` property of this instance will contain additional information - about the failed sub-orchestrator or activity function. - - - - - Initializes a new instance of a . - - A message describing where to look for more details. - - - - Initializes a new instance of a . - - A message describing where to look for more details. - The exception that caused the function to fail. - - - - The name of a durable function. - - - - - Initializes a new instance of the struct. - - The name of the function. - - - - Gets the name of the function without the version. - - - The name of the activity function without the version. - - - - - Compares two objects for equality. - - The first to compare. - The second to compare. - true if the two objects are equal; otherwise false. - - - - Compares two objects for inequality. - - The first to compare. - The second to compare. - true if the two objects are not equal; otherwise false. - - - - Gets a value indicating whether to objects - are equal using value semantics. - - The other object to compare to. - true if the two objects are equal using value semantics; otherwise false. - - - - Gets a value indicating whether to objects - are equal using value semantics. - - The other object to compare to. - true if the two objects are equal using value semantics; otherwise false. - - - - Calculates a hash code value for the current instance. - - A 32-bit hash code value. - - - - Gets the string value of the current instance. - - The name and optional version of the current instance. - - - - The type of a function. - - - - - Class for creating deterministic . - - - - - Data structure containing orchestration instance creation HTTP endpoints. - - - - - Gets the HTTP POST orchestration instance creation endpoint URL. - - - The HTTP URL for creating a new orchestration instance. - - - - - Gets the HTTP POST orchestration instance create-and-wait endpoint URL. - - - The HTTP URL for creating a new orchestration instance and waiting on its completion. - - - - - Data structure containing status, terminate and send external event HTTP endpoints. - - - - - Gets the ID of the orchestration instance. - - - The ID of the orchestration instance. - - - - - Gets the HTTP GET status query endpoint URL. - - - The HTTP URL for fetching the instance status. - - - - - Gets the HTTP POST external event sending endpoint URL. - - - The HTTP URL for posting external event notifications. - - - - - Gets the HTTP POST instance termination endpoint. - - - The HTTP URL for posting instance termination commands. - - - - - Gets the HTTP POST instance rewind endpoint. - - - The HTTP URL for rewinding orchestration instances. - - - - - Gets the HTTP DELETE purge instance history by instance ID endpoint. - - - The HTTP URL for purging instance history by instance ID. - - - - - Gets the HTTP POST instance restart endpoint. - - - The HTTP URL for restarting an orchestration instance. - - - - - Defines retry policies that can be passed as parameters to various operations. - - - - - Creates a new instance SerializableRetryOptions with the supplied first retry and max attempts. - - Timespan to wait for the first retry. - Max number of attempts to retry. - - The value must be greater than . - - - - - Gets or sets the first retry interval. - - - The TimeSpan to wait for the first retries. - - - - - Gets or sets the max retry interval. - - - The TimeSpan of the max retry interval, defaults to 6 days. - - - - - Gets or sets the backoff coefficient. - - - The backoff coefficient used to determine rate of increase of backoff. Defaults to 1. - - - - - Gets or sets the timeout for retries. - - - The TimeSpan timeout for retries, defaults to . - - - - - Gets or sets the max number of attempts. - - - The maximum number of retry attempts. - - - - - Gets or sets the list of status codes upon which the - retry logic specified by this object shall be triggered. - If none are provided, all 4xx and 5xx status codes - will be retried. - - - - - Custom service interface for signaling the extension when the function app is starting up or shutting down. - - - This interface is expected to be used as an injected service. We use a "wrapper" interface instead of - directly using the "real" IApplicationLifetime interface so that we can have an injected service - that is available in both .NET Core (Functions 2.0+) and .NET Framework (Functions 1.0). - - - - - Gets a that can be used to detect function app startup events. - - - A that is signalled when the function app has started up. - - - - - Gets a that can be used to detect function app stopping events. - - - A that is signalled when the function app is beginning to shut down. - - - - - Gets a that can be used to detect function app shutdown events. - - - A that is signalled when the function app has completed shutting down. - - - - - Interface defining methods to resolve connection information. - - - - - Attempts to resolve the connection info given a name. - - - Depending on the configuration, the value may either be a connection string in the - property, or a user-defined type made - up of one or more key-value pairs. - - The name of the connection information. - The resolved connection information. - - - - Interface defining methods to resolve connection strings. - - - - - Looks up a connection string value given a name. - - The name of the connection string. - Returns the resolved connection string value. - - - - Interface defining methods to build instances of . - - - - - Specifies the Durability Provider Factory name. - - - - - Creates or retrieves a durability provider to be used throughout the extension. - - An durability provider to be used by the Durable Task Extension. - - - - Creates or retrieves a cached durability provider to be used in a given function execution. - - A durable client attribute with parameters for the durability provider. - A durability provider to be used by a client function. - - - - Interface used for testing Durable HTTP. - - - - - Creates an HttpClientHandler and returns it. - - Returns an HttpClientHandler. - - - - Interface defining methods to build instances of for error serialization. - - - - - Creates or retrieves to be used throughout the extension for error serialization. - - to be used by the Durable Task Extension for error serialization. - - - - Interface defining methods to life cycle notifications. - - - - - The orchestrator was starting. - - The name of the task hub. - The name of the orchestrator function to call. - The ID to use for the orchestration instance. - The orchestrator function is currently replaying itself. - A task that completes when the lifecycle notification message has been sent. - - - - The orchestrator was completed. - - The name of the task hub. - The name of the orchestrator function to call. - The ID to use for the orchestration instance. - The orchestration completed with ContinueAsNew as is in the process of restarting. - The orchestrator function is currently replaying itself. - A task that completes when the lifecycle notification message has been sent. - - - - The orchestrator was failed. - - The name of the task hub. - The name of the orchestrator function to call. - The ID to use for the orchestration instance. - Additional data associated with the tracking event. - The orchestrator function is currently replaying itself. - A task that completes when the lifecycle notification message has been sent. - - - - The orchestrator was terminated. - - The name of the task hub. - The name of the orchestrator function to call. - The ID to use for the orchestration instance. - Additional data associated with the tracking event. - A task that completes when the lifecycle notification message has been sent. - - - - Interface defining methods to build instances of for message serialization. - - - - - Creates or retrieves to be used throughout the extension for message serialization. - - to be used by the Durable Task Extension for message serialization. - - - - Representation of the supported Operating Systems. - - - - - Linux OS. - - - - - Windows OS - - - - - Representation of supported Programming Languages. - - - - - .NET in-process. - - - - - .NET out-of-process. - - - - - Python. - - - - - Node: either JavaScript and TypeScript. - - - - - PowerShell. - - - - - Java. - - - - - Unknown worker runtime. - - - - - Interface for accessing the AppService plan information, - the OS, and user-facing PL. - - Note: The functionality is currently limited, but will grow - along with the pursuit of more platform-specific defaults. - - - - - Determine the underlying plan is Consumption or not. - - True if the plan is Consumption. Otherwise, False. - - - - Determine the underlying operating system. - - An OperatingSystem enum. - - - - Determine the underlying worker runtime. - - A WorkerRuntimeType enum. - - - - Returns the application tenant when running on linux. - - The application tenant. - - - - Returns the application stamp name when running on linux. - - The application stamp name. - - - - Returns the application container name when running on linux. - - The application container name. - - - - Defines methods for retrieving Azure Storage account metadata. - - - - - Gets the associated with the . - - The name associated with the connection information. - The corresponding . - - - - Implementations of this interface can be used to provide authorization tokens for outbound HTTP requests. - - - - - Gets a token for a resource. - - A representing the result of the asynchronous operation. - - - - The File logger for linux dedicated. Manages file rolling and is concurrency-safe. - This is copied over from the azure-funtions-host codebase here: - https://github.com/Azure/azure-functions-host/blob/35cf323fa3464a08b410a518bcab006e801301fe/src/WebJobs.Script.WebHost/Diagnostics/LinuxAppServiceFileLogger.cs - We have modified their implementation to utilize syscall.rename instead of File.Move during file rolling. - This change is necessary for older versions of fluent-bit, our logging infrastructure in linux dedicated, to properly deal with logfile archiving. - - - - - The File logger for linux dedicated. Manages file rolling and is concurrency-safe. - - Name of target logfile. - Directory of target logfile. - Whether or not to start monitoring the write buffer at initialization time. - - - - Log a string. - - Message to log. - - - - Flushes the write buffer, stops writing to logfile afterwards. - - Timeout in milliseconds for flushing task. - - - - In charge of logging services for our linux App Service offerings: Consumption and Dedicated. - In Consumption, we log to the console and identify our log by a prefix. - In Dedicated, we log asynchronously to a pre-defined logging path. - This class is utilized by EventSourceListener to write logs corresponding to - specific EventSource providers. - - - - - Create a LinuxAppServiceLogger instance. - - If true, write to console (linux consumption) else to a file (dedicated). - The app's container name. - The app's tenant. - The app's stamp. - - - - Given EventSource message data, we generate a JSON-string that we can log. - - An EventSource message, usually generated by an EventListener. - A JSON-formatted string representing the input. - - - - Log EventSource message data in Linux AppService. - - An EventSource message, usually generated by an EventListener. - - - - Not intended for public consumption. - - - - - Initializes a new instance of the class. - - The orchestration execution context. - - - - Identifiers for each OOProc Schema Version. - - - - - Invokes a DF API based on the input action object. - - An OOProc action object representing a DF task. - The schema version. - If the API returns a task, the DF task corresponding to the input action. Else, null. - - - - Replays the orchestration execution from an OOProc SDK in .NET. - - The OOProc actions payload. - The schema version. - An awaitable Task that completes once replay completes. - - - - Replays the OOProc orchestration based on the actions array. It uses the schema enum to - determine which replay implementation is most appropiate. - - The OOProc actions payload. - The OOProc protocol schema version. - An awaitable Task that completes once replay completes. - - - - Task activity implementation which delegates the implementation to a function. - - - - - The DTFx-generated, auto-incrementing ID that uniquely identifies this activity function execution. - - - - - Common functionality of and . - - - - - Implements the entity scheduler as a looping orchestration. - There is one such orchestration per entity. - The orchestration terminates if the entity is deleted and idle. - The orchestration calls ContinueAsNew when it is idle, but not deleted. - - - - - The results of executing a batch of operations on the entity out of process. - - - - - Whether the entity exists after executing the batch. - This is false if the last operation in the batch deletes the entity, - and true otherwise. - - - - - The state of the entity after executing the batch. - Should be null if is false. - - - - - The results of executing the operations. The length of this list must always match - the size of the batch, even if there were exceptions. - - - - - The list of signals sent by the entity. Can be empty. - - - - - The results of executing an operation. - - - - - The returned value or error/exception. - - - - - Determines whether is a normal result, or an error/exception. - - - - - The measured duration of this operation's execution, in milliseconds. - - - - - Describes a signal that was emitted by one of the operations in the batch. - - - - - The destination of the signal. - - - - - The name of the operation being signaled. - - - - - The input of the operation being signaled. - - - - - Task orchestration implementation which delegates the orchestration implementation to a function. - - - - - Configuration options for Managed Identity. - - - - - Initializes a new instance of the class. - - The host of the Azure Active Directory authority. - The tenant id of the user to authenticate. - - - - The host of the Azure Active Directory authority. The default is https://login.microsoftonline.com/. - - - - - The tenant id of the user to authenticate. - - - - - Token Source implementation for Azure Managed Identities. - - - - - Initializes a new instance of the class. - - - The Azure Active Directory resource identifier of the web API being invoked. - For example, https://management.core.windows.net/.default or https://graph.microsoft.com/.default. - - Optional Azure credential options to use when authenticating. - - - - Gets the Azure Active Directory resource identifier of the web API being invoked. - For example, https://management.core.windows.net/.default or https://graph.microsoft.com/.default. - - - - - The azure credential options that a user can configure when authenticating. - - - - - - - - JSON-serializes the specified object. - - - - - JSON-serializes the specified object and throws a if the - resulting JSON exceeds the maximum size specified by . - - - - - Options used to bind a function parameter to a , , or instance. - - - - - Optional. Gets or sets the setting name for the app setting containing connection details used by this binding to connect - to instances of the storage provider other than the default one this application communicates with. - - The name of an app setting containing connection details. - - For Azure Storage the default behavior is to use the value of . - If no value exists there, then the default behavior is to use the standard `AzureWebJobsStorage` connection string for all storage usage. - - - - - Gets or sets the name of the task hub in which the orchestration data lives. - - The task hub used by this binding. - - The default behavior is to use the task hub name specified in . - If no value exists there, then a default value will be used. - - - - - Indicate if the client is External from the azure function where orchestrator functions are hosted. - - - Default is true. - - - - - Configuration options for the Azure Storage storage provider. - - - - - Gets or sets the name of the Azure Storage connection information used to manage the underlying Azure Storage resources. - - - The value may refer to either a connection string or the configuration section containing connection metadata. - The default behavior is to use the standard AzureWebJobsStorage connection for all storage usage. - - - The name of a connection-related key that exists in the app's application settings. The value may refer to - a connection string or the section detailing additional connection metadata. - - - - - Gets or sets the name of the Azure Storage connection string used to manage the underlying Azure Storage resources. - - - If not specified, the default behavior is to use the standard `AzureWebJobsStorage` connection string for all storage usage. - - The name of a connection string that exists in the app's application settings. - - - - Gets or sets the number of messages to pull from the control queue at a time. - - - Messages pulled from the control queue are buffered in memory until the internal - dispatcher is ready to process them. - - A positive integer configured by the host. The default value is 32. - - - - Gets or sets the partition count for the control queue. - - - Increasing the number of partitions will increase the number of workers - that can concurrently execute orchestrator functions. However, increasing - the partition count can also increase the amount of load placed on the storage - account and on the thread pool if the number of workers is smaller than the - number of partitions. - - A positive integer between 1 and 16. The default value is 4. - - - - Gets or set the number of control queue messages that can be buffered in memory - at a time, at which point the dispatcher will wait before dequeuing any additional - messages. The default is 256. The maximum value is 1000. - - - Increasing this value can improve orchestration throughput by pre-fetching more - orchestration messages from control queues. The downside is that it increases the - possibility of duplicate function executions if partition leases move between app - instances. This most often occurs when the number of app instances changes. - - A non-negative integer between 0 and 1000. The default value is 256. - - - - Gets or sets the visibility timeout of dequeued control queue messages. - - - A TimeSpan configured by the host. The default is 5 minutes. - - - - - Gets or sets the visibility timeout of dequeued work item queue messages. - - - A TimeSpan configured by the host. The default is 5 minutes. - - - - - Gets or sets the name of the Azure Storage connection information to use for the - durable tracking store (History and Instances tables). - - - - If not specified, the connection string is used for the durable tracking store. - - - This property is primarily useful when deploying multiple apps that need to share the same - tracking infrastructure. For example, when deploying two versions of an app side by side, using - the same tracking store allows both versions to save history into the same table, which allows - clients to query for instance status across all versions. - - - - The name of a connection-related key that exists in the app's application settings. The value may refer to - a connection string or the section detailing additional connection metadata. - - - - - Gets or sets the name of the Azure Storage connection string to use for the - durable tracking store (History and Instances tables). - - - If not specified, the connection string - is used for the durable tracking store. - - This property is primarily useful when deploying multiple apps that need to share the same - tracking infrastructure. For example, when deploying two versions of an app side by side, using - the same tracking store allows both versions to save history into the same table, which allows - clients to query for instance status across all versions. - - The name of a connection string that exists in the app's application settings. - - - - Gets or sets the name prefix to use for history and instance tables in Azure Storage. - - - This property is only used when is specified. - If no prefix is specified, the default prefix value is "DurableTask". - - The prefix to use when naming the generated Azure tables. - - - - Gets or sets whether the extension will automatically fetch large messages in orchestration status - queries. If set to false, the extension will return large messages as a blob url. - - A boolean indicating whether will automatically fetch large messages . - - - - Gets or sets the maximum queue polling interval. - - Maximum interval for polling control and work-item queues. - - - - Determines whether or not to use the old partition management strategy, or the new - strategy that is more resilient to split brain problems, at the potential expense - of scale out performance. - - A boolean indicating whether we use the legacy partition strategy. Defaults to false. - - - - Throws an exception if the provided hub name violates any naming conventions for the storage provider. - - - - - Throws an exception if any of the settings of the storage provider are invalid. - - - - - Configuration options for the Durable Task extension. - - - - - Settings used for Durable HTTP functionality. - - - - - Gets or sets default task hub name to be used by all , , , - , and instances. - - - A task hub is a logical grouping of storage resources. Alternate task hub names can be used to isolate - multiple Durable Functions applications from each other, even if they are using the same storage backend. - - The name of the default task hub. - - - - The section of configuration related to storage providers. If using Azure Storage provider, the schema should match - . - - - - - The section of configuration related to tracing. - - - - - The section of configuration related to notifications. - - - - - Gets or sets the maximum number of activity functions that can be processed concurrently on a single host instance. - - - Increasing activity function concurrent can result in increased throughput but can - also increase the total CPU and memory usage on a single worker instance. - - - A positive integer configured by the host. - - - - - Gets or sets the maximum number of orchestrator functions that can be processed concurrently on a single host instance. - - - A positive integer configured by the host. - - - - - Gets or sets a value indicating whether to enable the local RPC endpoint managed by this extension. - - - The local RPC endpoint is intended to allow out-of-process functions to make direct calls into this - extension. This is primarily intended to support instance management APIs used by the durable client - binding. The following values are allowed: - - - null - (Default) The local RPC endpoint is enabled only for non-.NET function apps. - - - true - A local RPC endpoint will be enabled and listen at http://127.0.0.1:17071/durabletask/. - - - false - The local RPC endpoint will be disabled. - - - - - - - Gets or sets the maximum number of entity operations that are processed as a single batch. - - - Reducing this number can help to avoid timeouts on consumption plans. If set to 1, batching is disabled, and each operation - message executes and is billed as a separate function invocation. - - - A positive integer configured by the host. - - - - - Gets or sets a flag indicating whether to enable extended sessions. - - - Extended sessions can improve the performance of orchestrator functions by allowing them to skip - replays when new messages are received within short periods of time. - Note that orchestrator functions which are extended this way will continue to count against the - limit. To avoid starvation, only half of the maximum - number of allowed concurrent orchestrator functions can be concurrently extended at any given time. - The property can also be used to control how long an idle - orchestrator function is allowed to be extended. - It is recommended that this property be set to false during development to help - ensure that the orchestrator code correctly obeys the idempotency rules. - - - true to enable extended sessions; otherwise false. - - - - - Gets or sets the amount of time in seconds before an idle session times out. The default value is 30 seconds. - - - This setting is applicable when is set to true. - - - The number of seconds before an idle session times out. - - - - - Gets or sets the maximum number of orchestration actions. The default value is 100,000. - - - - - States that will override an existing orchestrator when attempting to start a new orchestrator with the same instance Id. - - - - - Gets or sets the time window within which entity messages get deduplicated and reordered. - - - - - Preview setting for gracefully shutting down to prevent WebJob shutdowns from failing - activities or orchestrations. - - - - - Controls whether an uncaught exception inside an entity operation should roll back the effects of the operation. - - - The rollback undoes all internal effects of an operation - (sent signals, and state creation, deletion, or modification). - However, it does not roll back external effects (such as I/O that was performed). - This setting can affect serialization overhead: if true, the entity state is serialized - after each individual operation. If false, the entity state is serialized - only after an entire batch of operations completes. - - - - - If true, takes a lease on the task hub container, allowing for only one app to process messages in a task hub at a time. - - - - - If UseAppLease is true, gets or sets the AppLeaaseOptions used for acquiring the lease to start the application. - - - - - Sets HubName to a value that is considered a default value. - - TaskHub name that is considered the default. - - - - Configuration of the Event Grid notification options - for the Durable Task Extension. - - - - - Gets or sets the URL of an Azure Event Grid custom topic endpoint. - When set, orchestration life cycle notification events will be automatically - published to this endpoint. - - - Azure Event Grid topic URLs are generally expected to be in the form - https://{topic_name}.{region}.eventgrid.azure.net/api/events. - - - The Azure Event Grid custom topic URL. - - - - - Gets or sets the name of the app setting containing the key used for authenticating with the Azure Event Grid custom topic at . - - - The name of the app setting that stores the Azure Event Grid key. - - - - - Gets or sets the Event Grid publish request retry count. - - The number of retry attempts. - - - - Gets orsets the Event Grid publish request retry interval. - - A representing the retry interval. The default value is 5 minutes. - - - - Gets or sets the Event Grid publish request http status. - - A list of HTTP status codes, e.g. 400, 403. - - - - Gets or sets the event types that will be published to Event Grid. - - - A list of strings. Possible values 'Started', 'Completed', 'Failed', 'Terminated'. - - - - - Used for Durable HTTP functionality. - - - - - Reserved name to know when a TaskActivity should be an HTTP activity. - - - - - Gets or sets the default number of milliseconds between async HTTP status poll requests. - - - - - Configuration of the notification options - for the Durable Task Extension. - - - - - The section of configuration related to Event Grid notifications. - - - - - Configuration of the trace options - for the Durable Task Extension. - - - - - Gets or sets a value indicating whether to trace the inputs and outputs of function calls. - - - The default behavior when tracing function execution events is to include the number of bytes in the serialized - inputs and outputs for function calls. This provides minimal information about what the inputs and outputs look - like without bloating the logs or inadvertently exposing sensitive information to the logs. Setting - to true will instead cause the default function logging to log - the entire contents of function inputs and outputs. - - - true to trace the raw values of inputs and outputs; otherwise false. - - - - - Gets or sets if Azure linux telemetry should include verbose logs. - - - The default behaviour is false, which disables verbose logs. When set - to true, performance may be affected due to the amount of verbose logs. - We recommend setting this to true primarily for debugging purposes. - - true to enable verbose telemetry; false otherwise. - - - - - - Gets or sets if logs for replay events need to be recorded. - - - The default value is false, which disables the logging of replay events. - - - Boolean value specifying if the replay events should be logged. - - - - - Deprecated attribute to bind a function parameter to a . - Here for backwards compatibility. Please use the instead. - - - - - Represents the possible runtime execution status values for an orchestration instance. - - - - - The status of the orchestration could not be determined. - - - - - The orchestration is running (it may be actively running or waiting for input). - - - - - The orchestration ran to completion. - - - - - The orchestration completed with ContinueAsNew as is in the process of restarting. - - - - - The orchestration failed with an error. - - - - - The orchestration was canceled. - - - - - The orchestration was terminated via an API call. - - - - - The orchestration was scheduled but has not yet started. - - - - - Query condition for searching the status of orchestration instances. - - - - - Initializes a new instance of the class. - - - - - Return orchestration instances which matches the runtimeStatus. - - - - - Return orchestration instances which were created after this DateTime. - - - - - Return orchestration instances which were created before this DateTime. - - - - - Return orchestration instances which matches the TaskHubNames. - - - - - Maximum number of records that can be returned by the request. The default value is 100. - - - Requests may return fewer records than the specified page size, even if there are more records. - Always check the continuation token to determine whether there are more records. - - - - - ContinuationToken of the pager. - - - - - Return orchestration instances that have this instance id prefix. - - - - - Determines whether the query will include the input of the orchestration. - - - - - The status of all orchestration instances with paging for a given query. - - - - - Gets or sets a collection of statuses of orchestration instances matching the query description. - - A collection of orchestration instance status values. - - - - Gets or sets a token that can be used to resume the query with data not already returned by this query. - - A server-generated continuation token or null if there are no further continuations. - - - - Durable Task Framework orchestration middleware that invokes an out-of-process orchestrator function. - - This middleware context provided by the framework that contains information about the orchestration. - The next middleware handler in the pipeline. - Thrown if there's an internal failure in the middleware. - Thrown if there is a recoverable error in the Functions runtime that's expected to be handled gracefully. - - - - Durable Task Framework activity middleware that invokes an out-of-process orchestrator function. - - This middleware context provided by the framework that contains information about the activity. - The next middleware handler in the pipeline. - Thrown if there is a recoverable error in the Functions runtime that's expected to be handled gracefully. - - - - Represents the out-of-proc protocols supported by this extension. - - - - - Out-of-proc works by replaying SDK actions in an orchestration "shim", which interprets - the output of an out-of-proc language SDK and makes DTFx API calls on behalf of the - out-of-process orchestrator. - - - This protocol has been deprecated. All new language SDK should instead use - . - - - - - Out-of-proc works by forwarding all outputs directly to the Durable Task Framework - without using any orchestrator "shims" or attemping any interpretation. This is - sometimes referred to as "out of proc v2". - - - - - Represents options for different states that an existing orchestrator can be in to be able to be overwritten by - an attempt to start a new instance with the same instance Id. - - - - - Option to start a new orchestrator instance with an existing instnace Id when the existing - instance is in any state. - - - - - Option to only start a new orchestrator instance with an existing instance Id when the existing - instance is in a terminated, failed, or completed state. - - - - - Provides access to internal functionality for the purpose of implementing durability providers. - - - - - Returns the instance id of the entity scheduler for a given entity id. - - The entity id. - The instance id of the scheduler. - - - - Reads the state of an entity from the serialized entity scheduler state. - - The orchestration state of the scheduler. - The serializer settings. - The serialized state of the entity. - true if the entity exists, false otherwise. - - - - Converts the DTFx representation of the orchestration state into the DF representation. - - The orchestration state. - The orchestration status. - - - - Class to hold statistics about this execution of purge history. - - - - - Constructor for purge history statistics. - - Number of instances deleted. - - - - Gets the number of deleted instances. - - The number of deleted instances. - - - - Defines retry policies that can be passed as parameters to various operations. - - - - - Creates a new instance RetryOptions with the supplied first retry and max attempts. - - Timespan to wait for the first retry. - Max number of attempts to retry. - - The value must be greater than . - - - - - Gets or sets the first retry interval. - - - The TimeSpan to wait for the first retries. - - - - - Gets or sets the max retry interval. - - - The TimeSpan of the max retry interval, defaults to . - - - - - Gets or sets the backoff coefficient. - - - The backoff coefficient used to determine rate of increase of backoff. Defaults to 1. - - - - - Gets or sets the timeout for retries. - - - The TimeSpan timeout for retries, defaults to . - - - - - Gets or sets the max number of attempts. - - - The maximum number of retry attempts. - - - - - Gets or sets a delegate to call on exception to determine if retries should proceed. - - - The delegate to handle exception to determine if retries should proceed. - - - - - Connection info provider which resolves connection information from a standard application (Non WebJob). - - - - - Initializes a new instance of the class. - - A object provided by the application host. - is . - - - - - - - Connection string provider which resolves connection strings from the an standard application (Non WebJob). - - - - - Initializes a new instance of the class. - - A object provided by the application host. - - - - Looks up a connection string value given a name. - - The name of the connection string. - Returns the resolved connection string value. - - - - Parameters for starting a new instance of an orchestration. - - - This class is primarily intended for use with IAsyncCollector<T>. - - - - - Initializes a new instance of the class. - - The name of the orchestrator function to start. - The JSON-serializeable input for the orchestrator function. - - - - Initializes a new instance of the class. - - - - - Gets or sets the name of the orchestrator function to start. - - The name of the orchestrator function to start. - - - - Gets or sets the instance ID to assign to the started orchestration. - - - If this property value is null (the default), then a randomly generated instance ID will be assigned automatically. - - The instance ID to assign. - - - - Gets or sets the JSON-serializeable input data for the orchestrator function. - - JSON-serializeable input value for the orchestrator function. - - - - Response for Orchestration Status Query. - - - - - Name. - - - - - InstanceId. - - - - - Runtime status. - - - - - Input. - - - - - Custom status. - - - - - Output. - - - - - Created time value. - - - - - Last updated time. - - - - - JSON object representing history for an orchestration execution. - - - - - Trigger attribute used for durable activity functions. - - - - - Gets or sets the name of the activity function. - - - The name of the activity function or null to use the function name. - - - - - Trigger attribute used for durable entity functions. - - - - - Gets or sets the name of the entity. - - - If not specified, the function name is used as the name of the entity. - - - The name of the entity or null to use the function name. - - - - - Trigger attribute used for durable orchestrator functions. - - - - - Gets or sets the name of the orchestrator function. - - - If not specified, the function name is used as the name of the orchestration. - - - The name of the orchestrator function or null to use the function name. - - - - - Provides an input binding for the typed client experience that - is generated via the source-generator nuget package. - - - - - Connection info provider which resolves connection information from the WebJobs context. - - - - - - - - Connection string provider which resolves connection strings from the WebJobs context. - - - - - - - Initializes the attribute with the specified return value condition. - - The return value condition. If the method returns this value, the associated parameter will not be null. - - - - Gets the return value condition. - - - Represent a type can be used to index a collection either from the start or the end. - - Index is used by the C# compiler to support the new index syntax. - - int[] someArray = new int[5] { 1, 2, 3, 4, 5 } ; - int lastElement = someArray[^1]; // lastElement = 5 - - - - - Construct an Index using a value and indicating if the index is from the start or from the end. - The index value. it has to be zero or positive number. - Indicating if the index is from the start or from the end. - - If the Index constructed from the end, index value 1 means pointing at the last element and index value 0 means pointing at beyond last element. - - - - Create an Index pointing at first element. - - - Create an Index pointing at beyond last element. - - - Create an Index from the start at the position indicated by the value. - The index value from the start. - - - Create an Index from the end at the position indicated by the value. - The index value from the end. - - - Returns the index value. - - - Indicates whether the index is from the start or the end. - - - Calculate the offset from the start using the giving collection length. - The length of the collection that the Index will be used with. length has to be a positive value. - - For performance reason, we don't validate the input length parameter and the returned offset value against negative values. - we don't validate either the returned offset is greater than the input length. - It is expected Index will be used with collections which always have non negative length/count. If the returned offset is negative and - then used to index a collection will get out of range exception which will be same affect as the validation. - - - - Indicates whether the current Index object is equal to another object of the same type. - An object to compare with this object. - - - Indicates whether the current Index object is equal to another Index object. - An object to compare with this object. - - - Returns the hash code for this instance. - - - Converts integer number to an Index. - - - Converts the value of the current Index object to its equivalent string representation. - - - Represent a range has start and end indexes. - - Range is used by the C# compiler to support the range syntax. - - int[] someArray = new int[5] { 1, 2, 3, 4, 5 }; - int[] subArray1 = someArray[0..2]; // { 1, 2 } - int[] subArray2 = someArray[1..^0]; // { 2, 3, 4, 5 } - - - - - Represent the inclusive start index of the Range. - - - Represent the exclusive end index of the Range. - - - Construct a Range object using the start and end indexes. - Represent the inclusive start index of the range. - Represent the exclusive end index of the range. - - - Indicates whether the current Range object is equal to another object of the same type. - An object to compare with this object. - - - Indicates whether the current Range object is equal to another Range object. - An object to compare with this object. - - - Returns the hash code for this instance. - - - Converts the value of the current Range object to its equivalent string representation. - - - Create a Range object starting from start index to the end of the collection. - - - Create a Range object starting from first element in the collection to the end Index. - - - Create a Range object starting from first element to the end. - - - Calculate the start offset and length of range object using a collection length. - The length of the collection that the range will be used with. length has to be a positive value. - - For performance reason, we don't validate the input length parameter against negative values. - It is expected Range will be used with collections which always have non negative length/count. - We validate the range is inside the length scope though. - - - - diff --git a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-netstandard2.0.xml b/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-netstandard2.0.xml deleted file mode 100644 index a1ea41074..000000000 --- a/src/WebJobs.Extensions.DurableTask/Microsoft.Azure.WebJobs.Extensions.DurableTask-netstandard2.0.xml +++ /dev/null @@ -1,4896 +0,0 @@ - - - - Microsoft.Azure.WebJobs.Extensions.DurableTask - - - - - - - - - - - Defines methods for retrieving . - - - - - Creates a based on the specified . - - A configuration containing information about the connection. - - An optional for prematurely canceling the operation. - - - The based on the specified . - - The operation was canceled. - - - - Creates a based on the specified . - - A configuration containing information about the connection. - The offset from the token expiration date to begin refresh. - The amount of time to wait between refresh attempts in the event of a problem. - - An optional for prematurely canceling the operation. - - - The based on the specified . - - The operation was canceled. - - - - - - - The Azure Storage implementation of additional methods not required by IOrchestrationService. - - - - - The app setting containing the Azure Storage connection string. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The URL used by the client binding object to use when calling back into - the extension. For the original out-of-proc implementation, this is a simple - HTTP endpoint. For out-of-proc "v2" (middelware passthrough), this is a gRPC endpoint. - - - - - The result of a clean entity storage operation. - - - - - The number of orphaned locks that were removed. - - - - - The number of entities whose metadata was removed from storage. - - - - - The default parameter type for activity functions. - - - - - - - - - - - Returns the input of the task activity in its raw JSON string value. - - - The raw JSON-formatted activity input as a string value. - - - - - Gets the input of the current activity function instance as a JToken. - - - The parsed JToken representation of the activity input. - - - - - - - - Sets the JSON-serializeable output of the activity function. - - - If this method is not called explicitly, the return value of the activity function is used as the output. - - - The JSON-serializeable value to use as the activity function output. - - - - - Client for starting, querying, terminating, and raising events to orchestration instances. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Factory class to create Durable Client to start works outside an azure function context. - - - - - Initializes a new instance of the class. - - Default Options to Build Durable Clients. - The factory used to create orchestration service based on the configured storage provider. - The logger factory used for extension-specific logging and orchestration tracking. - The configuration options for this extension. - The factory used to create for message settings. - - - - Gets a using configuration from a instance. - - options containing the client configuration parameters. - Returns a instance. The returned instance may be a cached instance. - - - - Gets a using configuration from a instance. - - Returns a instance. The returned instance may be a cached instance. - - - - - - - Factory class to create Durable Client to start works outside an azure function context. - - - - - Gets a using configuration from a instance. - - options containing the client configuration parameters. - Returns a instance. The returned instance may be a cached instance. - - - - Gets a using configuration from a instance. - - Returns a instance. The returned instance may be a cached instance. - - - - Common functionality used by both - and . - - - - - Context object passed to application code executing entity operations. - - - - - - - - - - - - - - Parameter data for orchestration bindings that can be used to schedule function-based activities. - - - - - - - - - - - - - - - - - - - - Returns the orchestrator function input as a raw JSON string value. - - - The raw JSON-formatted orchestrator function input. - - - - - Gets the input of the current orchestrator function instance as a JToken. - - - The parsed JToken representation of the orchestrator function input. - - - - - - - - Sets the JSON-serializeable output of the current orchestrator function. - - - If this method is not called explicitly, the return value of the orchestrator function is used as the output. - - The JSON-serializeable value to use as the orchestrator function output. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A non-generic tcs interface. - - - - - The type of the event stored in the completion source. - - - - - The next task completion source in the stack. - - - - - Tries to set the result on tcs. - - The result. - - - - Defines convenient overloads for calling the context methods, for all the contexts. - - - - - Returns an instance of ILogger that is replay safe, ensuring the logger logs only when the orchestrator - is not replaying that line of code. - - The context object. - An instance of ILogger. - An instance of a replay safe ILogger. - - - - Provides functionality available to durable activities. - - - - - Gets the name of the current activity function. - - - - - Gets the instance ID of the currently executing orchestration. - - - The instance ID is generated and fixed when the orchestrator function is scheduled. It can be either - auto-generated, in which case it is formatted as a GUID, or it can be user-specified with any format. - - - The ID of the current orchestration instance. - - - - - Gets the input of the current activity function as a deserialized value. - - Any data contract type that matches the JSON input. - The deserialized input value. - - - - Provides functionality available to durable orchestration and entity clients. - - - - - Gets the name of the task hub configured on this client instance. - - - The name of the task hub. - - - - - Provides functionality available to durable entity clients. - - - - - Gets the name of the task hub configured on this client instance. - - - The name of the task hub. - - - - - Signals an entity to perform an operation. - - The target entity. - The name of the operation. - The input for the operation. - The TaskHubName of the target entity. - The name of the connection string associated with . - A task that completes when the message has been reliably enqueued. - - - - Signals an entity to perform an operation, at a specified time. - - The target entity. - The time at which to start the operation. - The name of the operation. - The input for the operation. - The TaskHubName of the target entity. - The name of the connection string associated with . - A task that completes when the message has been reliably enqueued. - - - - Signals an entity to perform an operation. - - Entity interface. - The target entity key. - A delegate that performs the desired operation on the entity. - A task that completes when the message has been reliably enqueued. - - - - Signals an entity to perform an operation, at a specified time. - - Entity interface. - The target entity key. - The time at which to start the operation. - A delegate that performs the desired operation on the entity. - A task that completes when the message has been reliably enqueued. - - - - Signals an entity to perform an operation. - - Entity interface. - The target entity. - A delegate that performs the desired operation on the entity. - A task that completes when the message has been reliably enqueued. - - - - Signals an entity to perform an operation, at a specified time. - - Entity interface. - The target entity. - The time at which to start the operation. - A delegate that performs the desired operation on the entity. - A task that completes when the message has been reliably enqueued. - - - - Tries to read the current state of an entity. Returns default() if the entity does not exist. - - The JSON-serializable type of the entity. - The target entity. - The TaskHubName of the target entity. - The name of the connection string associated with . - a response containing the current state of the entity. - - - - Gets the status of all entity instances with paging that match the specified query conditions. - - Return entity instances that match the specified query conditions. - Cancellation token that can be used to cancel the query operation. - Returns a page of entity instances and a continuation token for fetching the next page. - - - - Removes empty entities from storage and releases orphaned locks. - - An entity is considered empty, and is removed, if it has no state, is not locked, and has - been idle for more than minutes. - Locks are considered orphaned, and are released, if the orchestration that holds them is not in state . This - should not happen under normal circumstances, but can occur if the orchestration instance holding the lock - exhibits replay nondeterminism failures, or if it is explicitly purged. - Whether to remove empty entities. - Whether to release orphaned locks. - Cancellation token that can be used to cancel the operation. - A task that completes when the operation is finished. - - - - Provides functionality for application code implementing an entity operation. - - - - - Gets the name of the currently executing entity. - - - - - Gets the key of the currently executing entity. - - - - - Gets the id of the currently executing entity. - - - - - Gets the name of the operation that was called. - - - An operation invocation on an entity includes an operation name, which states what - operation to perform, and optionally an operation input. - - - - - Contains function invocation context to assist with dependency injection at Entity construction time. - - - - - Whether this entity has a state. - - - - - The size of the current batch of operations. - - - - - The position of the currently executing operation within the current batch of operations. - - - - - Gets the current state of this entity, for reading and/or updating. - If this entity has no state yet, creates it. - - The JSON-serializable type of the entity state. - Provides an initial value to use for the state, instead of default(). - The current state of this entity. - If the current state has an incompatible type. - - - - Sets the current state of this entity. - - The JSON-serializable state of the entity. - - - - Deletes the state of this entity. - - - - - Gets the input for this operation, as a deserialized value. - - The JSON-serializable type used for the operation input. - The operation input, or default() if none. - - An operation invocation on an entity includes an operation name, which states what - operation to perform, and optionally an operation input. - - - - - Gets the input for this operation, as a deserialized value. - - The JSON-serializable type used for the operation input. - The operation input, or default() if none. - - An operation invocation on an entity includes an operation name, which states what - operation to perform, and optionally an operation input. - - - - - Returns the given result to the caller of this operation. - - the result to return. - - - - Signals an entity to perform an operation, without waiting for a response. Any result or exception is ignored (fire and forget). - - The target entity. - The name of the operation. - The operation input. - - - - Signals an entity to perform an operation, at a specified time. Any result or exception is ignored (fire and forget). - - The target entity. - The time at which to start the operation. - The name of the operation. - The input for the operation. - - - - Signals an entity to perform an operation. - - The target entity key. - A delegate that performs the desired operation on the entity. - Entity interface. - - - - Signals an entity to perform an operation, at a specified time. - - The target entity key. - The time at which to start the operation. - A delegate that performs the desired operation on the entity. - Entity interface. - - - - Signals an entity to perform an operation. - - The target entity. - A delegate that performs the desired operation on the entity. - Entity interface. - - - - Signals an entity to perform an operation, at a specified time. - - The target entity. - The time at which to start the operation. - A delegate that performs the desired operation on the entity. - Entity interface. - - - - Schedules an orchestration function named for execution./>. - Any result or exception is ignored (fire and forget). - - The name of the orchestrator function to call. - the input to pass to the orchestrator function. - optionally, an instance id for the orchestration. By default, a random GUID is used. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - The instance id of the new orchestration. - - - - Dynamically dispatches the incoming entity operation using reflection. - - The class to use for entity instances. - A task that completes when the dispatched operation has finished. - If there is more than one method with the given operation name. - If there is no method with the given operation name. - If the method has more than one argument. - - If the entity's state is null, an object of type is created first. Then, reflection - is used to try to find a matching method. This match is based on the method name - (which is the operation name) and the argument list (which is the operation content, deserialized into - an object array). - - Parameters to feed to the entity constructor. Should be primarily used for - output bindings. Parameters must match the order in the constructor after ignoring parameters populated on - constructor via dependency injection. - - - - Provides functionality available to durable orchestration clients. - - - - - Gets the name of the task hub configured on this client instance. - - - The name of the task hub. - - - - - Creates an HTTP response that is useful for checking the status of the specified instance. - - - The payload of the returned contains HTTP API URLs that can - be used to query the status of the orchestration, raise events to the orchestration, or - terminate the orchestration. - - The HTTP request that triggered the current orchestration instance. - The ID of the orchestration instance to check. - Optional parameter that configures the http response code returned. Defaults to false. - If true, the returned http response code will be a 500 when the orchestrator is in a failed state, when false it will - return 200. - An HTTP 202 response with a Location header and a payload containing instance control URLs. - - - - Creates an HTTP response that is useful for checking the status of the specified instance. - - - The payload of the returned contains HTTP API URLs that can - be used to query the status of the orchestration, raise events to the orchestration, or - terminate the orchestration. - - The HTTP request that triggered the current orchestration instance. - The ID of the orchestration instance to check. - Optional parameter that configures the http response code returned. Defaults to false. - If true, the returned http response code will be a 500 when the orchestrator is in a failed state, when false it will - return 200. - An HTTP 202 response with a Location header and a payload containing instance control URLs. - - - - Creates a object that contains status, terminate and send external event HTTP endpoints. - - The ID of the orchestration instance to check. - Instance of the class. - - - - Creates an HTTP response which either contains a payload of management URLs for a non-completed instance - or contains the payload containing the output of the completed orchestration. - - - If the orchestration instance completes within the specified timeout, then the HTTP response payload will - contain the output of the orchestration instance formatted as JSON. However, if the orchestration does not - complete within the specified timeout, then the HTTP response will be identical to that of the - API. - - The HTTP request that triggered the current function. - The unique ID of the instance to check. - Total allowed timeout for output from the durable function. The default value is 10 seconds. - The timeout between checks for output from the durable function. The default value is 1 second. - Optional parameter that configures the http response code returned. Defaults to false. - If true, the returned http response code will be a 500 when the orchestrator is in a failed state, when false it will - return 200. - An HTTP response which may include a 202 and location header or a 200 with the durable function output in the response body. - - - - Creates an HTTP response which either contains a payload of management URLs for a non-completed instance - or contains the payload containing the output of the completed orchestration. - - - If the orchestration instance completes within the specified timeout, then the HTTP response payload will - contain the output of the orchestration instance formatted as JSON. However, if the orchestration does not - complete within the specified timeout, then the HTTP response will be identical to that of the - API. - - The HTTP request that triggered the current function. - The unique ID of the instance to check. - Total allowed timeout for output from the durable function. The default value is 10 seconds. - The timeout between checks for output from the durable function. The default value is 1 second. - Optional parameter that configures the http response code returned. Defaults to false. - If true, the returned http response code will be a 500 when the orchestrator is in a failed state, when false it will - return 200. - An HTTP response which may include a 202 and location header or a 200 with the durable function output in the response body. - - - - Starts a new execution of the specified orchestrator function. - - The name of the orchestrator function to start. - The ID to use for the new orchestration instance. - A task that completes when the orchestration is started. The task contains the instance id of the started - orchestratation instance. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - - - Starts a new execution of the specified orchestrator function. - - The name of the orchestrator function to start. - JSON-serializeable input value for the orchestrator function. - The type of the input value for the orchestrator function. - A task that completes when the orchestration is started. The task contains the instance id of the started - orchestratation instance. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - - - Starts a new instance of the specified orchestrator function. - - - If an orchestration instance with the specified ID already exists, the existing instance - will be silently replaced by this new instance. - - The name of the orchestrator function to start. - The ID to use for the new orchestration instance. - JSON-serializable input value for the orchestrator function. - The type of the input value for the orchestrator function. - A task that completes when the orchestration is started. The task contains the instance id of the started - orchestratation instance. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - - - Sends an event notification message to a waiting orchestration instance. - - - - In order to handle the event, the target orchestration instance must be waiting for an - event named using the - API. - - - The instance id does not corespond to a valid orchestration instance. - The orchestration instance with the provided instance id is not running. - The ID of the orchestration instance that will handle the event. - The name of the event. - The JSON-serializeable data associated with the event. - A task that completes when the event notification message has been enqueued. - - - - Sends an event notification message to a waiting orchestration instance. - - - - In order to handle the event, the target orchestration instance must be waiting for an - event named using the - API. - - If the specified instance is not found or not running, this operation will throw an exception. - - - The instance id does not corespond to a valid orchestration instance. - The orchestration instance with the provided instance id is not running. - The TaskHubName of the orchestration that will handle the event. - The ID of the orchestration instance that will handle the event. - The name of the event. - The JSON-serializeable data associated with the event. - The name of the connection string associated with . - A task that completes when the event notification message has been enqueued. - - - - Terminates a running orchestration instance. - - - - A terminated instance will eventually transition into the state. - However, this transition will not happen immediately. Rather, the terminate operation will be queued in the task hub - along with other operations for that instance. You can use the - method to know when a terminated instance has actually reached the Terminated state. - - - Terminating an orchestration instance has no effect on any in-flight activity function executions - or sub-orchestrations that were started by the current orchestration instance. - - - The instance id does not corespond to a valid orchestration instance. - The orchestration instance with the provided instance id is not running. - The ID of the orchestration instance to terminate. - The reason for terminating the orchestration instance. - A task that completes when the terminate message is enqueued if necessary. - - - - Rewinds the specified failed orchestration instance with a reason. - - The ID of the orchestration instance to rewind. - The reason for rewinding the orchestration instance. - A task that completes when the rewind message is enqueued. - - - - Gets the status of the specified orchestration instance. - - The ID of the orchestration instance to query. - Boolean marker for including execution history in the response. - Boolean marker for including input and output in the execution history response. - If set, fetch and return the input for the orchestration instance. - Returns a task which completes when the status has been fetched. - - - - Gets the status of all orchestration instances that match the specified conditions. - - If specified, return orchestration instances which were created after this DateTime. - If specified, return orchestration instances which were created before this DateTime. - If specified, return orchestration instances which matches the runtimeStatus. - If specified, this ancellation token can be used to cancel the status query operation. - Returns orchestration status for all instances. - - - - Purge the history for a concrete instance. - - The ID of the orchestration instance to purge. - Returns an instance of . - - - - Purge the orchestration history for instances that match the conditions. - - Start creation time for querying instances for purging. - End creation time for querying instances for purging. - List of runtime status for querying instances for purging. Only Completed, Terminated, or Failed will be processed. - Returns an instance of . - - - - Gets the status of all orchestration instances with paging that match the specified conditions. - - Return orchestration instances that match the specified conditions. - Cancellation token that can be used to cancel the status query operation. - Returns each page of orchestration status for all instances and continuation token of next page. - - - - Gets the status of all orchestration instances with paging that match the specified conditions. - - Return orchestration instances that match the specified conditions. - Cancellation token that can be used to cancel the status query operation. - Returns each page of orchestration status for all instances and continuation token of next page. - - - - Restarts an existing orchestrator with the original input. - - InstanceId of a previously run orchestrator to restart. - Optional parameter that configures if restarting an orchestration will use a new instanceId or if it will - reuse the old instanceId. Defaults to true. - A task that completes when the orchestration is started. The task contains the instance id of the started - orchestratation instance. - - - - Makes the current app the primary app, if it isn't already. Must be using the AppLease feature by setting UseAppLease to true in host.json. - - A task that completes when the operation has started. - - - - Provides functionality available to orchestration code. - - - - - Gets the name of the current orchestration function. - - - - - Gets the instance ID of the currently executing orchestration. - - - The instance ID is generated and fixed when the orchestrator function is scheduled. It can be either - auto-generated, in which case it is formatted as a GUID, or it can be user-specified with any format. - - - The ID of the current orchestration instance. - - - - - Gets the parent instance ID of the currently executing sub-orchestration. - - - The parent instance ID is generated and fixed when the parent orchestrator function is scheduled. It can be either - auto-generated, in which case it is formatted as a GUID, or it can be user-specified with any format. - - - The ID of the parent orchestration of the current sub-orchestration instance. The value will be available only in sub-orchestrations. - - - - - Gets the current date/time in a way that is safe for use in orchestrations and entity operations. - - - This date/time value is derived from the orchestration or entity history. It always returns the same value - at specific points in the orchestrator function code, making it deterministic and safe for replay. - - The orchestration or entity's current date/time in UTC. - - - - Gets a value indicating whether the orchestration or operation is currently replaying itself. - - - This property is useful when there is logic that needs to run only when *not* replaying. For example, certain types of application logging may become too noisy when duplicated - as part of replay. The application code could check to see whether the function is - being replayed and then issue the log statements when this value is false. - - - true if the orchestration or operation is currently being replayed; otherwise false. - - - - - Gets the input of the current orchestrator function as a deserialized value. - - Any data contract type that matches the JSON input. - The deserialized input value. - - - - Sets the output for the current orchestration. - - The JSON-serializeable output of the orchestration. - - - - Restarts the orchestration by clearing its history. - - - Large orchestration histories can consume a lot of memory and cause delays in - instance load times. This method can be used to periodically truncate the stored - history of an orchestration instance. - Note that any unprocessed external events will be discarded when an orchestration - instance restarts itself using this method. - - The JSON-serializeable data to re-initialize the instance with. - - If set to true, re-adds any unprocessed external events into the new execution - history when the orchestration instance restarts. If false, any unprocessed - external events will be discarded when the orchestration instance restarts. - - - - - Sets the JSON-serializeable status of the current orchestrator function. - - - The value is serialized to JSON and will - be made available to the orchestration status query APIs. The serialized JSON - value must not exceed 16 KB of UTF-16 encoded text. - - The JSON-serializeable value to use as the orchestrator function's custom status. - - - - Makes an HTTP call to the specified uri. - - HttpMethod used for api call. - uri used to make the HTTP call. - Content passed in the HTTP request. - The retry option for the HTTP task. - A Result of the HTTP call. - - - - Makes an HTTP call using the information in the DurableHttpRequest. - - The DurableHttpRequest used to make the HTTP call. - A Result of the HTTP call. - - - - Calls an operation on an entity and returns the result asynchronously. - - The JSON-serializable result type of the operation. - The target entity. - The name of the operation. - A task representing the result of the operation. - - - - Calls an operation on an entity and waits for it to complete. - - The target entity. - The name of the operation. - A task representing the completion of the operation on the entity. - - - - Calls an operation on an entity, passing an argument, and returns the result asynchronously. - - The JSON-serializable result type of the operation. - The target entity. - The name of the operation. - The input for the operation. - A task representing the result of the operation. - if the context already holds some locks, but not the one for . - - - - Calls an operation on an entity, passing an argument, and waits for it to complete. - - The target entity. - The name of the operation. - The input for the operation. - A task representing the completion of the operation on the entity. - if the context already holds some locks, but not the one for . - - - - Schedules an orchestrator function named for execution. - - The return type of the scheduled orchestrator function. - The name of the orchestrator function to call. - The JSON-serializeable input to pass to the orchestrator function. - A durable task that completes when the called orchestrator function completes or fails. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The sub-orchestrator function failed with an unhandled exception. - - - - - Schedules an orchestration function named for execution. - - The return type of the scheduled orchestrator function. - The name of the orchestrator function to call. - A unique ID to use for the sub-orchestration instance. - The JSON-serializeable input to pass to the orchestrator function. - A durable task that completes when the called orchestrator function completes or fails. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Schedules an orchestrator function named for execution. - - The name of the orchestrator function to call. - The JSON-serializeable input to pass to the orchestrator function. - A durable task that completes when the called orchestrator function completes or fails. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The sub-orchestrator function failed with an unhandled exception. - - - - - Schedules an orchestrator function named for execution. - - The name of the orchestrator function to call. - A unique ID to use for the sub-orchestration instance. - The JSON-serializeable input to pass to the orchestrator function. - A durable task that completes when the called orchestrator function completes or fails. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Schedules an orchestrator function named for execution with retry options. - - The return type of the scheduled orchestrator function. - The name of the orchestrator function to call. - The retry option for the orchestrator function. - A unique ID to use for the sub-orchestration instance. - The JSON-serializeable input to pass to the orchestrator function. - A durable task that completes when the called orchestrator function completes or fails. - - The retry option object is null. - - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Schedules an orchestrator function named for execution with retry options. - - The name of the orchestrator function to call. - The retry option for the orchestrator function. - The JSON-serializeable input to pass to the orchestrator function. - A durable task that completes when the called orchestrator function completes or fails. - - The retry option object is null. - - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Schedules an orchestrator function named for execution with retry options. - - The name of the orchestrator function to call. - The retry option for the orchestrator function. - A unique ID to use for the sub-orchestration instance. - The JSON-serializeable input to pass to the orchestrator function. - A durable task that completes when the called orchestrator function completes or fails. - - The retry option object is null. - - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Schedules an orchestrator function named for execution with retry options. - - The return type of the scheduled orchestrator function. - The name of the orchestrator function to call. - The retry option for the orchestrator function. - The JSON-serializeable input to pass to the orchestrator function. - A durable task that completes when the called orchestrator function completes or fails. - - The retry option object is null. - - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Creates a durable timer that expires at a specified time. - - - All durable timers created using this method must either expire or be cancelled - using the before the orchestrator function completes. - Otherwise the underlying framework will keep the instance in the "Running" state - even after the orchestrator function has completed. - - The type of . - The time at which the timer should expire. - Any state to be preserved by the timer. - The CancellationToken to use for cancelling the timer. - A durable task that completes when the durable timer expires. - - - - Creates a durable timer that expires at a specified time. - - - All durable timers created using this method must either expire or be cancelled - using the before the orchestrator function completes. - Otherwise the underlying framework will keep the instance in the "Running" state - even after the orchestrator function has completed. - - The time at which the timer should expire. - The CancellationToken to use for cancelling the timer. - A durable task that completes when the durable timer expires. - - - - Waits asynchronously for an event to be raised with name and returns the event data. - - - External clients can raise events to a waiting orchestration instance using - . - - The name of the event to wait for. - Any serializeable type that represents the JSON event payload. - A durable task that completes when the external event is received. - - - - Waits asynchronously for an event to be raised with name . - - - External clients can raise events to a waiting orchestration instance using - with the object parameter set to null. - - The name of the event to wait for. - A durable task that completes when the external event is received. - - - - Waits asynchronously for an event to be raised with name . - - - External clients can raise events to a waiting orchestration instance using - with the object parameter set to null. - - The name of the event to wait for. - The duration after which to throw a TimeoutException. - The CancellationToken to use for cancelling 's internal timer. - A durable task that completes when the external event is received. - - The external event was not received before the timeout expired. - - - - - Waits asynchronously for an event to be raised with name and returns the event data. - - - External clients can raise events to a waiting orchestration instance using - . - - The name of the event to wait for. - The duration of time to wait for the event. - The CancellationToken to use for cancelling 's internal timer. - Any serializeable type that represents the JSON event payload. - A durable task that completes when the external event is received, or throws a timeout exception"/> - if the timeout expires. - - - - Waits asynchronously for an event to be raised with name and returns the event data. - - - External clients can raise events to a waiting orchestration instance using - . - - The name of the event to wait for. - The duration of time to wait for the event. - If specified, the default value to return if the timeout expires before the external event is received. - Otherwise, a timeout exception will be thrown instead. - The CancellationToken to use for cancelling 's internal timer. - Any serializeable type that represents the JSON event payload. - A durable task that completes when the external event is received, or returns the value of - if the timeout expires. - - - - Acquires one or more locks, for the specified entities. - - - Locks can only be acquired if the current context does not hold any locks already. - - The entities whose locks should be acquired. - An IDisposable that releases the lock when disposed. - if the context already holds some locks. - - - - Determines whether the current context is locked, and if so, what locks are currently owned. - - The collection of owned locks. - - Note that the collection of owned locks can be empty even if the context is locked. This happens - if an orchestration calls a suborchestration without lending any locks. - - true if the context already holds some locks. - - - - Creates a new GUID that is safe for replay within an orchestration or operation. - - - The default implementation of this method creates a name-based UUID using the algorithm from - RFC 4122 §4.3. The name input used to generate this value is a combination of the orchestration - instance ID and an internally managed sequence number. - - The new value. - - - - Schedules an activity function named for execution. - - The return type of the scheduled activity function. - The name of the activity function to call. - The JSON-serializeable input to pass to the activity function. - A durable task that completes when the called activity function completes or fails. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Schedules an activity function named for execution. - - The name of the activity function to call. - The JSON-serializeable input to pass to the activity function. - A durable task that completes when the called function completes or fails. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Schedules an activity function named for execution with retry options. - - The return type of the scheduled activity function. - The name of the activity function to call. - The retry option for the activity function. - The JSON-serializeable input to pass to the activity function. - A durable task that completes when the called activity function completes or fails. - - The retry option object is null. - - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Schedules an activity function named for execution with retry options. - - The name of the activity function to call. - The retry option for the activity function. - The JSON-serializeable input to pass to the activity function. - A durable task that completes when the called activity function completes or fails. - - The retry option object is null. - - - The specified function does not exist, is disabled, or is not an orchestrator function. - - - The current thread is different than the thread which started the orchestrator execution. - - - The activity function failed with an unhandled exception. - - - - - Signals an entity to perform an operation, without waiting for a response. Any result or exception is ignored (fire and forget). - - The target entity. - The name of the operation. - The input for the operation. - - - - Signals an operation to be performed by an entity at a specified time. Any result or exception is ignored (fire and forget). - - The target entity. - The time at which to start the operation. - The name of the operation. - The input for the operation. - - - - Schedules a orchestration function named for execution./>. - Any result or exception is ignored (fire and forget). - - The name of the orchestrator function to call. - the input to pass to the orchestrator function. - optionally, an instance id for the orchestration. By default, a random GUID is used. - - The specified function does not exist, is disabled, or is not an orchestrator function. - - The instance id of the new orchestration. - - - - Create an entity proxy. - - The target entity key. - Entity interface. - Entity proxy. - - - - Create an entity proxy. - - The target entity. - Entity interface. - Entity proxy. - - - - Formerly, the abstract base class for DurableOrchestrationContext. - Now obsolete: use instead. - - - - - Formerly, the abstract base class for DurableActivityContext. - Now obsolete: use instead. - - - - - Formerly, the abstract base class for DurableOrchestrationClient. - Now obsolete: use instead. - - - - - Telemetry Initializer that sets correlation ids for W3C. - This source is based on W3COperationCorrelationTelemetryInitializer.cs - 1. Modified with CorrelationTraceContext.Current - 2. Avoid to be overriden when it is RequestTelemetry - Original Source is here https://github.com/microsoft/ApplicationInsights-dotnet-server/blob/2.8.0/Src/Common/W3C/W3COperationCorrelationTelemetryInitializer.cs. - - - - These internal property is copied from W3CConstants - Trace-Id tag name. - - - Span-Id tag name. - - - Parent span-Id tag name. - - - Version tag name. - - - Sampled tag name. - - - Tracestate tag name. - - - Default version value. - - - - Default sampled flag value: may be recorded, not requested. - - - - Recorded and requested sampled flag value. - - - Requested trace flag. - - - Legacy root Id tag name. - - - Legacy root Id tag name. - - - - Constructor. - - - - - Set of suppress telemetry tracking if you add Host name on this. - - - - - Initializes telemetry item. - - Telemetry item. - - - - ITelemetryActivator is an interface. - - - - - Initialize is initialize the telemetry client. - - - - - A stub of . - - - - - Initializes a new instance of the class. - - - - - Gets or sets a value indicating whether this channel is in developer mode. - - - - - Gets or sets a value indicating the channel's URI. To this URI the telemetry is expected to be sent. - - - - - Gets or sets a value indicating whether to throw an error. - - - - - Gets or sets the callback invoked by the method. - - - - - Gets or sets the callback invoked by the method. - - - - - Gets or sets the callback invoked by the method. - - - - - Implements the method by invoking the callback. - - - - - Implements the method. - - - - - Implements the method. - - - - - TelemetryActivator initializes Distributed Tracing. This class only works for netstandard2.0. - - - - - Constructor for initializing Distributed Tracing. - - DurableTask options. - Name resolver used for environment variables. - - - - OnSend is an action that enable to hook of sending telemetry. - You can use this property for testing. - - - - - Initialize is initialize the telemetry client. - - - - - TraceContextBase extension methods. - - - - - Create RequestTelemetry from the TraceContext. - - TraceContext. - Site name. - RequestTelemetry. - - - - Create DependencyTelemetry from the Activity. - - TraceContext. - DependencyTelemetry. - - - - Represents a traceParent that is defined W3C TraceContext. - - - - - Gets or sets the Version of the traceParent. - - - - - Gets or sets the TraceId of the traceParent. - - - - - Gets or sets the SpanId of the traceParent. - - - - - Gets or sets the TraceFlags of the traceParent. - - - - - Convert a traceParent string to TraceParent object. - - string representations of traceParent. - TraceParent object. - - - - Provides information about the enviroment (OS, app service plan, user-facing PL) - using the DI-injected INameResolver. - - - - - Attribute used with the Durable Functions Analyzer to label a method as Deterministic. This allows the method to be called in an Orchestration function without causing a compiler warning. - - - - - The backend storage provider that provides the actual durability of Durable Functions. - This is functionally a superset of and . - If the storage provider does not any of the Durable Functions specific operations, they can use this class - directly with the expectation that only those interfaces will be implemented. All of the Durable Functions specific - methods/operations are virtual and can be overwritten by creating a subclass. - - - - - Creates the default . - - The name of the storage backend providing the durability. - The internal that provides functionality - for this classes implementions of . - The internal that provides functionality - for this classes implementions of . - The name of the app setting that stores connection details for the storage provider. - - - - The name of the environment variable that contains connection details for how to connect to storage providers. - Corresponds to the for binding data. - - - - - Specifies whether the durability provider supports Durable Entities. - - - - - Specifies whether the backend's WaitForOrchestration is implemented without polling. - - - - - Specifies whether this backend delivers messages in order. - - - - - JSON representation of configuration to emit in telemetry. - - - - - Value of maximum durable timer delay. Used for long running durable timers. - - - - - Interval time used for long running timers. - - - - - Event source name (e.g. DurableTask-AzureStorage). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gets the status of all orchestration instances. - - A token to cancel the request. - Returns a task which completes when the status has been fetched. - - - - Gets the status of all orchestration instances within the specified parameters. - - Return orchestration instances which were created after this DateTime. - Return orchestration instances which were created before this DateTime. - Return orchestration instances which matches the runtimeStatus. - A token to cancel the request. - Returns a task which completes when the status has been fetched. - - - - Gets the state of the specified orchestration instance. - - The ID of the orchestration instance to query. - If set, fetch and return the input for the orchestration instance. - Returns a task which completes when the state has been fetched. - - - - Gets paginated result of all orchestration instances that match query status parameters. - - The filtering conditions of the query. - A token to cancel the request. - Paginated result of orchestration state. - - - - Purges history that meet the required parameters. - - Purge the history of orchestration instances which were created after this DateTime. - Purge the history of orchestration instances which were created before this DateTime. - Purge the history of orchestration instances which matches the runtimeStatus. - The number of instances purged. - - - - Purges the instance history for the provided instance id. - - The instance id for the instance history to purge. - The number of instances purged. - - - - Retrieves the state for a serialized entity. - - Entity id to fetch state for. - JsonSerializerSettings for custom deserialization. - State for the entity. - - - - Rewinds the specified failed orchestration instance with a reason. - - The ID of the orchestration instance to rewind. - The reason for rewinding the orchestration instance. - A task that completes when the rewind message is enqueued. - - - - Makes the current app the primary app, if it isn't already. Must be using the AppLease feature. - - A task that completes when the operation has started. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Uses durability provider specific logic to verify whether a timespan for a timer, timeout - or retry interval is allowed by the provider. - - The timespan that the code will have to wait for. - The error message if the timespan is invalid. - A boolean indicating whether the time interval is valid. - - - - Returns true if the stored connection string, ConnectionName, matches the input DurabilityProvider ConnectionName. - - The DurabilityProvider used to check for matching connection string names. - A boolean indicating whether the connection names match. - - - - Tries to obtain a scale monitor for autoscaling. - - Function id. - Function name. - Task hub name. - The name of the storage-specific connection settings. - The scale monitor. - True if autoscaling is supported, false otherwise. - - - - Attribute used to bind a function parameter to a , , or instance. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - Options to configure the IDurableClient created. - - - - Optional. Gets or sets the name of the task hub in which the orchestration data lives. - - The task hub used by this binding. - - The default behavior is to use the task hub name specified in . - If no value exists there, then a default value will be used. - - - - - Optional. Gets or sets the setting name for the app setting containing connection details used by this binding to connect - to instances of the storage provider other than the default one this application communicates with. - - The name of an app setting containing connection details. - - For Azure Storage the default behavior is to use the value of . - If no value exists there, then the default behavior is to use the standard `AzureWebJobsStorage` connection string for all storage usage. - - - - - Indicate if the client is External from the azure function where orchestrator functions are hosted. - - - - - Returns a hash code for this attribute. - - A hash code for this attribute. - - - - Compares two instances for value equality. - - The object to compare with. - true if the two attributes have the same configuration; otherwise false. - - - - Compares two instances for value equality. - - The object to compare with. - true if the two attributes have the same configuration; otherwise false. - - - - Represents the status of a durable entity instance. - - - - - Gets the EntityId of the queried entity instance. - - - The unique EntityId of the instance. - - - - - Gets the time of the last operation processed by the entity instance. - - - The last operation time in UTC. - - - - - Gets the state of the entity instance. - - - The state as either a JToken or null if no state was provided. - - - - - Request used to make an HTTP call through Durable Functions. - - - - - Initializes a new instance of the class. - - Method used for HTTP request. - Uri used to make the HTTP request. - Headers added to the HTTP request. - Content added to the body of the HTTP request. - AAD authentication attached to the HTTP request. - Specifies whether the DurableHttpRequest should handle the asynchronous pattern. - TimeSpan used for HTTP request timeout. - Retry options used for the HTTP request. - - - - HttpMethod used in the HTTP request made by the Durable Function. - - - - - Uri used in the HTTP request made by the Durable Function. - - - - - Headers passed with the HTTP request made by the Durable Function. - - - - - Content passed with the HTTP request made by the Durable Function. - - - - - Mechanism for attaching an OAuth token to the request. - - - - - Specifies whether the Durable HTTP APIs should automatically - handle the asynchronous HTTP pattern. - - - - - Defines retry policy for handling of failures in making the HTTP Request. These could be non-successful HTTP status codes - in the response, a timeout in making the HTTP call, or an exception raised from the HTTP Client library. - - - - - The total timeout for the original HTTP request and any - asynchronous polling. - - - - - Response received from the HTTP request made by the Durable Function. - - - - - Initializes a new instance of the class. - - HTTP Status code returned from the HTTP call. - Headers returned from the HTTP call. - Content returned from the HTTP call. - - - - Status code returned from an HTTP request. - - - - - Headers in the response from an HTTP request. - - - - - Content returned from an HTTP request. - - - - - Creates a DurableHttpResponse from an HttpResponseMessage. - - HttpResponseMessage returned from the HTTP call. - A representing the result of the asynchronous operation. - - - - Represents the status of a durable orchestration instance. - - - An external client can fetch the status of an orchestration instance using - . - - - - - Gets the name of the queried orchestrator function. - - - The orchestrator function name. - - - - - Gets the ID of the queried orchestration instance. - - - The instance ID is generated and fixed when the orchestrator function is scheduled. It can be either - auto-generated, in which case it is formatted as a GUID, or it can be user-specified with any format. - - - The unique ID of the instance. - - - - - Gets the time at which the orchestration instance was created. - - - If the orchestration instance is in the - status, this time represents the time at which the orchestration instance was scheduled. - - - The instance creation time in UTC. - - - - - Gets the time at which the orchestration instance last updated its execution history. - - - The last-updated time in UTC. - - - - - Gets the input of the orchestrator function instance. - - - The input as either a JToken or null if no input was provided. - - - - - Gets the output of the queried orchestration instance. - - - The output as either a JToken object or null if it has not yet completed. - - - - - Gets the runtime status of the queried orchestration instance. - - - Expected values include `Running`, `Pending`, `Failed`, `Canceled`, `Terminated`, `Completed`. - - - - - Gets the custom status payload (if any) that was set by the orchestrator function. - - - Orchestrator functions can set a custom status using . - - - The custom status as either a JToken object or null if no custom status has been set. - - - - - Gets the execution history of the orchestration instance. - - - The history log can be large and is therefore null by default. - It is populated only when explicitly requested in the call to - . - - - The output as a JArray object or null. - - - - - Configuration for the Durable Functions extension. - - - - - Initializes a new instance of the . - - The configuration options for this extension. - The logger factory used for extension-specific logging and orchestration tracking. - The name resolver to use for looking up application settings. - The factories used to create orchestration service based on the configured storage provider. - The HTTP message handler that handles HTTP requests and HTTP responses. - The host shutdown notification service for detecting and reacting to host shutdowns. - The lifecycle notification helper used for custom orchestration tracking. - The factory used to create for message settings. - The factory used to create for error settings. - Provides webhook urls for HTTP management APIs. - The activator of DistributedTracing. .netstandard2.0 only. - The platform information provider to inspect the OS, app service plan, and other enviroment information. - - - - Internal initialization call from the WebJobs host. - - Extension context provided by WebJobs. - - - - Initializes the logging service for App Service if it detects that we are running in - the linux platform. - - - - - - - - Deletes all data stored in the current task hub. - - A task representing the async delete operation. - - - - Called by the Durable Task Framework: Not used. - - This parameter is not used. - - - - Called by the Durable Task Framework: Returns the specified . - - The name of the orchestration to return. - Not used. - An orchestration shim that delegates execution to an orchestrator function. - - - - Called by the durable task framework: Not used. - - This parameter is not used. - - - - Called by the Durable Task Framework: Returns the specified . - - The name of the activity to return. - Not used. - An activity shim that delegates execution to an activity function. - - - - This DTFx activity middleware allows us to add context to the activity function shim - before it actually starts running. - - A property bag containing useful DTFx context. - The handler for running the next middleware in the pipeline. - - - - This DTFx orchestration middleware allows us to initialize Durable Functions-specific context - and make the execution happen in a way that plays nice with the Azure Functions execution pipeline. - - A property bag containing useful DTFx context. - The handler for running the next middleware in the pipeline. - - - - This DTFx orchestration middleware (for entities) allows us to add context and set state - to the entity shim orchestration before it starts executing the actual entity logic. - - A property bag containing useful DTFx context. - The handler for running the next middleware in the pipeline. - - - - Gets a using configuration from a instance. - - The attribute containing the client configuration parameters. - Returns a instance. The returned instance may be a cached instance. - - - - - - - Tags the current Activity with metadata: DurableFunctionsType, DurableFunctionsInstanceId, DurableFunctionsRuntimeStatus. - This metadata will show up in Application Insights, if enabled. - - - - - A placeholder scale monitor, can be used by durability providers that do not support runtime scaling. - This is required to allow operation of those providers even if runtime scaling is turned off - see discussion https://github.com/Azure/azure-functions-durable-extension/pull/1009/files#r341767018. - - - - - Construct a placeholder scale monitor. - - A descriptive name. - - - - A descriptive name. - - - - - - - - - - - Extension for registering a Durable Functions configuration with JobHostConfiguration. - - - - - Adds the Durable Task extension to the provided . - - The to configure. - Returns the provided . - - - - Adds the Durable Task extension to the provided . - - The to configure. - Populate default configurations of to create Durable Clients. - Returns the provided . - - - - Adds the Durable Task extension to the provided . - - The to configure. - Returns the provided . - - - - Adds the Durable Task extension to the provided . - - The to configure. - The configuration options for this extension. - Returns the provided . - - - - Adds the Durable Task extension to the provided . - - The to configure. - An to configure the provided . - Returns the modified object. - - - - Query condition for searching the status of entity instances. - - - - - Return entity instances associated with this entity name. - - - - - Return entity instances which had operations after this DateTime. - - - - - Return entity instances which had operations before this DateTime. - - - - - Number of records per one request. The default value is 100. - - - - - ContinuationToken of the pager. - - - - - Determines whether the query will include the state of the entity. - - - - - Determines whether the results should include recently deleted entities. - - - - - The status of all entity instances with paging for a given query. - - - - - Gets or sets a collection of statuses of entity instances matching the query description. - - A collection of entity instance status values. - - - - Gets or sets a token that can be used to resume the query with data not already returned by this query. - - A server-generated continuation token or null if there are no further continuations. - - - - Statically accessible context for entity operations. - - - - - The context of the currently executing entity. - - - - - Sets the current context to a mocked context for unit testing. - - The mocked context. - - - - Information about the current status of an operation executing on an entity. - Excludes potentially large data (such as the operation input) so it can be read with low latency. - - - - - The name of the operation. - - - - - The unique identifier for this operation. - - - - - The parent instance that called this operation. - - - - - The UTC time at which the entity started processing this operation. - - - - - A unique identifier for an entity, consisting of entity name and entity key. - - - - - Create an entity id for an entity. - - The name of this class of entities. - The entity key. - - - - The name for this class of entities. - - - - - The entity key. Uniquely identifies an entity among all entities of the same name. - - - - - - - - - - - - - - - - - - - - Determines event names to use for messages sent to and from entities. - - - - - Exception used to describe various issues encountered by the entity scheduler. - - - - - Initializes a new instance of the class. - - - - - Initializes an new instance of the class. - - The message that describes the error. - The exception that was caught. - - - - Initializes a new instance of the class with serialized data. - - The System.Runtime.Serialization.SerializationInfo that holds the serialized object data about the exception being thrown. - The System.Runtime.Serialization.StreamingContext that contains contextual information about the source or destination. - - - - The response returned by . - - The JSON-serializable type of the entity. - - - - Whether this entity exists or not. - - - - - The current state of the entity, if it exists, or default() otherwise. - - - - - Information about the current status of an entity. Excludes potentially large data - (such as the entity state, or the contents of the queue) so it can always be read with low latency. - - - - - Whether this entity exists or not. - - - - - The size of the queue, i.e. the number of operations that are waiting for the current operation to complete. - - - - - The instance id of the orchestration that currently holds the lock of this entity. - - - - - The operation that is currently executing on this entity. - - - - - The exception that is thrown when application code violates the locking rules. - - - - - provides message ordering and deduplication of request messages (operations or lock requests) - that are sent to entities, from other entities, or from orchestrations. - - - - - Used for testing purposes. - - - - - Called on the sending side, to fill in timestamp and predecessor fields. - - - - - Called on the receiving side, to reorder and deduplicate within the window. - - - - - Exception result representing an operation that failed, in case - the original exception is not serializable, or out-of-proc. - - - - - Initializes a new instance of the class. - - - - - Initializes an new instance of the class. - - The message that describes the error. - - - - Initializes a new instance of the class with serialized data. - - The System.Runtime.Serialization.SerializationInfo that holds the serialized object data about the exception being thrown. - The System.Runtime.Serialization.StreamingContext that contains contextual information about the source or destination. - - - - Provides the base implementation for the entity proxy. - - - - - Create an entity proxy. - - context. - Entity id. - - - - Call entity function. - - The name of the operation. - The input for the operation. - A representing the result of the asynchronous operation. - - - - Call entity function. - - The return type of the called entity function. - The name of the operation. - The input for the operation. - A representing the result of the asynchronous operation. - - - - Signal entity function. - - The name of the operation. - The input for the operation. - - - - Abstract entity proxy context. - - - - - Call entity function. - - Entity id. - Entity operation name. - Entity input value. - A representing the result of the asynchronous operation. - - - - Call entity function. - - Result type. - Entity id. - Entity operation name. - Entity input value. - A representing the result of the asynchronous operation. - - - - Signal entity function. - - Entity id. - Entity operation name. - Entity input value. - - - - A message sent to an entity, such as operation, signal, lock, release, or continue messages. - - - - - The name of the operation being called (if this is an operation message) or null - (if this is a lock request). - - - - - Whether or not this is a one-way message. - - - - - The operation input. - - - - - A unique identifier for this operation. - - - - - The parent instance that called this operation. - - - - - The parent instance that called this operation. - - - - - Optionally, a scheduled time at which to start the operation. - - - - - A timestamp for this request. - Used for duplicate filtering and in-order delivery. - - - - - A timestamp for the predecessor request in the stream, or DateTime.MinValue if none. - Used for duplicate filtering and in-order delivery. - - - - - For lock requests, the set of locks being acquired. Is sorted, - contains at least one element, and has no repetitions. - - - - - For lock requests involving multiple locks, the message number. - - - - - The persisted state of an entity scheduler, as handed forward between ContinueAsNew instances. - - - - - Whether this entity exists or not. - - - - - The last serialized entity state. - - - - - The queue of waiting operations, or null if none. - - - - - The instance id of the orchestration that currently holds the lock of this entity. - - - - - Whether processing on this entity is currently suspended. - - - - - The metadata used for reordering and deduplication of messages sent to entities. - - - - - ETW Event Provider for the WebJobs.Extensions.DurableTask extension. - - - - - An EventSource Listener. It sets up a callback for internal EventSource events - that we use to capture their data and log it in Linux App Service plans. - - - - - Create an EventSourceListener to capture and log Durable EventSource - data in Linux. - - A LinuxAppService logger configured for the current linux host. - If true, durableTask.Core verbose logs are enabled. The opposite if false. - A tracing client to log exceptions. - The durability provider's event source name. - - - - Gets called for every EventSource in the process, this method allows us to determine - if the listener will subscribe to a particular EventSource provider. - We only listen to DurableTask and DurableTask-Extension EventSource providers. - - An instance of EventSource. - - - - Gets called after every EventSource event. We capture that event's data and log it - using the appropiate strategy for the current linux host. - - The EventSource event data, for logging. - - - - The exception that is thrown when a sub-orchestrator or activity function fails - with an error. - - - The `InnerException` property of this instance will contain additional information - about the failed sub-orchestrator or activity function. - - - - - Initializes a new instance of a . - - A message describing where to look for more details. - - - - Initializes a new instance of a . - - A message describing where to look for more details. - The exception that caused the function to fail. - - - - The name of a durable function. - - - - - Initializes a new instance of the struct. - - The name of the function. - - - - Gets the name of the function without the version. - - - The name of the activity function without the version. - - - - - Compares two objects for equality. - - The first to compare. - The second to compare. - true if the two objects are equal; otherwise false. - - - - Compares two objects for inequality. - - The first to compare. - The second to compare. - true if the two objects are not equal; otherwise false. - - - - Gets a value indicating whether to objects - are equal using value semantics. - - The other object to compare to. - true if the two objects are equal using value semantics; otherwise false. - - - - Gets a value indicating whether to objects - are equal using value semantics. - - The other object to compare to. - true if the two objects are equal using value semantics; otherwise false. - - - - Calculates a hash code value for the current instance. - - A 32-bit hash code value. - - - - Gets the string value of the current instance. - - The name and optional version of the current instance. - - - - The type of a function. - - - - - Class for creating deterministic . - - - - - Data structure containing orchestration instance creation HTTP endpoints. - - - - - Gets the HTTP POST orchestration instance creation endpoint URL. - - - The HTTP URL for creating a new orchestration instance. - - - - - Gets the HTTP POST orchestration instance create-and-wait endpoint URL. - - - The HTTP URL for creating a new orchestration instance and waiting on its completion. - - - - - Data structure containing status, terminate and send external event HTTP endpoints. - - - - - Gets the ID of the orchestration instance. - - - The ID of the orchestration instance. - - - - - Gets the HTTP GET status query endpoint URL. - - - The HTTP URL for fetching the instance status. - - - - - Gets the HTTP POST external event sending endpoint URL. - - - The HTTP URL for posting external event notifications. - - - - - Gets the HTTP POST instance termination endpoint. - - - The HTTP URL for posting instance termination commands. - - - - - Gets the HTTP POST instance rewind endpoint. - - - The HTTP URL for rewinding orchestration instances. - - - - - Gets the HTTP DELETE purge instance history by instance ID endpoint. - - - The HTTP URL for purging instance history by instance ID. - - - - - Gets the HTTP POST instance restart endpoint. - - - The HTTP URL for restarting an orchestration instance. - - - - - Defines retry policies that can be passed as parameters to various operations. - - - - - Creates a new instance SerializableRetryOptions with the supplied first retry and max attempts. - - Timespan to wait for the first retry. - Max number of attempts to retry. - - The value must be greater than . - - - - - Gets or sets the first retry interval. - - - The TimeSpan to wait for the first retries. - - - - - Gets or sets the max retry interval. - - - The TimeSpan of the max retry interval, defaults to 6 days. - - - - - Gets or sets the backoff coefficient. - - - The backoff coefficient used to determine rate of increase of backoff. Defaults to 1. - - - - - Gets or sets the timeout for retries. - - - The TimeSpan timeout for retries, defaults to . - - - - - Gets or sets the max number of attempts. - - - The maximum number of retry attempts. - - - - - Gets or sets the list of status codes upon which the - retry logic specified by this object shall be triggered. - If none are provided, all 4xx and 5xx status codes - will be retried. - - - - - Custom service interface for signaling the extension when the function app is starting up or shutting down. - - - This interface is expected to be used as an injected service. We use a "wrapper" interface instead of - directly using the "real" IApplicationLifetime interface so that we can have an injected service - that is available in both .NET Core (Functions 2.0+) and .NET Framework (Functions 1.0). - - - - - Gets a that can be used to detect function app startup events. - - - A that is signalled when the function app has started up. - - - - - Gets a that can be used to detect function app stopping events. - - - A that is signalled when the function app is beginning to shut down. - - - - - Gets a that can be used to detect function app shutdown events. - - - A that is signalled when the function app has completed shutting down. - - - - - Interface defining methods to resolve connection information. - - - - - Attempts to resolve the connection info given a name. - - - Depending on the configuration, the value may either be a connection string in the - property, or a user-defined type made - up of one or more key-value pairs. - - The name of the connection information. - The resolved connection information. - - - - Interface defining methods to resolve connection strings. - - - - - Looks up a connection string value given a name. - - The name of the connection string. - Returns the resolved connection string value. - - - - Interface defining methods to build instances of . - - - - - Specifies the Durability Provider Factory name. - - - - - Creates or retrieves a durability provider to be used throughout the extension. - - An durability provider to be used by the Durable Task Extension. - - - - Creates or retrieves a cached durability provider to be used in a given function execution. - - A durable client attribute with parameters for the durability provider. - A durability provider to be used by a client function. - - - - Interface used for testing Durable HTTP. - - - - - Creates an HttpClientHandler and returns it. - - Returns an HttpClientHandler. - - - - Interface defining methods to build instances of for error serialization. - - - - - Creates or retrieves to be used throughout the extension for error serialization. - - to be used by the Durable Task Extension for error serialization. - - - - Interface defining methods to life cycle notifications. - - - - - The orchestrator was starting. - - The name of the task hub. - The name of the orchestrator function to call. - The ID to use for the orchestration instance. - The orchestrator function is currently replaying itself. - A task that completes when the lifecycle notification message has been sent. - - - - The orchestrator was completed. - - The name of the task hub. - The name of the orchestrator function to call. - The ID to use for the orchestration instance. - The orchestration completed with ContinueAsNew as is in the process of restarting. - The orchestrator function is currently replaying itself. - A task that completes when the lifecycle notification message has been sent. - - - - The orchestrator was failed. - - The name of the task hub. - The name of the orchestrator function to call. - The ID to use for the orchestration instance. - Additional data associated with the tracking event. - The orchestrator function is currently replaying itself. - A task that completes when the lifecycle notification message has been sent. - - - - The orchestrator was terminated. - - The name of the task hub. - The name of the orchestrator function to call. - The ID to use for the orchestration instance. - Additional data associated with the tracking event. - A task that completes when the lifecycle notification message has been sent. - - - - Interface defining methods to build instances of for message serialization. - - - - - Creates or retrieves to be used throughout the extension for message serialization. - - to be used by the Durable Task Extension for message serialization. - - - - Representation of the supported Operating Systems. - - - - - Linux OS. - - - - - Windows OS - - - - - Representation of supported Programming Languages. - - - - - .NET in-process. - - - - - .NET out-of-process. - - - - - Python. - - - - - Node: either JavaScript and TypeScript. - - - - - PowerShell. - - - - - Java. - - - - - Unknown worker runtime. - - - - - Interface for accessing the AppService plan information, - the OS, and user-facing PL. - - Note: The functionality is currently limited, but will grow - along with the pursuit of more platform-specific defaults. - - - - - Determine the underlying plan is Consumption or not. - - True if the plan is Consumption. Otherwise, False. - - - - Determine the underlying operating system. - - An OperatingSystem enum. - - - - Determine the underlying worker runtime. - - A WorkerRuntimeType enum. - - - - Returns the application tenant when running on linux. - - The application tenant. - - - - Returns the application stamp name when running on linux. - - The application stamp name. - - - - Returns the application container name when running on linux. - - The application container name. - - - - Defines methods for retrieving Azure Storage account metadata. - - - - - Gets the associated with the . - - The name associated with the connection information. - The corresponding . - - - - Implementations of this interface can be used to provide authorization tokens for outbound HTTP requests. - - - - - Gets a token for a resource. - - A representing the result of the asynchronous operation. - - - - The File logger for linux dedicated. Manages file rolling and is concurrency-safe. - This is copied over from the azure-funtions-host codebase here: - https://github.com/Azure/azure-functions-host/blob/35cf323fa3464a08b410a518bcab006e801301fe/src/WebJobs.Script.WebHost/Diagnostics/LinuxAppServiceFileLogger.cs - We have modified their implementation to utilize syscall.rename instead of File.Move during file rolling. - This change is necessary for older versions of fluent-bit, our logging infrastructure in linux dedicated, to properly deal with logfile archiving. - - - - - The File logger for linux dedicated. Manages file rolling and is concurrency-safe. - - Name of target logfile. - Directory of target logfile. - Whether or not to start monitoring the write buffer at initialization time. - - - - Log a string. - - Message to log. - - - - Flushes the write buffer, stops writing to logfile afterwards. - - Timeout in milliseconds for flushing task. - - - - In charge of logging services for our linux App Service offerings: Consumption and Dedicated. - In Consumption, we log to the console and identify our log by a prefix. - In Dedicated, we log asynchronously to a pre-defined logging path. - This class is utilized by EventSourceListener to write logs corresponding to - specific EventSource providers. - - - - - Create a LinuxAppServiceLogger instance. - - If true, write to console (linux consumption) else to a file (dedicated). - The app's container name. - The app's tenant. - The app's stamp. - - - - Given EventSource message data, we generate a JSON-string that we can log. - - An EventSource message, usually generated by an EventListener. - A JSON-formatted string representing the input. - - - - Log EventSource message data in Linux AppService. - - An EventSource message, usually generated by an EventListener. - - - - The number of partitions in the task hub. - - - - - The number of messages across control queues. This will - be in the form of a serialized array of ints, e.g. "[1,2,3,4]". - - - - - The latency of messages across control queues. This will - be in the form of a serialized array of TimeSpans in string - format, e.g. "["00:00:00.0010000","00:00:00.0020000","00:00:00.0030000","00:00:00.0040000"]". - - - - - The number of messages in the work-item queue. - - - - - The approximate age of the first work-item queue message. This - will be a TimeSpan in string format, e.g. "00:00:00.0010000". - - - - - Not intended for public consumption. - - - - - Initializes a new instance of the class. - - The orchestration execution context. - - - - Identifiers for each OOProc Schema Version. - - - - - Invokes a DF API based on the input action object. - - An OOProc action object representing a DF task. - The schema version. - If the API returns a task, the DF task corresponding to the input action. Else, null. - - - - Replays the orchestration execution from an OOProc SDK in .NET. - - The OOProc actions payload. - The schema version. - An awaitable Task that completes once replay completes. - - - - Replays the OOProc orchestration based on the actions array. It uses the schema enum to - determine which replay implementation is most appropiate. - - The OOProc actions payload. - The OOProc protocol schema version. - An awaitable Task that completes once replay completes. - - - - Task activity implementation which delegates the implementation to a function. - - - - - The DTFx-generated, auto-incrementing ID that uniquely identifies this activity function execution. - - - - - Common functionality of and . - - - - - Implements the entity scheduler as a looping orchestration. - There is one such orchestration per entity. - The orchestration terminates if the entity is deleted and idle. - The orchestration calls ContinueAsNew when it is idle, but not deleted. - - - - - The results of executing a batch of operations on the entity out of process. - - - - - Whether the entity exists after executing the batch. - This is false if the last operation in the batch deletes the entity, - and true otherwise. - - - - - The state of the entity after executing the batch. - Should be null if is false. - - - - - The results of executing the operations. The length of this list must always match - the size of the batch, even if there were exceptions. - - - - - The list of signals sent by the entity. Can be empty. - - - - - The results of executing an operation. - - - - - The returned value or error/exception. - - - - - Determines whether is a normal result, or an error/exception. - - - - - The measured duration of this operation's execution, in milliseconds. - - - - - Describes a signal that was emitted by one of the operations in the batch. - - - - - The destination of the signal. - - - - - The name of the operation being signaled. - - - - - The input of the operation being signaled. - - - - - Task orchestration implementation which delegates the orchestration implementation to a function. - - - - - Configuration options for Managed Identity. - - - - - Initializes a new instance of the class. - - The host of the Azure Active Directory authority. - The tenant id of the user to authenticate. - - - - The host of the Azure Active Directory authority. The default is https://login.microsoftonline.com/. - - - - - The tenant id of the user to authenticate. - - - - - Token Source implementation for Azure Managed Identities. - - - - - Initializes a new instance of the class. - - - The Azure Active Directory resource identifier of the web API being invoked. - For example, https://management.core.windows.net/.default or https://graph.microsoft.com/.default. - - Optional Azure credential options to use when authenticating. - - - - Gets the Azure Active Directory resource identifier of the web API being invoked. - For example, https://management.core.windows.net/.default or https://graph.microsoft.com/.default. - - - - - The azure credential options that a user can configure when authenticating. - - - - - - - - JSON-serializes the specified object. - - - - - JSON-serializes the specified object and throws a if the - resulting JSON exceeds the maximum size specified by . - - - - - Options used to bind a function parameter to a , , or instance. - - - - - Optional. Gets or sets the setting name for the app setting containing connection details used by this binding to connect - to instances of the storage provider other than the default one this application communicates with. - - The name of an app setting containing connection details. - - For Azure Storage the default behavior is to use the value of . - If no value exists there, then the default behavior is to use the standard `AzureWebJobsStorage` connection string for all storage usage. - - - - - Gets or sets the name of the task hub in which the orchestration data lives. - - The task hub used by this binding. - - The default behavior is to use the task hub name specified in . - If no value exists there, then a default value will be used. - - - - - Indicate if the client is External from the azure function where orchestrator functions are hosted. - - - Default is true. - - - - - Configuration options for the Azure Storage storage provider. - - - - - Gets or sets the name of the Azure Storage connection information used to manage the underlying Azure Storage resources. - - - The value may refer to either a connection string or the configuration section containing connection metadata. - The default behavior is to use the standard AzureWebJobsStorage connection for all storage usage. - - - The name of a connection-related key that exists in the app's application settings. The value may refer to - a connection string or the section detailing additional connection metadata. - - - - - Gets or sets the name of the Azure Storage connection string used to manage the underlying Azure Storage resources. - - - If not specified, the default behavior is to use the standard `AzureWebJobsStorage` connection string for all storage usage. - - The name of a connection string that exists in the app's application settings. - - - - Gets or sets the number of messages to pull from the control queue at a time. - - - Messages pulled from the control queue are buffered in memory until the internal - dispatcher is ready to process them. - - A positive integer configured by the host. The default value is 32. - - - - Gets or sets the partition count for the control queue. - - - Increasing the number of partitions will increase the number of workers - that can concurrently execute orchestrator functions. However, increasing - the partition count can also increase the amount of load placed on the storage - account and on the thread pool if the number of workers is smaller than the - number of partitions. - - A positive integer between 1 and 16. The default value is 4. - - - - Gets or set the number of control queue messages that can be buffered in memory - at a time, at which point the dispatcher will wait before dequeuing any additional - messages. The default is 256. The maximum value is 1000. - - - Increasing this value can improve orchestration throughput by pre-fetching more - orchestration messages from control queues. The downside is that it increases the - possibility of duplicate function executions if partition leases move between app - instances. This most often occurs when the number of app instances changes. - - A non-negative integer between 0 and 1000. The default value is 256. - - - - Gets or sets the visibility timeout of dequeued control queue messages. - - - A TimeSpan configured by the host. The default is 5 minutes. - - - - - Gets or sets the visibility timeout of dequeued work item queue messages. - - - A TimeSpan configured by the host. The default is 5 minutes. - - - - - Gets or sets the name of the Azure Storage connection information to use for the - durable tracking store (History and Instances tables). - - - - If not specified, the connection string is used for the durable tracking store. - - - This property is primarily useful when deploying multiple apps that need to share the same - tracking infrastructure. For example, when deploying two versions of an app side by side, using - the same tracking store allows both versions to save history into the same table, which allows - clients to query for instance status across all versions. - - - - The name of a connection-related key that exists in the app's application settings. The value may refer to - a connection string or the section detailing additional connection metadata. - - - - - Gets or sets the name of the Azure Storage connection string to use for the - durable tracking store (History and Instances tables). - - - If not specified, the connection string - is used for the durable tracking store. - - This property is primarily useful when deploying multiple apps that need to share the same - tracking infrastructure. For example, when deploying two versions of an app side by side, using - the same tracking store allows both versions to save history into the same table, which allows - clients to query for instance status across all versions. - - The name of a connection string that exists in the app's application settings. - - - - Gets or sets the name prefix to use for history and instance tables in Azure Storage. - - - This property is only used when is specified. - If no prefix is specified, the default prefix value is "DurableTask". - - The prefix to use when naming the generated Azure tables. - - - - Gets or sets whether the extension will automatically fetch large messages in orchestration status - queries. If set to false, the extension will return large messages as a blob url. - - A boolean indicating whether will automatically fetch large messages . - - - - Gets or sets the maximum queue polling interval. - - Maximum interval for polling control and work-item queues. - - - - Determines whether or not to use the old partition management strategy, or the new - strategy that is more resilient to split brain problems, at the potential expense - of scale out performance. - - A boolean indicating whether we use the legacy partition strategy. Defaults to false. - - - - Throws an exception if the provided hub name violates any naming conventions for the storage provider. - - - - - Throws an exception if any of the settings of the storage provider are invalid. - - - - - Configuration options for the Durable Task extension. - - - - - Settings used for Durable HTTP functionality. - - - - - Gets or sets default task hub name to be used by all , , , - , and instances. - - - A task hub is a logical grouping of storage resources. Alternate task hub names can be used to isolate - multiple Durable Functions applications from each other, even if they are using the same storage backend. - - The name of the default task hub. - - - - The section of configuration related to storage providers. If using Azure Storage provider, the schema should match - . - - - - - The section of configuration related to tracing. - - - - - The section of configuration related to notifications. - - - - - Gets or sets the maximum number of activity functions that can be processed concurrently on a single host instance. - - - Increasing activity function concurrent can result in increased throughput but can - also increase the total CPU and memory usage on a single worker instance. - - - A positive integer configured by the host. - - - - - Gets or sets the maximum number of orchestrator functions that can be processed concurrently on a single host instance. - - - A positive integer configured by the host. - - - - - Gets or sets a value indicating whether to enable the local RPC endpoint managed by this extension. - - - The local RPC endpoint is intended to allow out-of-process functions to make direct calls into this - extension. This is primarily intended to support instance management APIs used by the durable client - binding. The following values are allowed: - - - null - (Default) The local RPC endpoint is enabled only for non-.NET function apps. - - - true - A local RPC endpoint will be enabled and listen at http://127.0.0.1:17071/durabletask/. - - - false - The local RPC endpoint will be disabled. - - - - - - - Gets or sets the maximum number of entity operations that are processed as a single batch. - - - Reducing this number can help to avoid timeouts on consumption plans. If set to 1, batching is disabled, and each operation - message executes and is billed as a separate function invocation. - - - A positive integer configured by the host. - - - - - Gets or sets a flag indicating whether to enable extended sessions. - - - Extended sessions can improve the performance of orchestrator functions by allowing them to skip - replays when new messages are received within short periods of time. - Note that orchestrator functions which are extended this way will continue to count against the - limit. To avoid starvation, only half of the maximum - number of allowed concurrent orchestrator functions can be concurrently extended at any given time. - The property can also be used to control how long an idle - orchestrator function is allowed to be extended. - It is recommended that this property be set to false during development to help - ensure that the orchestrator code correctly obeys the idempotency rules. - - - true to enable extended sessions; otherwise false. - - - - - Gets or sets the amount of time in seconds before an idle session times out. The default value is 30 seconds. - - - This setting is applicable when is set to true. - - - The number of seconds before an idle session times out. - - - - - Gets or sets the maximum number of orchestration actions. The default value is 100,000. - - - - - States that will override an existing orchestrator when attempting to start a new orchestrator with the same instance Id. - - - - - Gets or sets the time window within which entity messages get deduplicated and reordered. - - - - - Preview setting for gracefully shutting down to prevent WebJob shutdowns from failing - activities or orchestrations. - - - - - Controls whether an uncaught exception inside an entity operation should roll back the effects of the operation. - - - The rollback undoes all internal effects of an operation - (sent signals, and state creation, deletion, or modification). - However, it does not roll back external effects (such as I/O that was performed). - This setting can affect serialization overhead: if true, the entity state is serialized - after each individual operation. If false, the entity state is serialized - only after an entire batch of operations completes. - - - - - If true, takes a lease on the task hub container, allowing for only one app to process messages in a task hub at a time. - - - - - If UseAppLease is true, gets or sets the AppLeaaseOptions used for acquiring the lease to start the application. - - - - - Sets HubName to a value that is considered a default value. - - TaskHub name that is considered the default. - - - - Configuration of the Event Grid notification options - for the Durable Task Extension. - - - - - Gets or sets the URL of an Azure Event Grid custom topic endpoint. - When set, orchestration life cycle notification events will be automatically - published to this endpoint. - - - Azure Event Grid topic URLs are generally expected to be in the form - https://{topic_name}.{region}.eventgrid.azure.net/api/events. - - - The Azure Event Grid custom topic URL. - - - - - Gets or sets the name of the app setting containing the key used for authenticating with the Azure Event Grid custom topic at . - - - The name of the app setting that stores the Azure Event Grid key. - - - - - Gets or sets the Event Grid publish request retry count. - - The number of retry attempts. - - - - Gets orsets the Event Grid publish request retry interval. - - A representing the retry interval. The default value is 5 minutes. - - - - Gets or sets the Event Grid publish request http status. - - A list of HTTP status codes, e.g. 400, 403. - - - - Gets or sets the event types that will be published to Event Grid. - - - A list of strings. Possible values 'Started', 'Completed', 'Failed', 'Terminated'. - - - - - Used for Durable HTTP functionality. - - - - - Reserved name to know when a TaskActivity should be an HTTP activity. - - - - - Gets or sets the default number of milliseconds between async HTTP status poll requests. - - - - - Configuration of the notification options - for the Durable Task Extension. - - - - - The section of configuration related to Event Grid notifications. - - - - - Configuration of the trace options - for the Durable Task Extension. - - - - - Gets or sets a value indicating whether to trace the inputs and outputs of function calls. - - - The default behavior when tracing function execution events is to include the number of bytes in the serialized - inputs and outputs for function calls. This provides minimal information about what the inputs and outputs look - like without bloating the logs or inadvertently exposing sensitive information to the logs. Setting - to true will instead cause the default function logging to log - the entire contents of function inputs and outputs. - - - true to trace the raw values of inputs and outputs; otherwise false. - - - - - Gets or sets if Azure linux telemetry should include verbose logs. - - - The default behaviour is false, which disables verbose logs. When set - to true, performance may be affected due to the amount of verbose logs. - We recommend setting this to true primarily for debugging purposes. - - true to enable verbose telemetry; false otherwise. - - - - - - Gets or sets if logs for replay events need to be recorded. - - - The default value is false, which disables the logging of replay events. - - - Boolean value specifying if the replay events should be logged. - - - - - Gets or sets a flag indicating whether to enable distributed tracing. - The default value is false. - - - - - Gets or sets a protocol for distributed Tracing. - Possible values are "HttpCorrelationProtocol" and "W3CTraceContext". - The default value is "HttpCorrelationProtocol". - - - - - Deprecated attribute to bind a function parameter to a . - Here for backwards compatibility. Please use the instead. - - - - - Represents the possible runtime execution status values for an orchestration instance. - - - - - The status of the orchestration could not be determined. - - - - - The orchestration is running (it may be actively running or waiting for input). - - - - - The orchestration ran to completion. - - - - - The orchestration completed with ContinueAsNew as is in the process of restarting. - - - - - The orchestration failed with an error. - - - - - The orchestration was canceled. - - - - - The orchestration was terminated via an API call. - - - - - The orchestration was scheduled but has not yet started. - - - - - Query condition for searching the status of orchestration instances. - - - - - Initializes a new instance of the class. - - - - - Return orchestration instances which matches the runtimeStatus. - - - - - Return orchestration instances which were created after this DateTime. - - - - - Return orchestration instances which were created before this DateTime. - - - - - Return orchestration instances which matches the TaskHubNames. - - - - - Maximum number of records that can be returned by the request. The default value is 100. - - - Requests may return fewer records than the specified page size, even if there are more records. - Always check the continuation token to determine whether there are more records. - - - - - ContinuationToken of the pager. - - - - - Return orchestration instances that have this instance id prefix. - - - - - Determines whether the query will include the input of the orchestration. - - - - - The status of all orchestration instances with paging for a given query. - - - - - Gets or sets a collection of statuses of orchestration instances matching the query description. - - A collection of orchestration instance status values. - - - - Gets or sets a token that can be used to resume the query with data not already returned by this query. - - A server-generated continuation token or null if there are no further continuations. - - - - Durable Task Framework orchestration middleware that invokes an out-of-process orchestrator function. - - This middleware context provided by the framework that contains information about the orchestration. - The next middleware handler in the pipeline. - Thrown if there's an internal failure in the middleware. - Thrown if there is a recoverable error in the Functions runtime that's expected to be handled gracefully. - - - - Durable Task Framework activity middleware that invokes an out-of-process orchestrator function. - - This middleware context provided by the framework that contains information about the activity. - The next middleware handler in the pipeline. - Thrown if there is a recoverable error in the Functions runtime that's expected to be handled gracefully. - - - - Represents the out-of-proc protocols supported by this extension. - - - - - Out-of-proc works by replaying SDK actions in an orchestration "shim", which interprets - the output of an out-of-proc language SDK and makes DTFx API calls on behalf of the - out-of-process orchestrator. - - - This protocol has been deprecated. All new language SDK should instead use - . - - - - - Out-of-proc works by forwarding all outputs directly to the Durable Task Framework - without using any orchestrator "shims" or attemping any interpretation. This is - sometimes referred to as "out of proc v2". - - - - - Represents options for different states that an existing orchestrator can be in to be able to be overwritten by - an attempt to start a new instance with the same instance Id. - - - - - Option to start a new orchestrator instance with an existing instnace Id when the existing - instance is in any state. - - - - - Option to only start a new orchestrator instance with an existing instance Id when the existing - instance is in a terminated, failed, or completed state. - - - - - Provides access to internal functionality for the purpose of implementing durability providers. - - - - - Returns the instance id of the entity scheduler for a given entity id. - - The entity id. - The instance id of the scheduler. - - - - Reads the state of an entity from the serialized entity scheduler state. - - The orchestration state of the scheduler. - The serializer settings. - The serialized state of the entity. - true if the entity exists, false otherwise. - - - - Converts the DTFx representation of the orchestration state into the DF representation. - - The orchestration state. - The orchestration status. - - - - Class to hold statistics about this execution of purge history. - - - - - Constructor for purge history statistics. - - Number of instances deleted. - - - - Gets the number of deleted instances. - - The number of deleted instances. - - - - Defines retry policies that can be passed as parameters to various operations. - - - - - Creates a new instance RetryOptions with the supplied first retry and max attempts. - - Timespan to wait for the first retry. - Max number of attempts to retry. - - The value must be greater than . - - - - - Gets or sets the first retry interval. - - - The TimeSpan to wait for the first retries. - - - - - Gets or sets the max retry interval. - - - The TimeSpan of the max retry interval, defaults to . - - - - - Gets or sets the backoff coefficient. - - - The backoff coefficient used to determine rate of increase of backoff. Defaults to 1. - - - - - Gets or sets the timeout for retries. - - - The TimeSpan timeout for retries, defaults to . - - - - - Gets or sets the max number of attempts. - - - The maximum number of retry attempts. - - - - - Gets or sets a delegate to call on exception to determine if retries should proceed. - - - The delegate to handle exception to determine if retries should proceed. - - - - - Connection info provider which resolves connection information from a standard application (Non WebJob). - - - - - Initializes a new instance of the class. - - A object provided by the application host. - is . - - - - - - - Connection string provider which resolves connection strings from the an standard application (Non WebJob). - - - - - Initializes a new instance of the class. - - A object provided by the application host. - - - - Looks up a connection string value given a name. - - The name of the connection string. - Returns the resolved connection string value. - - - - Parameters for starting a new instance of an orchestration. - - - This class is primarily intended for use with IAsyncCollector<T>. - - - - - Initializes a new instance of the class. - - The name of the orchestrator function to start. - The JSON-serializeable input for the orchestrator function. - - - - Initializes a new instance of the class. - - - - - Gets or sets the name of the orchestrator function to start. - - The name of the orchestrator function to start. - - - - Gets or sets the instance ID to assign to the started orchestration. - - - If this property value is null (the default), then a randomly generated instance ID will be assigned automatically. - - The instance ID to assign. - - - - Gets or sets the JSON-serializeable input data for the orchestrator function. - - JSON-serializeable input value for the orchestrator function. - - - - Response for Orchestration Status Query. - - - - - Name. - - - - - InstanceId. - - - - - Runtime status. - - - - - Input. - - - - - Custom status. - - - - - Output. - - - - - Created time value. - - - - - Last updated time. - - - - - JSON object representing history for an orchestration execution. - - - - - Trigger attribute used for durable activity functions. - - - - - Gets or sets the name of the activity function. - - - The name of the activity function or null to use the function name. - - - - - Trigger attribute used for durable entity functions. - - - - - Gets or sets the name of the entity. - - - If not specified, the function name is used as the name of the entity. - - - The name of the entity or null to use the function name. - - - - - Trigger attribute used for durable orchestrator functions. - - - - - Gets or sets the name of the orchestrator function. - - - If not specified, the function name is used as the name of the orchestration. - - - The name of the orchestrator function or null to use the function name. - - - - - Provides an input binding for the typed client experience that - is generated via the source-generator nuget package. - - - - - Connection info provider which resolves connection information from the WebJobs context. - - - - - Initializes a new instance of the class. - - A object provided by the WebJobs host. - - - - - - - Connection string provider which resolves connection strings from the WebJobs context. - - - - - Initializes a new instance of the class. - - A object provided by the WebJobs host. - - - - - - diff --git a/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj b/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj index 21dbbc153..043713c70 100644 --- a/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj +++ b/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj @@ -20,6 +20,7 @@ embedded NU5125;SA0001 + $(DefineConstants);FUNCTIONS_V2_OR_GREATER;FUNCTIONS_V3_OR_GREATER @@ -46,27 +47,31 @@ true - + + + + - - - - + + + + + - + + - - - - - + + + + diff --git a/test/Common/TestEntityClasses.cs b/test/Common/TestEntityClasses.cs index 665a7f968..6751b439e 100644 --- a/test/Common/TestEntityClasses.cs +++ b/test/Common/TestEntityClasses.cs @@ -9,8 +9,6 @@ using System.Text; using Azure.Storage.Blobs; using Azure.Storage.Blobs.Specialized; -#else -using Microsoft.WindowsAzure.Storage.Blob; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Serialization; diff --git a/test/DFPerfScenarios/DFPerfScenariosV4.csproj b/test/DFPerfScenarios/DFPerfScenariosV4.csproj index acb911c34..6e7ae4fbb 100644 --- a/test/DFPerfScenarios/DFPerfScenariosV4.csproj +++ b/test/DFPerfScenarios/DFPerfScenariosV4.csproj @@ -1,6 +1,6 @@  - net60 + net6.0 v4 diff --git a/test/SmokeTests/OOProcSmokeTests/durableJS/extensions.csproj b/test/SmokeTests/OOProcSmokeTests/durableJS/extensions.csproj index aa1d20318..a96e238d4 100644 --- a/test/SmokeTests/OOProcSmokeTests/durableJS/extensions.csproj +++ b/test/SmokeTests/OOProcSmokeTests/durableJS/extensions.csproj @@ -1,8 +1,8 @@  net6.0 - - ** + + ** diff --git a/test/SmokeTests/OOProcSmokeTests/durableJava/extensions.csproj b/test/SmokeTests/OOProcSmokeTests/durableJava/extensions.csproj index c35a61607..8828cfbd7 100644 --- a/test/SmokeTests/OOProcSmokeTests/durableJava/extensions.csproj +++ b/test/SmokeTests/OOProcSmokeTests/durableJava/extensions.csproj @@ -1,8 +1,8 @@  net6.0 - - ** + + ** diff --git a/test/SmokeTests/OOProcSmokeTests/durablePy/extensions.csproj b/test/SmokeTests/OOProcSmokeTests/durablePy/extensions.csproj index 49d0b92c1..3ca975a39 100644 --- a/test/SmokeTests/OOProcSmokeTests/durablePy/extensions.csproj +++ b/test/SmokeTests/OOProcSmokeTests/durablePy/extensions.csproj @@ -1,8 +1,8 @@  net6.0 - - ** + + ** diff --git a/test/SmokeTests/SmokeTestsV2/Dockerfile b/test/SmokeTests/SmokeTestsV2/Dockerfile deleted file mode 100644 index 5c9d2ea48..000000000 --- a/test/SmokeTests/SmokeTestsV2/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) .NET Foundation. All rights reserved. -# Licensed under the MIT License. See LICENSE in the project root for license information. - -FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env - -# "Install" .NET 2.1 runtime -COPY --from=mcr.microsoft.com/dotnet/sdk:2.1 /usr/share/dotnet/shared /usr/share/dotnet/shared - -# Build the app -COPY . /root -RUN cd /root/test/SmokeTests/SmokeTestsV2 && \ - dotnet build -c Release --framework netstandard2.0 && \ - mkdir -p /home/site/wwwroot && \ - dotnet publish -c Release --no-build --output /home/site/wwwroot - -# Deploy the app -FROM mcr.microsoft.com/azure-functions/dotnet:2.0 -ENV AzureWebJobsScriptRoot=/home/site/wwwroot \ - AzureFunctionsJobHost__Logging__Console__IsEnabled=true -COPY --from=build-env ["/home/site/wwwroot", "/home/site/wwwroot"] diff --git a/test/SmokeTests/SmokeTestsV2/HelloSequence.cs b/test/SmokeTests/SmokeTestsV2/HelloSequence.cs deleted file mode 100644 index 25a8f431d..000000000 --- a/test/SmokeTests/SmokeTestsV2/HelloSequence.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.Azure.WebJobs; -using Microsoft.Azure.WebJobs.Extensions.DurableTask; - -namespace VSSample -{ - public static class HelloSequence - { - [FunctionName("E1_HelloSequence")] - public static async Task> Run( - [OrchestrationTrigger] IDurableOrchestrationContext context) - { - var outputs = new List(); - - outputs.Add(await context.CallActivityAsync("E1_SayHello", "Tokyo")); - outputs.Add(await context.CallActivityAsync("E1_SayHello", "Seattle")); - outputs.Add(await context.CallActivityAsync("E1_SayHello_DirectInput", "London")); - - // returns ["Hello Tokyo!", "Hello Seattle!", "Hello London!"] - return outputs; - } - - [FunctionName("E1_SayHello")] - public static string SayHello([ActivityTrigger] IDurableActivityContext context) - { - string name = context.GetInput(); - return $"Hello {name}!"; - } - - [FunctionName("E1_SayHello_DirectInput")] - public static string SayHelloDirectInput([ActivityTrigger] string name) - { - return $"Hello {name}!"; - } - } - } diff --git a/test/SmokeTests/SmokeTestsV2/HttpStart.cs b/test/SmokeTests/SmokeTestsV2/HttpStart.cs deleted file mode 100644 index f56f78944..000000000 --- a/test/SmokeTests/SmokeTestsV2/HttpStart.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System.Net.Http; -using System.Threading.Tasks; -using Microsoft.Azure.WebJobs; -using Microsoft.Azure.WebJobs.Extensions.DurableTask; -using Microsoft.Azure.WebJobs.Extensions.Http; -using Microsoft.Extensions.Logging; - -namespace VSSample -{ - public static class HttpStart - { - [FunctionName("HttpStart")] - public static async Task Run( - [HttpTrigger(AuthorizationLevel.Anonymous, methods: "post")] HttpRequestMessage req, - [DurableClient] IDurableClient starter, - ILogger log) - { - // Function input comes from the request content. - object eventData = await req.Content.ReadAsAsync(); - string instanceId = await starter.StartNewAsync("E1_HelloSequence", eventData); - - log.LogInformation($"Started orchestration with ID = '{instanceId}'."); - - return starter.CreateCheckStatusResponse(req, instanceId); - } - } -} diff --git a/test/SmokeTests/SmokeTestsV2/VSSampleV2.csproj b/test/SmokeTests/SmokeTestsV2/VSSampleV2.csproj deleted file mode 100644 index 024ccbd1e..000000000 --- a/test/SmokeTests/SmokeTestsV2/VSSampleV2.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - net6.0 - v2 - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - diff --git a/test/SmokeTests/SmokeTestsV2/host.json b/test/SmokeTests/SmokeTestsV2/host.json deleted file mode 100644 index 9013c1ea7..000000000 --- a/test/SmokeTests/SmokeTestsV2/host.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "2.0", - "logging": { - "logLevel": { - "DurableTask.AzureStorage": "Warning", - "DurableTask.Core": "Warning" - }, - "applicationInsights": { - "samplingSettings": { - "isEnabled": false - } - } - }, - "extensions": { - "durableTask": { - "hubName": "DotNetSmokeTestV2" - } - } -} \ No newline at end of file diff --git a/test/SmokeTests/SmokeTestsV2/local.settings.json b/test/SmokeTests/SmokeTestsV2/local.settings.json deleted file mode 100644 index 1eaca38d6..000000000 --- a/test/SmokeTests/SmokeTestsV2/local.settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "IsEncrypted": false, - "Values": { - "FUNCTIONS_WORKER_RUNTIME": "dotnet", - "AzureWebJobsStorage": "UseDevelopmentStorage=true" - } -} diff --git a/test/SmokeTests/SmokeTestsV3/Dockerfile b/test/SmokeTests/SmokeTestsV3/Dockerfile deleted file mode 100644 index 8ebf87008..000000000 --- a/test/SmokeTests/SmokeTestsV3/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) .NET Foundation. All rights reserved. -# Licensed under the MIT License. See LICENSE in the project root for license information. - -FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env - -# Build the app -COPY . /root -RUN cd /root/test/SmokeTests/SmokeTestsV3 && \ - mkdir -p /home/site/wwwroot && \ - dotnet publish -c Release --output /home/site/wwwroot - -# Deploy the app -FROM mcr.microsoft.com/azure-functions/dotnet:3.0 -ENV AzureWebJobsScriptRoot=/home/site/wwwroot \ - AzureFunctionsJobHost__Logging__Console__IsEnabled=true -COPY --from=build-env ["/home/site/wwwroot", "/home/site/wwwroot"] diff --git a/test/SmokeTests/SmokeTestsV3/HelloSequence.cs b/test/SmokeTests/SmokeTestsV3/HelloSequence.cs deleted file mode 100644 index 25a8f431d..000000000 --- a/test/SmokeTests/SmokeTestsV3/HelloSequence.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.Azure.WebJobs; -using Microsoft.Azure.WebJobs.Extensions.DurableTask; - -namespace VSSample -{ - public static class HelloSequence - { - [FunctionName("E1_HelloSequence")] - public static async Task> Run( - [OrchestrationTrigger] IDurableOrchestrationContext context) - { - var outputs = new List(); - - outputs.Add(await context.CallActivityAsync("E1_SayHello", "Tokyo")); - outputs.Add(await context.CallActivityAsync("E1_SayHello", "Seattle")); - outputs.Add(await context.CallActivityAsync("E1_SayHello_DirectInput", "London")); - - // returns ["Hello Tokyo!", "Hello Seattle!", "Hello London!"] - return outputs; - } - - [FunctionName("E1_SayHello")] - public static string SayHello([ActivityTrigger] IDurableActivityContext context) - { - string name = context.GetInput(); - return $"Hello {name}!"; - } - - [FunctionName("E1_SayHello_DirectInput")] - public static string SayHelloDirectInput([ActivityTrigger] string name) - { - return $"Hello {name}!"; - } - } - } diff --git a/test/SmokeTests/SmokeTestsV3/HttpStart.cs b/test/SmokeTests/SmokeTestsV3/HttpStart.cs deleted file mode 100644 index f56f78944..000000000 --- a/test/SmokeTests/SmokeTestsV3/HttpStart.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System.Net.Http; -using System.Threading.Tasks; -using Microsoft.Azure.WebJobs; -using Microsoft.Azure.WebJobs.Extensions.DurableTask; -using Microsoft.Azure.WebJobs.Extensions.Http; -using Microsoft.Extensions.Logging; - -namespace VSSample -{ - public static class HttpStart - { - [FunctionName("HttpStart")] - public static async Task Run( - [HttpTrigger(AuthorizationLevel.Anonymous, methods: "post")] HttpRequestMessage req, - [DurableClient] IDurableClient starter, - ILogger log) - { - // Function input comes from the request content. - object eventData = await req.Content.ReadAsAsync(); - string instanceId = await starter.StartNewAsync("E1_HelloSequence", eventData); - - log.LogInformation($"Started orchestration with ID = '{instanceId}'."); - - return starter.CreateCheckStatusResponse(req, instanceId); - } - } -} diff --git a/test/SmokeTests/SmokeTestsV3/VSSampleV3.csproj b/test/SmokeTests/SmokeTestsV3/VSSampleV3.csproj deleted file mode 100644 index 0381cd963..000000000 --- a/test/SmokeTests/SmokeTestsV3/VSSampleV3.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - net6.0 - v3 - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - diff --git a/test/SmokeTests/SmokeTestsV3/host.json b/test/SmokeTests/SmokeTestsV3/host.json deleted file mode 100644 index 7ef19de4e..000000000 --- a/test/SmokeTests/SmokeTestsV3/host.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "2.0", - "logging": { - "logLevel": { - "DurableTask.AzureStorage": "Warning", - "DurableTask.Core": "Warning" - }, - "applicationInsights": { - "samplingSettings": { - "isEnabled": false - } - } - }, - "extensions": { - "durableTask": { - "hubName": "DotNetSmokeTestV3" - } - } -} \ No newline at end of file diff --git a/test/SmokeTests/SmokeTestsV3/local.settings.json b/test/SmokeTests/SmokeTestsV3/local.settings.json deleted file mode 100644 index 1eaca38d6..000000000 --- a/test/SmokeTests/SmokeTestsV3/local.settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "IsEncrypted": false, - "Values": { - "FUNCTIONS_WORKER_RUNTIME": "dotnet", - "AzureWebJobsStorage": "UseDevelopmentStorage=true" - } -} diff --git a/test/TimeoutTests/CSharp/TimeoutTests.csproj b/test/TimeoutTests/CSharp/TimeoutTests.csproj index e754db3a2..9f1af9517 100644 --- a/test/TimeoutTests/CSharp/TimeoutTests.csproj +++ b/test/TimeoutTests/CSharp/TimeoutTests.csproj @@ -1,7 +1,7 @@  net6.0 - v3 + v4 diff --git a/test/TimeoutTests/Python/extensions.csproj b/test/TimeoutTests/Python/extensions.csproj index dbe31cd06..f80709611 100644 --- a/test/TimeoutTests/Python/extensions.csproj +++ b/test/TimeoutTests/Python/extensions.csproj @@ -1,6 +1,7 @@  net6.0 + v4 ** From 8ae35e838f320b7755abddee7680323a39e91a1e Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Tue, 25 Jun 2024 21:47:24 -0700 Subject: [PATCH 06/19] update sclaeutils.cs --- src/WebJobs.Extensions.DurableTask/Scale/ScaleUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebJobs.Extensions.DurableTask/Scale/ScaleUtils.cs b/src/WebJobs.Extensions.DurableTask/Scale/ScaleUtils.cs index 1b786a715..86620679c 100644 --- a/src/WebJobs.Extensions.DurableTask/Scale/ScaleUtils.cs +++ b/src/WebJobs.Extensions.DurableTask/Scale/ScaleUtils.cs @@ -50,6 +50,7 @@ public NoOpScaleMonitor(string name, string functionId) #pragma warning disable CS0618 // Type or member is obsolete this.Descriptor = new ScaleMonitorDescriptor(name); #pragma warning restore CS0618 // Type or member is obsolete +#endif } /// @@ -69,7 +70,6 @@ ScaleStatus IScaleMonitor.GetScaleStatus(ScaleStatusContext context) throw new InvalidOperationException("The current DurableTask backend configuration does not support runtime scaling"); } } -#endif #if FUNCTIONS_V3_OR_GREATER #pragma warning disable SA1201 // Elements should appear in the correct order From 01b3c4958d7bb272195330c110fbdfcfffbfb186 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Tue, 25 Jun 2024 21:59:09 -0700 Subject: [PATCH 07/19] further update --- WebJobs.Extensions.DurableTask.sln | 10 ---------- test/Common/TestEntityClasses.cs | 1 + .../WebJobs.Extensions.DurableTask.Tests.V2.csproj | 4 ++-- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/WebJobs.Extensions.DurableTask.sln b/WebJobs.Extensions.DurableTask.sln index 353e83805..acf70905b 100644 --- a/WebJobs.Extensions.DurableTask.sln +++ b/WebJobs.Extensions.DurableTask.sln @@ -11,8 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{78BCF152-C EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebJobs.Extensions.DurableTask.Tests.V2", "test\FunctionsV2\WebJobs.Extensions.DurableTask.Tests.V2.csproj", "{F2A5DABB-36D4-4152-AF49-2570149899E1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebJobs.Extensions.DurableTask.Tests.V1", "test\FunctionsV1\WebJobs.Extensions.DurableTask.Tests.V1.csproj", "{F99CA746-553C-43B4-943B-59A5D190459A}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9850DECF-CBA2-43E7-B5E2-55053DD308E9}" ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig @@ -24,17 +22,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .stylecop\stylecop.json = .stylecop\stylecop.json EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VSSampleV1", "test\SmokeTests\SmokeTestsV1\VSSampleV1.csproj", "{78141F66-4DDD-4ABB-9DE3-D0B426FE8110}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SmokeTests", "SmokeTests", "{A8CF6993-258A-484A-AF6D-6CC88D36AF93}" ProjectSection(SolutionItems) = preProject test\SmokeTests\e2e-test.ps1 = test\SmokeTests\e2e-test.ps1 EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VSSampleV2", "test\SmokeTests\SmokeTestsV2\VSSampleV2.csproj", "{E997024B-633E-4252-880B-E2A726E1B4A4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VSSampleV3", "test\SmokeTests\SmokeTestsV3\VSSampleV3.csproj", "{F1611EF4-457B-47CB-94E9-B611EE488984}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "JavaScript", "JavaScript", "{7B2EDAEC-CFD0-404A-8E52-133FFF595C2F}" ProjectSection(SolutionItems) = preProject test\SmokeTests\OOProcSmokeTests\durableJS\Dockerfile = test\SmokeTests\OOProcSmokeTests\durableJS\Dockerfile @@ -88,8 +80,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pipelines", "pipelines", "{ .github\workflows\smoketest-python37-v4.yml = .github\workflows\smoketest-python37-v4.yml EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DFPerfScenariosV1", "test\DFPerfScenariosV1\DFPerfScenariosV1.csproj", "{65F904AA-0F6F-48CB-BE19-593B7D68152A}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PerfTests", "PerfTests", "{7387E723-E153-4B7A-B105-8C67BFBD48CF}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DFPerfScenariosV4", "test\DFPerfScenarios\DFPerfScenariosV4.csproj", "{FC8AD123-F949-4D21-B817-E5A4BBF7F69B}" diff --git a/test/Common/TestEntityClasses.cs b/test/Common/TestEntityClasses.cs index 6751b439e..0d10db235 100644 --- a/test/Common/TestEntityClasses.cs +++ b/test/Common/TestEntityClasses.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Reflection; using System.Text; +using System.Threading.Tasks; using Azure.Storage.Blobs; using Azure.Storage.Blobs.Specialized; using Newtonsoft.Json; diff --git a/test/FunctionsV2/WebJobs.Extensions.DurableTask.Tests.V2.csproj b/test/FunctionsV2/WebJobs.Extensions.DurableTask.Tests.V2.csproj index c40abaa76..f14ddc936 100644 --- a/test/FunctionsV2/WebJobs.Extensions.DurableTask.Tests.V2.csproj +++ b/test/FunctionsV2/WebJobs.Extensions.DurableTask.Tests.V2.csproj @@ -16,11 +16,11 @@ - + - + From d69f816f538ab8f5c6a3389b969d8be194b502e9 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Wed, 26 Jun 2024 09:34:46 -0700 Subject: [PATCH 08/19] update by errors --- .../AzureStorageDurabilityProvider.cs | 3 +-- .../DurabilityProvider.cs | 2 +- .../DurableTaskExtension.cs | 16 +--------------- .../DurableTaskJobHostConfigurationExtensions.cs | 9 ++------- .../LinuxAppServiceLogger.cs | 2 +- .../Listener/TaskOrchestrationShim.cs | 2 +- .../WebJobsConnectionInfoProvider.cs | 1 - 7 files changed, 7 insertions(+), 28 deletions(-) diff --git a/src/WebJobs.Extensions.DurableTask/AzureStorageDurabilityProvider.cs b/src/WebJobs.Extensions.DurableTask/AzureStorageDurabilityProvider.cs index 21ceffd41..78f2993b1 100644 --- a/src/WebJobs.Extensions.DurableTask/AzureStorageDurabilityProvider.cs +++ b/src/WebJobs.Extensions.DurableTask/AzureStorageDurabilityProvider.cs @@ -11,12 +11,12 @@ using DurableTask.Core; using DurableTask.Core.Entities; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Storage; +using Microsoft.Azure.WebJobs.Host.Scale; using Microsoft.Extensions.Logging; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Serialization; -using Microsoft.Azure.WebJobs.Host.Scale; using AzureStorage = DurableTask.AzureStorage; using DTCore = DurableTask.Core; @@ -221,7 +221,6 @@ internal static OrchestrationInstanceStatusQueryCondition ConvertWebjobsDurableC }; } - internal DurableTaskMetricsProvider GetMetricsProvider( string functionName, string hubName, diff --git a/src/WebJobs.Extensions.DurableTask/DurabilityProvider.cs b/src/WebJobs.Extensions.DurableTask/DurabilityProvider.cs index ddcab0233..2c4a276e5 100644 --- a/src/WebJobs.Extensions.DurableTask/DurabilityProvider.cs +++ b/src/WebJobs.Extensions.DurableTask/DurabilityProvider.cs @@ -9,9 +9,9 @@ using DurableTask.Core.Entities; using DurableTask.Core.History; using DurableTask.Core.Query; +using Microsoft.Azure.WebJobs.Host.Scale; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using Microsoft.Azure.WebJobs.Host.Scale; namespace Microsoft.Azure.WebJobs.Extensions.DurableTask { diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs index 46baad069..63e911803 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs @@ -19,12 +19,12 @@ using DurableTask.Core.Middleware; using Microsoft.Azure.WebJobs.Description; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Correlation; -using Microsoft.Azure.WebJobs.Host.Scale; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Listener; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Storage; using Microsoft.Azure.WebJobs.Host; using Microsoft.Azure.WebJobs.Host.Config; using Microsoft.Azure.WebJobs.Host.Executors; +using Microsoft.Azure.WebJobs.Host.Scale; using Microsoft.Azure.WebJobs.Logging; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -86,19 +86,6 @@ public class DurableTaskExtension : private HttpClient durableHttpClient; private EventSourceListener eventSourceListener; - private IConnectionInfoResolver connectionInfoResolver; - - /// - /// Obsolete. Please use an alternate constructor overload. - /// - [Obsolete("The default constructor is obsolete and will be removed in future versions")] - public DurableTaskExtension() - { - // Options initialization happens later - this.Options = new DurableTaskOptions(); - this.isOptionsConfigured = false; - } - /// /// Initializes a new instance of the . /// @@ -198,7 +185,6 @@ public DurableTaskExtension( } } - internal DurableTaskOptions Options { get; } internal DurabilityProvider DefaultDurabilityProvider => this.defaultDurabilityProvider; diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs index 8a99065fb..fdce0cc51 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs @@ -9,19 +9,14 @@ using Microsoft.Azure.WebJobs.Extensions.DurableTask.Options; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Scale; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Storage; +using Microsoft.Azure.WebJobs.Host; +using Microsoft.Azure.WebJobs.Host.Config; using Microsoft.Azure.WebJobs.Host.Scale; using Microsoft.Extensions.Azure; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using Microsoft.Azure.WebJobs.Extensions.DurableTask.ContextImplementations; -using Microsoft.Azure.WebJobs.Extensions.DurableTask.Options; -using Microsoft.Azure.WebJobs.Extensions.DurableTask.Storage; -using Microsoft.Azure.WebJobs.Host; -using Microsoft.Azure.WebJobs.Host.Config; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.DependencyInjection.Extensions; namespace Microsoft.Azure.WebJobs.Extensions.DurableTask { diff --git a/src/WebJobs.Extensions.DurableTask/LinuxAppServiceLogger.cs b/src/WebJobs.Extensions.DurableTask/LinuxAppServiceLogger.cs index f3e152cc8..9719e816f 100644 --- a/src/WebJobs.Extensions.DurableTask/LinuxAppServiceLogger.cs +++ b/src/WebJobs.Extensions.DurableTask/LinuxAppServiceLogger.cs @@ -183,4 +183,4 @@ public void Dispose() this.fileLogger?.Dispose(); } } -} \ No newline at end of file +} diff --git a/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs b/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs index c03fcd3c5..202687bdf 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs @@ -184,7 +184,7 @@ private async Task InvokeUserCodeAndHandleResults( this.context.OrchestrationException = ExceptionDispatchInfo.Capture(ex); throw ex; } - } + } else { this.TraceAndSendExceptionNotification(e.ToString()); diff --git a/src/WebJobs.Extensions.DurableTask/WebJobsConnectionInfoProvider.cs b/src/WebJobs.Extensions.DurableTask/WebJobsConnectionInfoProvider.cs index 59218598b..3de43f0b0 100644 --- a/src/WebJobs.Extensions.DurableTask/WebJobsConnectionInfoProvider.cs +++ b/src/WebJobs.Extensions.DurableTask/WebJobsConnectionInfoProvider.cs @@ -25,7 +25,6 @@ public WebJobsConnectionInfoProvider(IConfiguration hostConfiguration) /// public IConfigurationSection Resolve(string name) { - // The below represents the implementation of this.hostConfiguration.GetWebJobsConnectionSection(name), defined in the WebJobs SDK // but not available to Functions v3 at runtime. // Source: https://github.com/Azure/azure-webjobs-sdk/blob/b6d5b52da5d2fb457efbf359cbdd733186aacf7c/src/Microsoft.Azure.WebJobs.Host/Extensions/IConfigurationExtensions.cs#L103-L133 From 9fd739fd6aa11d22fdb3ff97fe83e231647ea3ee Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Wed, 26 Jun 2024 09:45:31 -0700 Subject: [PATCH 09/19] further update --- src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs | 2 ++ .../DurableTaskJobHostConfigurationExtensions.cs | 1 - .../LinuxAppServiceFileLogger.cs | 1 - .../Listener/TaskOrchestrationShim.cs | 3 ++- .../Storage/StorageServiceClientProviderFactory.cs | 3 +++ 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs index 63e911803..162d1289a 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs @@ -151,9 +151,11 @@ public DurableTaskExtension( this.TypedCodeProvider.Initialize(); this.HttpApiHandler = new HttpApiHandler(this, logger); + // This line ensure every time we need the webhook URI, we get it directly from the // function runtime, which has the most up-to-date knowledge about the site hostname. Func webhookDelegate = () => webhookProvider.GetUrl(this); + this.HttpApiHandler.RegisterWebhookProvider( this.Options.WebhookUriProviderOverride ?? webhookDelegate); diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs index fdce0cc51..1d6e27865 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs @@ -167,6 +167,5 @@ public static IWebJobsBuilder AddDurableTask(this IWebJobsBuilder builder, Actio return builder; } - } } diff --git a/src/WebJobs.Extensions.DurableTask/LinuxAppServiceFileLogger.cs b/src/WebJobs.Extensions.DurableTask/LinuxAppServiceFileLogger.cs index efbe9a7f0..d9b194def 100644 --- a/src/WebJobs.Extensions.DurableTask/LinuxAppServiceFileLogger.cs +++ b/src/WebJobs.Extensions.DurableTask/LinuxAppServiceFileLogger.cs @@ -184,7 +184,6 @@ private void RollFiles() { // Rename current file to older file. rename(this.logFilePath, this.archiveFilePath); - } [DllImport("libc", SetLastError = true)] diff --git a/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs b/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs index 202687bdf..f8d761543 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs @@ -79,6 +79,7 @@ public override async Task Execute(OrchestrationContext innerContext, st FunctionType.Orchestrator, this.context.IsReplaying); status = OrchestrationRuntimeStatus.Running; + // On a replay, the orchestrator will either go into a 'Completed' // state or a 'Failed' state. We want to avoid tagging them as // 'Running' while replaying because this could result in @@ -184,7 +185,7 @@ private async Task InvokeUserCodeAndHandleResults( this.context.OrchestrationException = ExceptionDispatchInfo.Capture(ex); throw ex; } - } + } else { this.TraceAndSendExceptionNotification(e.ToString()); diff --git a/src/WebJobs.Extensions.DurableTask/Storage/StorageServiceClientProviderFactory.cs b/src/WebJobs.Extensions.DurableTask/Storage/StorageServiceClientProviderFactory.cs index 58f3aaa96..c26313a23 100644 --- a/src/WebJobs.Extensions.DurableTask/Storage/StorageServiceClientProviderFactory.cs +++ b/src/WebJobs.Extensions.DurableTask/Storage/StorageServiceClientProviderFactory.cs @@ -44,6 +44,7 @@ public IStorageServiceClientProvider GetBl { return new BlobServiceClientProvider(connectionSection, this.componentFactory); } + throw new InvalidOperationException($"Unable to resolve the Azure Storage connection named '{connectionName}'."); } @@ -62,6 +63,7 @@ public IStorageServiceClientProvider Get { return new QueueServiceClientProvider(connectionSection, this.componentFactory); } + throw new InvalidOperationException($"Unable to resolve the Azure Storage connection named '{connectionName}'."); } @@ -80,6 +82,7 @@ public IStorageServiceClientProvider Get { return new TableServiceClientProvider(connectionSection, this.componentFactory); } + throw new InvalidOperationException($"Unable to resolve the Azure Storage connection named '{connectionName}'."); } } From 6fcbc8ab91cd48bae779e29eb21b00343b6ae244 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Wed, 26 Jun 2024 10:08:29 -0700 Subject: [PATCH 10/19] update --- src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs | 4 ++-- .../Listener/DurableTaskTargetScaler.cs | 2 +- .../Listener/TaskOrchestrationShim.cs | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs index 162d1289a..a50da34dd 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs @@ -151,11 +151,11 @@ public DurableTaskExtension( this.TypedCodeProvider.Initialize(); this.HttpApiHandler = new HttpApiHandler(this, logger); - + // This line ensure every time we need the webhook URI, we get it directly from the // function runtime, which has the most up-to-date knowledge about the site hostname. Func webhookDelegate = () => webhookProvider.GetUrl(this); - + this.HttpApiHandler.RegisterWebhookProvider( this.Options.WebhookUriProviderOverride ?? webhookDelegate); diff --git a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTargetScaler.cs b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTargetScaler.cs index c1faa94f4..451f22b86 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTargetScaler.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTargetScaler.cs @@ -52,7 +52,7 @@ public async Task GetScaleResultAsync(TargetScalerContext co var serializedControlQueueLengths = metrics.ControlQueueLengths; var controlQueueLengths = JsonConvert.DeserializeObject>(serializedControlQueueLengths); - var controlQueueMessages = controlQueueLengths.Sum(); + var controlQueueMessages = controlQueueLengths?.Sum(); var activeControlQueues = controlQueueLengths.Count(x => x > 0); // compute orchestratorWorkers: the number of workers we need to process all orchestrator messages. diff --git a/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs b/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs index f8d761543..2d2ea2122 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs @@ -79,7 +79,7 @@ public override async Task Execute(OrchestrationContext innerContext, st FunctionType.Orchestrator, this.context.IsReplaying); status = OrchestrationRuntimeStatus.Running; - + // On a replay, the orchestrator will either go into a 'Completed' // state or a 'Failed' state. We want to avoid tagging them as // 'Running' while replaying because this could result in @@ -127,6 +127,7 @@ public override async Task Execute(OrchestrationContext innerContext, st this.context.ContinuedAsNew, this.context.IsReplaying)); } + DurableTaskExtension.TagActivityWithOrchestrationStatus(status, this.context.InstanceId); return serializedOutput; } From 85b3846e45441a8ff6ba4605a717b0119af6bad3 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Wed, 26 Jun 2024 10:20:51 -0700 Subject: [PATCH 11/19] remove typo --- .../Listener/DurableTaskTargetScaler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTargetScaler.cs b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTargetScaler.cs index 451f22b86..464d1bbf2 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTargetScaler.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTargetScaler.cs @@ -52,7 +52,7 @@ public async Task GetScaleResultAsync(TargetScalerContext co var serializedControlQueueLengths = metrics.ControlQueueLengths; var controlQueueLengths = JsonConvert.DeserializeObject>(serializedControlQueueLengths); - var controlQueueMessages = controlQueueLengths?.Sum(); + var controlQueueMessages = controlQueueLengths!.Sum(); var activeControlQueues = controlQueueLengths.Count(x => x > 0); // compute orchestratorWorkers: the number of workers we need to process all orchestrator messages. From fc289517ecefcee4066b8ed8d07da975e63d3e14 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Wed, 26 Jun 2024 10:29:54 -0700 Subject: [PATCH 12/19] update by build errors --- .../Listener/TaskOrchestrationShim.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs b/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs index 2d2ea2122..936d21a07 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/TaskOrchestrationShim.cs @@ -186,7 +186,7 @@ private async Task InvokeUserCodeAndHandleResults( this.context.OrchestrationException = ExceptionDispatchInfo.Capture(ex); throw ex; } - } + } else { this.TraceAndSendExceptionNotification(e.ToString()); From 4182e9aafe214920c26c0177506b7a7dd58c1117 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Wed, 26 Jun 2024 10:43:17 -0700 Subject: [PATCH 13/19] update by build errors --- .../Listener/DurableTaskTargetScaler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTargetScaler.cs b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTargetScaler.cs index 464d1bbf2..c3b53beec 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTargetScaler.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTargetScaler.cs @@ -53,7 +53,7 @@ public async Task GetScaleResultAsync(TargetScalerContext co var controlQueueLengths = JsonConvert.DeserializeObject>(serializedControlQueueLengths); var controlQueueMessages = controlQueueLengths!.Sum(); - var activeControlQueues = controlQueueLengths.Count(x => x > 0); + var activeControlQueues = controlQueueLengths!.Count(x => x > 0); // compute orchestratorWorkers: the number of workers we need to process all orchestrator messages. // We bound this result to be no larger than the partition count From fef768162eb680790fe3b89dbf9b810159ddaa4c Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Wed, 26 Jun 2024 17:44:49 -0700 Subject: [PATCH 14/19] remove v1 dependency --- .../DurableTaskJobHostConfigurationExtensions.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs index 1d6e27865..fa24ba290 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs @@ -9,8 +9,6 @@ using Microsoft.Azure.WebJobs.Extensions.DurableTask.Options; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Scale; using Microsoft.Azure.WebJobs.Extensions.DurableTask.Storage; -using Microsoft.Azure.WebJobs.Host; -using Microsoft.Azure.WebJobs.Host.Config; using Microsoft.Azure.WebJobs.Host.Scale; using Microsoft.Extensions.Azure; using Microsoft.Extensions.DependencyInjection; From d59d462d92729aa1795d5849e8f47fbbdcee9247 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Wed, 26 Jun 2024 19:34:33 -0700 Subject: [PATCH 15/19] remove if Functionsv3 and v2 section --- .../AzureStorageDurabilityProvider.cs | 2 -- .../EntityTriggerAttributeBindingProvider.cs | 2 -- ...strationTriggerAttributeBindingProvider.cs | 2 -- .../DurabilityProvider.cs | 2 -- .../DurableTaskExtension.cs | 20 ------------------- ...rableTaskJobHostConfigurationExtensions.cs | 2 -- .../Listener/DurableTaskListener.cs | 12 ----------- .../Listener/DurableTaskScaleMonitor.cs | 9 --------- .../Listener/DurableTaskTargetScaler.cs | 4 +--- .../LocalGrpcListener.cs | 4 +--- .../OutOfProcMiddleware.cs | 4 +--- .../ProtobufUtils.cs | 4 +--- .../Scale/DurableTaskTriggersScaleProvider.cs | 4 +--- .../Scale/ScaleUtils.cs | 8 -------- .../WebJobs.Extensions.DurableTask.csproj | 1 - 15 files changed, 5 insertions(+), 75 deletions(-) diff --git a/src/WebJobs.Extensions.DurableTask/AzureStorageDurabilityProvider.cs b/src/WebJobs.Extensions.DurableTask/AzureStorageDurabilityProvider.cs index 78f2993b1..71074e7dd 100644 --- a/src/WebJobs.Extensions.DurableTask/AzureStorageDurabilityProvider.cs +++ b/src/WebJobs.Extensions.DurableTask/AzureStorageDurabilityProvider.cs @@ -250,7 +250,6 @@ public override bool TryGetScaleMonitor( return true; } -#if FUNCTIONS_V3_OR_GREATER public override bool TryGetTargetScaler( string functionId, string functionName, @@ -264,6 +263,5 @@ public override bool TryGetTargetScaler( targetScaler = new DurableTaskTargetScaler(functionId, metricsProvider, this, this.logger); return true; } -#endif } } diff --git a/src/WebJobs.Extensions.DurableTask/Bindings/EntityTriggerAttributeBindingProvider.cs b/src/WebJobs.Extensions.DurableTask/Bindings/EntityTriggerAttributeBindingProvider.cs index be6743ca1..c2f316a75 100644 --- a/src/WebJobs.Extensions.DurableTask/Bindings/EntityTriggerAttributeBindingProvider.cs +++ b/src/WebJobs.Extensions.DurableTask/Bindings/EntityTriggerAttributeBindingProvider.cs @@ -126,7 +126,6 @@ public Task BindAsync(object value, ValueBindingContext context) var triggerData = new TriggerData(inputValueProvider, bindingData); return Task.FromResult(triggerData); } -#if FUNCTIONS_V3_OR_GREATER else if (value is RemoteEntityContext remoteContext) { // Generate a byte array which is the serialized protobuf payload @@ -140,7 +139,6 @@ public Task BindAsync(object value, ValueBindingContext context) var triggerData = new TriggerData(contextValueProvider, EmptyBindingData); return Task.FromResult(triggerData); } -#endif else { throw new ArgumentException($"Don't know how to bind to {value?.GetType().Name ?? "null"}.", nameof(value)); diff --git a/src/WebJobs.Extensions.DurableTask/Bindings/OrchestrationTriggerAttributeBindingProvider.cs b/src/WebJobs.Extensions.DurableTask/Bindings/OrchestrationTriggerAttributeBindingProvider.cs index 3a277a505..a69e442cc 100644 --- a/src/WebJobs.Extensions.DurableTask/Bindings/OrchestrationTriggerAttributeBindingProvider.cs +++ b/src/WebJobs.Extensions.DurableTask/Bindings/OrchestrationTriggerAttributeBindingProvider.cs @@ -160,7 +160,6 @@ public Task BindAsync(object? value, ValueBindingContext context) var triggerData = new TriggerData(contextValueProvider, bindingData); return Task.FromResult(triggerData); } -#if FUNCTIONS_V3_OR_GREATER else if (value is RemoteOrchestratorContext remoteContext) { // Generate a byte array which is the serialized protobuf payload @@ -180,7 +179,6 @@ public Task BindAsync(object? value, ValueBindingContext context) var triggerData = new TriggerData(contextValueProvider, EmptyBindingData); return Task.FromResult(triggerData); } -#endif else { throw new ArgumentException($"Don't know how to bind to {value?.GetType().Name ?? "null"}.", nameof(value)); diff --git a/src/WebJobs.Extensions.DurableTask/DurabilityProvider.cs b/src/WebJobs.Extensions.DurableTask/DurabilityProvider.cs index 2c4a276e5..789e88685 100644 --- a/src/WebJobs.Extensions.DurableTask/DurabilityProvider.cs +++ b/src/WebJobs.Extensions.DurableTask/DurabilityProvider.cs @@ -580,7 +580,6 @@ public virtual bool TryGetScaleMonitor( return false; } -#if FUNCTIONS_V3_OR_GREATER /// /// Tries to obtain a scaler for target based scaling. /// @@ -600,6 +599,5 @@ public virtual bool TryGetTargetScaler( targetScaler = null; return false; } -#endif } } diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs index a50da34dd..84e33d09c 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs @@ -66,9 +66,7 @@ public class DurableTaskExtension : #pragma warning disable CS0169 private readonly ITelemetryActivator telemetryActivator; #pragma warning restore CS0169 -#if FUNCTIONS_V3_OR_GREATER private readonly LocalGrpcListener localGrpcListener; -#endif private readonly bool isOptionsConfigured; private readonly Guid extensionGuid; @@ -176,10 +174,8 @@ public DurableTaskExtension( runtimeType == WorkerRuntimeType.Custom) { this.OutOfProcProtocol = OutOfProcOrchestrationProtocol.MiddlewarePassthrough; -#if FUNCTIONS_V3_OR_GREATER this.localGrpcListener = new LocalGrpcListener(this); this.HostLifetimeService.OnStopped.Register(this.StopLocalGrpcServer); -#endif } else { @@ -367,22 +363,12 @@ void IExtensionConfigProvider.Initialize(ExtensionConfigContext context) // Note that the order of the middleware added determines the order in which it executes. if (this.OutOfProcProtocol == OutOfProcOrchestrationProtocol.MiddlewarePassthrough) { -#if FUNCTIONS_V3_OR_GREATER // This is a newer, more performant flavor of orchestration/activity middleware that is being // enabled for newer language runtimes. var ooprocMiddleware = new OutOfProcMiddleware(this); this.taskHubWorker.AddActivityDispatcherMiddleware(ooprocMiddleware.CallActivityAsync); this.taskHubWorker.AddOrchestrationDispatcherMiddleware(ooprocMiddleware.CallOrchestratorAsync); this.taskHubWorker.AddEntityDispatcherMiddleware(ooprocMiddleware.CallEntityAsync); -#else - // This can happen if, for example, a Java user tries to use Durable Functions while targeting V2 or V3 extension bundles - // because those bundles target .NET Core 2.2, which doesn't support the gRPC libraries used in the modern out-of-proc implementation. - throw new PlatformNotSupportedException( - "This project type is not supported on this version of the Azure Functions runtime. Please upgrade to Azure Functions V3 or higher. " + - "If you are using a language that supports extension bundles, please use extension bundles V4 or higher. " + - "For more information on Azure Functions versions, see https://docs.microsoft.com/azure/azure-functions/functions-versions. " + - "For more information on extension bundles, see https://docs.microsoft.com/azure/azure-functions/functions-bindings-register#extension-bundles."); -#endif } else { @@ -395,12 +381,10 @@ void IExtensionConfigProvider.Initialize(ExtensionConfigContext context) // The RPC server needs to be started sometime before any functions can be triggered // and this is the latest point in the pipeline available to us. -#if FUNCTIONS_V3_OR_GREATER if (this.OutOfProcProtocol == OutOfProcOrchestrationProtocol.MiddlewarePassthrough) { this.StartLocalGrpcServer(); } -#endif if (this.OutOfProcProtocol == OutOfProcOrchestrationProtocol.OrchestratorShim) { this.StartLocalHttpServer(); @@ -409,12 +393,10 @@ void IExtensionConfigProvider.Initialize(ExtensionConfigContext context) internal string GetLocalRpcAddress() { -#if FUNCTIONS_V3_OR_GREATER if (this.OutOfProcProtocol == OutOfProcOrchestrationProtocol.MiddlewarePassthrough) { return this.localGrpcListener.ListenAddress; } -#endif return this.HttpApiHandler.GetBaseUrl(); } @@ -493,7 +475,6 @@ private void StopLocalHttpServer() this.HttpApiHandler.StopLocalHttpServerAsync().GetAwaiter().GetResult(); } -#if FUNCTIONS_V3_OR_GREATER private void StartLocalGrpcServer() { this.localGrpcListener.StartAsync().GetAwaiter().GetResult(); @@ -503,7 +484,6 @@ private void StopLocalGrpcServer() { this.localGrpcListener.StopAsync().GetAwaiter().GetResult(); } -#endif private void InitializeForFunctionsV1(ExtensionConfigContext context) { diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs index fa24ba290..84d0f78ad 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskJobHostConfigurationExtensions.cs @@ -98,7 +98,6 @@ public static IWebJobsBuilder AddDurableTask(this IWebJobsBuilder builder) return builder; } -#if FUNCTIONS_V3_OR_GREATER /// /// Adds the and providers for the Durable Triggers. /// @@ -117,7 +116,6 @@ internal static IWebJobsBuilder AddDurableScaleForTrigger(this IWebJobsBuilder b builder.Services.AddSingleton(serviceProvider => serviceProvider.GetServices().Single(x => x == provider)); return builder; } -#endif /// /// Adds the Durable Task extension to the provided . diff --git a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskListener.cs b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskListener.cs index 60d6c5cd4..e2f73314d 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskListener.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskListener.cs @@ -10,13 +10,7 @@ namespace Microsoft.Azure.WebJobs.Extensions.DurableTask { -#if FUNCTIONS_V3_OR_GREATER internal sealed class DurableTaskListener : IListener, IScaleMonitorProvider, ITargetScalerProvider -#elif FUNCTIONS_V2_OR_GREATER - internal sealed class DurableTaskListener : IListener, IScaleMonitorProvider -#else - internal sealed class DurableTaskListener : IListener -#endif { private readonly DurableTaskExtension config; private readonly string functionId; @@ -26,9 +20,7 @@ internal sealed class DurableTaskListener : IListener private readonly Lazy scaleMonitor; -#if FUNCTIONS_V3_OR_GREATER private readonly Lazy targetScaler; -#endif public DurableTaskListener( DurableTaskExtension config, @@ -57,7 +49,6 @@ public DurableTaskListener( this.connectionName, this.config.Options.HubName)); -#if FUNCTIONS_V3_OR_GREATER this.targetScaler = new Lazy(() => ScaleUtils.GetTargetScaler( this.config.DefaultDurabilityProvider, @@ -65,7 +56,6 @@ public DurableTaskListener( this.functionName, this.connectionName, this.config.Options.HubName)); -#endif } public Task StartAsync(CancellationToken cancellationToken) @@ -108,11 +98,9 @@ public IScaleMonitor GetMonitor() return this.scaleMonitor.Value; } -#if FUNCTIONS_V3_OR_GREATER public ITargetScaler GetTargetScaler() { return this.targetScaler.Value; } -#endif } } diff --git a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskScaleMonitor.cs b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskScaleMonitor.cs index 67d9aaef5..f0144fa33 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskScaleMonitor.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskScaleMonitor.cs @@ -43,16 +43,7 @@ public DurableTaskScaleMonitor( this.performanceMonitor = performanceMonitor; this.durableTaskMetricsProvider = durableTaskMetricsProvider; -#if FUNCTIONS_V3_OR_GREATER this.scaleMonitorDescriptor = new ScaleMonitorDescriptor($"{this.functionId}-DurableTaskTrigger-{this.hubName}".ToLower(), this.functionId); -#else -#pragma warning disable CS0618 // Type or member is obsolete. - - // We need this because the new ScaleMonitorDescriptor constructor is not compatible with the WebJobs version of Functions V1 and V2. - // Technically, it is also not available in Functions V3, but we don't have a TFM allowing us to differentiate between Functions V3 and V4. - this.scaleMonitorDescriptor = new ScaleMonitorDescriptor($"{this.functionId}-DurableTaskTrigger-{this.hubName}".ToLower()); -#pragma warning restore CS0618 // Type or member is obsolete. However, the new interface is not compatible with Functions V2 and V1 -#endif } public ScaleMonitorDescriptor Descriptor diff --git a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTargetScaler.cs b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTargetScaler.cs index c3b53beec..a9dd0583a 100644 --- a/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTargetScaler.cs +++ b/src/WebJobs.Extensions.DurableTask/Listener/DurableTaskTargetScaler.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -#if FUNCTIONS_V3_OR_GREATER #nullable enable using System; using System.Collections.Generic; @@ -90,5 +89,4 @@ public async Task GetScaleResultAsync(TargetScalerContext co } } } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/WebJobs.Extensions.DurableTask/LocalGrpcListener.cs b/src/WebJobs.Extensions.DurableTask/LocalGrpcListener.cs index a62b377b1..fea9a0ffd 100644 --- a/src/WebJobs.Extensions.DurableTask/LocalGrpcListener.cs +++ b/src/WebJobs.Extensions.DurableTask/LocalGrpcListener.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. #nullable enable -#if FUNCTIONS_V3_OR_GREATER using System; using System.Collections.Generic; using System.IO; @@ -468,5 +467,4 @@ private P.EntityMetadata ConvertEntityMetadata(EntityBackendQueries.EntityMetada } } } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs b/src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs index 8a7983cba..51f136821 100644 --- a/src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs +++ b/src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. #nullable enable -#if FUNCTIONS_V3_OR_GREATER using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -706,5 +705,4 @@ private static bool TrySplitExceptionTypeFromMessage( return true; } } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs b/src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs index 57b84012b..618b86d7f 100644 --- a/src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs +++ b/src/WebJobs.Extensions.DurableTask/ProtobufUtils.cs @@ -1,6 +1,5 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -#if FUNCTIONS_V3_OR_GREATER #nullable enable using System; using System.Buffers; @@ -590,5 +589,4 @@ internal static P.PurgeInstancesResponse CreatePurgeInstancesResponse(PurgeResul } } } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/WebJobs.Extensions.DurableTask/Scale/DurableTaskTriggersScaleProvider.cs b/src/WebJobs.Extensions.DurableTask/Scale/DurableTaskTriggersScaleProvider.cs index fd50f9e38..4e31c021e 100644 --- a/src/WebJobs.Extensions.DurableTask/Scale/DurableTaskTriggersScaleProvider.cs +++ b/src/WebJobs.Extensions.DurableTask/Scale/DurableTaskTriggersScaleProvider.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. #nullable enable -#if FUNCTIONS_V3_OR_GREATER using System; using System.Collections.Generic; @@ -125,5 +124,4 @@ internal class DurableTaskMetadata public IDictionary? StorageProvider { get; set; } } } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/WebJobs.Extensions.DurableTask/Scale/ScaleUtils.cs b/src/WebJobs.Extensions.DurableTask/Scale/ScaleUtils.cs index 86620679c..a616de908 100644 --- a/src/WebJobs.Extensions.DurableTask/Scale/ScaleUtils.cs +++ b/src/WebJobs.Extensions.DurableTask/Scale/ScaleUtils.cs @@ -44,13 +44,7 @@ internal sealed class NoOpScaleMonitor : IScaleMonitor /// The function ID. public NoOpScaleMonitor(string name, string functionId) { -#if FUNCTIONS_V3_OR_GREATER this.Descriptor = new ScaleMonitorDescriptor(name, functionId); -#else -#pragma warning disable CS0618 // Type or member is obsolete - this.Descriptor = new ScaleMonitorDescriptor(name); -#pragma warning restore CS0618 // Type or member is obsolete -#endif } /// @@ -71,7 +65,6 @@ ScaleStatus IScaleMonitor.GetScaleStatus(ScaleStatusContext context) } } -#if FUNCTIONS_V3_OR_GREATER #pragma warning disable SA1201 // Elements should appear in the correct order internal static ITargetScaler GetTargetScaler(DurabilityProvider durabilityProvider, string functionId, FunctionName functionName, string? connectionName, string hubName) #pragma warning restore SA1201 // Elements should appear in the correct order @@ -111,6 +104,5 @@ public Task GetScaleResultAsync(TargetScalerContext context) throw new NotSupportedException("The current DurableTask backend configuration does not support target-based scaling"); } } -#endif } } diff --git a/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj b/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj index 043713c70..388a9859d 100644 --- a/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj +++ b/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj @@ -20,7 +20,6 @@ embedded NU5125;SA0001 - $(DefineConstants);FUNCTIONS_V2_OR_GREATER;FUNCTIONS_V3_OR_GREATER From 22e0bfcfbc1a4491c717f6e518bbfd7c6db2d90f Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Wed, 26 Jun 2024 19:46:19 -0700 Subject: [PATCH 16/19] update by errors --- src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs index 84e33d09c..755911319 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs @@ -385,6 +385,7 @@ void IExtensionConfigProvider.Initialize(ExtensionConfigContext context) { this.StartLocalGrpcServer(); } + if (this.OutOfProcProtocol == OutOfProcOrchestrationProtocol.OrchestratorShim) { this.StartLocalHttpServer(); From 0b64f9808dce4ecd655998b1db339af3fb21257a Mon Sep 17 00:00:00 2001 From: Varshitha Bachu Date: Fri, 28 Jun 2024 14:25:52 -0700 Subject: [PATCH 17/19] updated targetframework syntax --- .../WebJobs.Extensions.DurableTask.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj b/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj index 388a9859d..0caa7c6fd 100644 --- a/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj +++ b/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj @@ -1,7 +1,7 @@  - net6.0 + net6.0 Microsoft.Azure.WebJobs.Extensions.DurableTask Microsoft.Azure.WebJobs.Extensions.DurableTask 3 From f3eb0e8e939fac3db59857c4a92f1f5f8478e2f5 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Mon, 29 Jul 2024 11:02:30 -0700 Subject: [PATCH 18/19] fix using typo --- test/Common/TestHelpers.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/Common/TestHelpers.cs b/test/Common/TestHelpers.cs index 8678830c4..823d6dcc8 100644 --- a/test/Common/TestHelpers.cs +++ b/test/Common/TestHelpers.cs @@ -15,12 +15,10 @@ using Azure.Storage.Blobs.Specialized; using DurableTask.AzureStorage; using Microsoft.ApplicationInsights.Channel; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Hosting; -#endif -#endif using Microsoft.Azure.WebJobs.Extensions.DurableTask.Storage; +using Microsoft.Azure.WebJobs.Host.Scale; using Microsoft.Azure.WebJobs.Host.TestCommon; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Moq; From 986f4d4452626263a07685e7c03f8ed817853482 Mon Sep 17 00:00:00 2001 From: "naiyuantian@microsoft.com" Date: Mon, 29 Jul 2024 11:17:17 -0700 Subject: [PATCH 19/19] update .sln file to remove deleted test sln files --- WebJobs.Extensions.DurableTask.sln | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/WebJobs.Extensions.DurableTask.sln b/WebJobs.Extensions.DurableTask.sln index acf70905b..95eea0528 100644 --- a/WebJobs.Extensions.DurableTask.sln +++ b/WebJobs.Extensions.DurableTask.sln @@ -100,22 +100,6 @@ Global {F2A5DABB-36D4-4152-AF49-2570149899E1}.Debug|Any CPU.Build.0 = Debug|Any CPU {F2A5DABB-36D4-4152-AF49-2570149899E1}.Release|Any CPU.ActiveCfg = Release|Any CPU {F2A5DABB-36D4-4152-AF49-2570149899E1}.Release|Any CPU.Build.0 = Release|Any CPU - {F99CA746-553C-43B4-943B-59A5D190459A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F99CA746-553C-43B4-943B-59A5D190459A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F99CA746-553C-43B4-943B-59A5D190459A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F99CA746-553C-43B4-943B-59A5D190459A}.Release|Any CPU.Build.0 = Release|Any CPU - {78141F66-4DDD-4ABB-9DE3-D0B426FE8110}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {78141F66-4DDD-4ABB-9DE3-D0B426FE8110}.Debug|Any CPU.Build.0 = Debug|Any CPU - {78141F66-4DDD-4ABB-9DE3-D0B426FE8110}.Release|Any CPU.ActiveCfg = Release|Any CPU - {78141F66-4DDD-4ABB-9DE3-D0B426FE8110}.Release|Any CPU.Build.0 = Release|Any CPU - {E997024B-633E-4252-880B-E2A726E1B4A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E997024B-633E-4252-880B-E2A726E1B4A4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E997024B-633E-4252-880B-E2A726E1B4A4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E997024B-633E-4252-880B-E2A726E1B4A4}.Release|Any CPU.Build.0 = Release|Any CPU - {F1611EF4-457B-47CB-94E9-B611EE488984}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F1611EF4-457B-47CB-94E9-B611EE488984}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F1611EF4-457B-47CB-94E9-B611EE488984}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F1611EF4-457B-47CB-94E9-B611EE488984}.Release|Any CPU.Build.0 = Release|Any CPU {9BA6093A-F71A-49F9-A159-B98ACBE41636}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9BA6093A-F71A-49F9-A159-B98ACBE41636}.Debug|Any CPU.Build.0 = Debug|Any CPU {9BA6093A-F71A-49F9-A159-B98ACBE41636}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -162,10 +146,6 @@ Global {5F5FAF27-D6B8-4A60-ACF2-F63D13F89CA2}.Debug|Any CPU.Build.0 = Debug|Any CPU {5F5FAF27-D6B8-4A60-ACF2-F63D13F89CA2}.Release|Any CPU.ActiveCfg = Release|Any CPU {5F5FAF27-D6B8-4A60-ACF2-F63D13F89CA2}.Release|Any CPU.Build.0 = Release|Any CPU - {65F904AA-0F6F-48CB-BE19-593B7D68152A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {65F904AA-0F6F-48CB-BE19-593B7D68152A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {65F904AA-0F6F-48CB-BE19-593B7D68152A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {65F904AA-0F6F-48CB-BE19-593B7D68152A}.Release|Any CPU.Build.0 = Release|Any CPU {FC8AD123-F949-4D21-B817-E5A4BBF7F69B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FC8AD123-F949-4D21-B817-E5A4BBF7F69B}.Debug|Any CPU.Build.0 = Debug|Any CPU {FC8AD123-F949-4D21-B817-E5A4BBF7F69B}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -181,11 +161,7 @@ Global GlobalSection(NestedProjects) = preSolution {51790AFE-5B8E-4795-9EA3-D2B15D04B5AC} = {7EC858EE-3481-4A82-AED4-CB00C34F42D0} {F2A5DABB-36D4-4152-AF49-2570149899E1} = {78BCF152-C22C-408F-9FB1-0F8C99B154B5} - {F99CA746-553C-43B4-943B-59A5D190459A} = {78BCF152-C22C-408F-9FB1-0F8C99B154B5} - {78141F66-4DDD-4ABB-9DE3-D0B426FE8110} = {A8CF6993-258A-484A-AF6D-6CC88D36AF93} {A8CF6993-258A-484A-AF6D-6CC88D36AF93} = {78BCF152-C22C-408F-9FB1-0F8C99B154B5} - {E997024B-633E-4252-880B-E2A726E1B4A4} = {A8CF6993-258A-484A-AF6D-6CC88D36AF93} - {F1611EF4-457B-47CB-94E9-B611EE488984} = {A8CF6993-258A-484A-AF6D-6CC88D36AF93} {7B2EDAEC-CFD0-404A-8E52-133FFF595C2F} = {A8CF6993-258A-484A-AF6D-6CC88D36AF93} {9BA6093A-F71A-49F9-A159-B98ACBE41636} = {7B2EDAEC-CFD0-404A-8E52-133FFF595C2F} {FA53EBC4-8265-4063-B9F8-0D5EA0366B90} = {A8CF6993-258A-484A-AF6D-6CC88D36AF93} @@ -204,7 +180,6 @@ Global {9B0F4A0A-1B18-4E98-850A-14A2F76F673D} = {A8CF6993-258A-484A-AF6D-6CC88D36AF93} {FF6CD07A-A4BF-43C5-B14E-213328DEB835} = {9B0F4A0A-1B18-4E98-850A-14A2F76F673D} {5F5FAF27-D6B8-4A60-ACF2-F63D13F89CA2} = {7EC858EE-3481-4A82-AED4-CB00C34F42D0} - {65F904AA-0F6F-48CB-BE19-593B7D68152A} = {7387E723-E153-4B7A-B105-8C67BFBD48CF} {7387E723-E153-4B7A-B105-8C67BFBD48CF} = {78BCF152-C22C-408F-9FB1-0F8C99B154B5} {FC8AD123-F949-4D21-B817-E5A4BBF7F69B} = {7387E723-E153-4B7A-B105-8C67BFBD48CF} {76DEC17C-BF6A-498A-8E8A-7D6CB2E03284} = {78BCF152-C22C-408F-9FB1-0F8C99B154B5}