You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# How to try experimental Durable PowerShell functions
1
+
# How to try Durable PowerShell functions
2
2
3
-
## **PLEASE READ THIS:**
3
+
## Please note
4
4
5
-
> This is an experimental feature. Do **not** enable or try to use it for production purposes. The programming model may change, so the sample code or any app code you come up with may not work in the next versions. The main purpose of making it available now is to enable experimentation and early feedback. **Your feedback is highly appreciated**, and please feel free to file [GitHub issues](https://github.com/Azure/azure-functions-powershell-worker/issues/new).
5
+
- This feature is getting ready for Public Preview. If you use it for production purposes, be aware that the programming model may change before GA, so the sample code or any app code you come up with may not work in the next versions.
6
+
-**Your feedback is highly appreciated**, please feel free to file [GitHub issues](https://github.com/Azure/azure-functions-powershell-worker/issues/new) if anything does not work as expected.
7
+
- Make sure you are using Azure Functions **v3** runtime. There are no plans to support Durable PowerShell on Azure Functions **v1** or **v2**.
8
+
- Only Durable Functions **2.x** will be officially supported (see [Durable Functions versions overview](https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-versions)). Technically, the current implementation works with Durable Functions **1.x** as well. However, it may stop working before GA.
9
+
- Only a limited number of patterns is enabled at this point:
> If you want to try the latest version locally, consider following these instructions as they automate and simplify the steps below: https://git.io/PS7DurableFunctionsNow
14
+
## Local setup
8
15
9
-
> You can also get started using a dev container with Visual Studio Code Remote for Containers or Visual Studio Online: https://github.com/anthonychu/powershell-durable-preview
16
+
_This step is required if you intend to run Durable PowerShell functions on your local machine. Otherwise, feel free to skip this step._
10
17
11
-
## 1. PowerShell worker version
18
+
At the moment of writing this (June 11, 2020), the PowerShell Worker version deployed by Azure Functions Core Tools does support Durable Functions yet. If you want to run Durable PowerShell functions locally, consider the following options:
12
19
13
-
At the moment of writing this (March 14, 2020), the Durable PowerShell implementation deployed to Azure is outdated. If you want to follow the instructions below, please install a more recent version locally:
14
-
- Install [Azure Functions Core Tools](https://docs.microsoft.com/azure/azure-functions/functions-run-local?tabs=windows%2Ccsharp%2Cbash#install-the-azure-functions-core-tools)**v3.x** (if not installed yet).
- Rename the downloaded .nuget file to .zip and extract the content of the `contentFiles\any\any\workers\powershell` folder to `workers\powershell` under the [Core Tools](https://github.com/Azure/azure-functions-powershell-worker/blob/dev/README.md#published-host), overwriting the existing files.
20
+
-**Option 1**: Get started using a dev container with Visual Studio Code Remote for Containers or Visual Studio Online: https://github.com/anthonychu/powershell-durable-preview
20
21
21
-
If you want to try this on Azure, you will have to wait a bit longer.
22
+
-**Option 2**: Consider following these instructions as they automate and simplify the steps below: https://git.io/PS7DurableFunctionsNow
22
23
23
-
## 2. Sample app
24
+
-**Option 3**: Install the latest PowerShell Worker build manually:
24
25
25
-
Start with the sample durable app at `examples/durable/DurableApp`.
26
+
- Install [Azure Functions Core Tools](https://docs.microsoft.com/azure/azure-functions/functions-run-local?tabs=windows%2Ccsharp%2Cbash#install-the-azure-functions-core-tools)**v3.x** (if not installed yet).
26
27
27
-
Note:
28
+
- Download the latest PowerShell worker package:
28
29
29
-
- Please make sure you are using Azure Functions **v3** runtime. There are no plans to support Durable PowerShell on Azure Functions **v1** or **v2**.
30
-
- Only Durable Functions **2.x** will be supported (see [Durable Functions versions overview](https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-versions)). Technically, the current implementation works with Durable Functions **1.x** as well. However, it may stop working before GA, and there is no plan to support Durable Functions **1.x** officially in any case.
31
-
- Please make sure you are using the sample code version corresponding to the version of the PowerShell Worker. The programming model is still changing, so older or newer samples may not work. So, if you are trying Durable PowerShell on Azure, use the samples tagged with the version of the PowerShell worker deployed to Azure. Alternatively, take the latest PowerShell Worker code from the **dev** branch, and rebuild and run the PowerShell Worker locally.
32
-
- Only a limited number of patterns is enabled at this point:
- Rename the downloaded .nuget file to .zip and extract the content of the `contentFiles\any\any\workers\powershell` folder to `workers\powershell` under the [Core Tools](https://github.com/Azure/azure-functions-powershell-worker/blob/dev/README.md#published-host), overwriting the existing files.
35
+
36
+
- **Option 4**: Wait for the next (higher than 3.0.2534) release of Azure Functions Core Tools.
37
+
38
+
## Azure setup
39
+
40
+
_This step is required if you intend to run Durable PowerShell functions on Azure. Otherwise, feel free to skip this step._
36
41
37
-
## 3. Install the required extensions
42
+
- Create a PowerShell Function app on Azure.
43
+
- Use the [instructions](https://github.com/Azure/azure-functions-powershell-worker/issues/371#issuecomment-641026259) to switch your app to PowerShell 7.
38
44
39
-
Before deploying your app, run the following command in the app directory:
45
+
## Sample app
46
+
47
+
Start with the sample app at `examples/durable/DurableApp` in this repository.
48
+
49
+
### 1. Install extensions
50
+
51
+
Before deploying or starting it, run the following command in the app directory:
40
52
41
53
``` bash
42
54
func extensions install --powershell
@@ -48,59 +60,50 @@ Please note that the Microsoft.Azure.WebJobs.Extensions.DurableTask package shou
- Make sure `AzureWebJobsStorage`[points to a valid Azure storage account](https://docs.microsoft.com/azure/azure-functions/functions-app-settings#azurewebjobsstorage). This storage is required for data persisted by Durable Functions.
66
+
- Make sure `AzureWebJobsStorage`[points to a valid Azure storage account](https://docs.microsoft.com/azure/azure-functions/functions-app-settings#azurewebjobsstorage). This storage is required for data persisted by Durable Functions. When you create a new Function app on Azure, it normally points to an automatically provisioned storage account. If you intend to run the app locally, you can either keep the "UseDevelopmentStorage=true" value in the sample local.settings.json (in this case you will also need to install and start Azure Storage Emulator), or replace it with a connection string pointing to a real Azure storage account.
67
67
-`AzureWebJobsFeatureFlags` must contain `AllowSynchronousIO`. Don't ask.
68
-
-`FUNCTIONS_WORKER_RUNTIME` must be set to `powershell`.
69
68
- 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.
70
69
71
-
##5. Starting the app
70
+
### 3. Deploy the app
72
71
73
-
If you have `UseDevelopmentStorage=true` as the `AzureWebJobsStorage` value, remember to start the Azure Storage Emulator.
72
+
If running locally, skip the step, otherwise deploy the app to Azure as you normally would.
74
73
75
-
Configure the environment variable FUNCTIONS_WORKER_RUNTIME_VERSION to select PowerShell 7:
74
+
### 4. Start the app
76
75
77
-
```PowerShell
78
-
$env:FUNCTIONS_WORKER_RUNTIME_VERSION = '~7'
79
-
```
76
+
If running locally:
77
+
- If you have `UseDevelopmentStorage=true` as the `AzureWebJobsStorage` value, remember to start the Azure Storage Emulator first.
78
+
- Configure the environment variable FUNCTIONS_WORKER_RUNTIME_VERSION to select PowerShell 7:
When you invoke FunctionChainingStart or FanOutFanInStart, it returns an HTTP 202 response with the orchestration management URLs, so you can start invoking statusQueryGetUri and wait for the orchestration to complete:
106
109
@@ -115,3 +118,7 @@ while ($true) {
115
118
}
116
119
}
117
120
```
121
+
122
+
### 8. Have fun, experiment, participate!
123
+
124
+
Please let us know how you use Durable PowerShell functions and what does not (_yet_) work as you expect. **Your feedback is highly appreciated**, please feel free to file [GitHub issues](https://github.com/Azure/azure-functions-powershell-worker/issues/new).
0 commit comments