Skip to content

Commit 339025c

Browse files
authored
[Durable Functions] Enable Durable Functions by default (#457)
1 parent 8c2ff06 commit 339025c

File tree

10 files changed

+10
-16
lines changed

10 files changed

+10
-16
lines changed

azure-pipelines-1.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ steps:
2929
AzureWebJobsServiceBus: $(AzureWebJobsServiceBus)
3030
AzureWebJobsEventHubSender: $(AzureWebJobsEventHubSender)
3131
FUNCTIONS_WORKER_RUNTIME : "powershell"
32-
PSWorkerEnableExperimentalDurableFunctions: "true"
3332
continueOnError: true
3433
displayName: 'Running E2ETest'
3534

azure-pipelines-2.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ steps:
2424
AzureWebJobsEventHubSender: $(AzureWebJobsEventHubSender)
2525
FUNCTIONS_WORKER_RUNTIME : "powershell"
2626
FunctionAppUrl: $(FunctionAppUrl)
27-
PSWorkerEnableExperimentalDurableFunctions: "true"
2827
continueOnError: true
2928
displayName: 'Running E2ETest'
3029

azure-pipelines.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ steps:
3232
AzureWebJobsServiceBus: $(AzureWebJobsServiceBus)
3333
AzureWebJobsEventHubSender: $(AzureWebJobsEventHubSender)
3434
FUNCTIONS_WORKER_RUNTIME : "powershell"
35-
PSWorkerEnableExperimentalDurableFunctions: "true"
3635
displayName: 'Running E2ETest'
3736

3837
- task: CopyFiles@2

docs/durable-experimental-instructions.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ Set the following app settings (if running on Azure) or just use the sample loca
5858
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
5959
"AzureWebJobsFeatureFlags": "AllowSynchronousIO",
6060
"FUNCTIONS_WORKER_RUNTIME": "powershell",
61-
"PSWorkerInProcConcurrencyUpperBound": 10,
62-
"PSWorkerEnableExperimentalDurableFunctions": "true"
61+
"PSWorkerInProcConcurrencyUpperBound": 10
6362
}
6463
}
6564
```
@@ -68,7 +67,6 @@ Set the following app settings (if running on Azure) or just use the sample loca
6867
- `AzureWebJobsFeatureFlags` must contain `AllowSynchronousIO`. Don't ask.
6968
- `FUNCTIONS_WORKER_RUNTIME` must be set to `powershell`.
7069
- You may need to adjust `PSWorkerInProcConcurrencyUpperBound` to increase [concurrency](https://docs.microsoft.com/azure/azure-functions/functions-reference-powershell#concurrency) for the Fan-out/Fan-in pattern.
71-
- `PSWorkerEnableExperimentalDurableFunctions` is a feature flag that enables PowerShell Durable Functions. It is turned off by default for now.
7270

7371
## 5. Starting the app
7472

examples/durable/DurableApp/local.settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
55
"AzureWebJobsFeatureFlags": "AllowSynchronousIO",
66
"FUNCTIONS_WORKER_RUNTIME": "powershell",
7-
"PSWorkerInProcConcurrencyUpperBound": 10,
8-
"PSWorkerEnableExperimentalDurableFunctions": "true"
7+
"PSWorkerInProcConcurrencyUpperBound": 10
98
}
109
}

src/Durable/DurableController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private void ThrowIfDurableNotEnabled()
136136
{
137137
if (!_durableEnabled)
138138
{
139-
throw new NotImplementedException(PowerShellWorkerStrings.DurableFunctionNotSupported);
139+
throw new NotImplementedException(PowerShellWorkerStrings.DurableFunctionsDisabled);
140140
}
141141
}
142142
}

src/Modules/Microsoft.Azure.Functions.PowerShellWorker/Microsoft.Azure.Functions.PowerShellWorker.psm1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
#
55

66
function CheckIfDurableFunctionsEnabled {
7-
if (-not [bool]$env:PSWorkerEnableExperimentalDurableFunctions) {
8-
throw 'Durable function is not yet supported for PowerShell.'
7+
if (($null -ne $env:PSWorkerEnableExperimentalDurableFunctions) -and
8+
(-not [bool]::Parse($env:PSWorkerEnableExperimentalDurableFunctions))) {
9+
throw 'PowerShell Durable Functions are disabled (check the PSWorkerEnableExperimentalDurableFunctions environment variable).'
910
}
1011
}
1112

src/Utility/Utils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ internal static object TransformOutBindingValueAsNeeded(string bindingName, Read
220220

221221
internal static bool AreDurableFunctionsEnabled()
222222
{
223-
return PowerShellWorkerConfiguration.GetBoolean("PSWorkerEnableExperimentalDurableFunctions") ?? false;
223+
return PowerShellWorkerConfiguration.GetBoolean("PSWorkerEnableExperimentalDurableFunctions") ?? true;
224224
}
225225

226226
internal static string GetPowerShellVersion(PowerShell pwsh)

src/resources/PowerShellWorkerStrings.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@
160160
<data name="UnsupportedMessage" xml:space="preserve">
161161
<value>Unsupported message type: {0}.</value>
162162
</data>
163-
<data name="DurableFunctionNotSupported" xml:space="preserve">
164-
<value>Durable function is not yet supported for PowerShell.</value>
163+
<data name="DurableFunctionsDisabled" xml:space="preserve">
164+
<value>Durable PowerShell Functions are disabled (check the PSWorkerEnableExperimentalDurableFunctions environment variable).</value>
165165
</data>
166166
<data name="FailToConvertToHttpResponseContext" xml:space="preserve">
167167
<value>The given value for the 'http' output binding '{0}' cannot be converted to the type 'HttpResponseContext'. The conversion failed with the following error: {1}</value>

test/E2E/TestFunctionApp/local.settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"AzureWebJobsEventHubSender":"",
55
"AzureWebJobsCosmosDBConnectionString":"",
66
"AzureWebJobsFeatureFlags": "AllowSynchronousIO",
7-
"FUNCTIONS_WORKER_RUNTIME": "powershell",
8-
"PSWorkerEnableExperimentalDurableFunctions": "true"
7+
"FUNCTIONS_WORKER_RUNTIME": "powershell"
98
}
109
}

0 commit comments

Comments
 (0)