Create Durable Functions using the Azure portal

The Durable Functions extension for Azure Functions is provided in the NuGet package Microsoft.Azure.WebJobs.Extensions.DurableTask. This extension must be installed in your function app. This article shows how to install this package so that you can develop durable functions in the Azure portal.


Create a function app

You must have a function app to host the execution of any function. A function app lets you group your functions as a logic unit for easier management, deployment, and sharing of resources. You can create a .NET or JavaScript app.

  1. From the Azure portal menu, select Create a resource.

    Add resource by using the Azure portal menu

  2. In the New page, select Compute > Function App.

  3. Use the function app settings as specified in the table below the image.


    Setting Suggested value Description
    Subscription Your subscription The subscription under which this new function app is created.
    Resource Group myResourceGroup Name for the new resource group in which to create your function app.
    Function App name Globally unique name Name that identifies your new function app. Valid characters are a-z (case insensitive), 0-9, and -.
    Publish Code Option to publish code files or a Docker container.
    Runtime stack Preferred language Choose a runtime that supports your favorite function programming language. Choose .NET for C# and F# functions.
    Region Preferred region Choose a region near you or near other services your functions access.

    Select the Next : Hosting > button.

  4. Enter the following settings for hosting.


    Setting Suggested value Description
    Storage account Globally unique name Create a storage account used by your function app. Storage account names must be between 3 and 24 characters in length and may contain numbers and lowercase letters only. You can also use an existing account, which must meet the storage account requirements.
    Operating system Preferred operating system An operating system is pre-selected for you based on your runtime stack selection, but you can change the setting if necessary.
    Plan Consumption plan Hosting plan that defines how resources are allocated to your function app. In the default Consumption Plan, resources are added dynamically as required by your functions. In this serverless hosting, you only pay for the time your functions run. When you run in an App Service plan, you must manage the scaling of your function app.

    Select the Next : Monitoring > button.

  5. Enter the following settings for monitoring.


    Setting Suggested value Description
    Application Insights Default Creates an Application Insights resource of the same App name in the nearest supported region. By expanding this setting, you can change the New resource name or choose a different Location in an Azure geography where you want to store your data.

    Select Review + Create to review the app configuration selections.

  6. Select Create to provision and deploy the function app.

  7. Select the Notification icon in the upper-right corner of the portal and watch for the Deployment succeeded message.

    Deployment notification

  8. Select Go to resource to view your new function app. You can also select Pin to dashboard. Pinning makes it easier to return to this function app resource from your dashboard.

By default, the function app created uses version 2.x of the Azure Functions runtime. The Durable Functions extension works on both versions 1.x and 2.x of the Azure Functions runtime in C#, and version 2.x in JavaScript. However, templates are only available when targeting version 2.x of the runtime regardless of the chosen language.

Install the durable-functions npm package (JavaScript only)

If you are creating JavaScript Durable Functions, you will need to install the durable-functions npm package.

  1. Select your function app's name, followed by Platform Features, then Advanced tools (Kudu).

    Functions platform features choose Kudu

  2. Inside the Kudu console, select Debug console then CMD.

    Kudu debug console

  3. Your function app's file directory structure should display. Navigate to the site/wwwroot folder. From there, you can upload a package.json file by dragging and dropping it into the file directory window. A sample package.json is below:

      "dependencies": {
        "durable-functions": "^1.3.1"

    Kudu upload package.json

  4. Once your package.json is uploaded, run the npm install command from the Kudu Remote Execution Console.

    Kudu run npm install

Create an orchestrator function

  1. Expand your function app and click the + button next to Functions. If this is the first function in your function app, select In-portal then Continue. Otherwise, go to step three.

    Functions quickstart page in the Azure portal

  2. Choose More templates then Finish and view templates.

    Functions quickstart choose more templates

  3. In the search field, type durable and then choose the Durable Functions HTTP starter template.

  4. When prompted, select Install to install the Azure DurableTask extension any dependencies in the function app. You only need to install the extension once for a give function app. After installation succeeds, select Continue.

    Install binding extensions

  5. After the installation completes, name the new function HttpStart and choose Create. The function created is used to start the orchestration.

  6. Create another function in the function app, this time by using the Durable Functions Orchestrator template. Name your new orchestration function HelloSequence.

  7. Create a third function named Hello by using the Durable Functions Activity template.

Test the durable function orchestration

  1. Go back to the HttpStart function, choose </> Get function URL and Copy the URL. You use this URL to start the HelloSequence function.

  2. Use an HTTP tool like Postman or cURL to send a POST request to the URL that you copied. The following example is a cURL command that sends a POST request to the durable function:

    curl -X POST https://{your-function-app-name}

    In this example, {your-function-app-name} is the domain that is the name of your function app. The response message contains a set of URI endpoints that you can use to monitor and manage the execution, which looks like the following example:

  3. Call the statusQueryGetUri endpoint URI and you see the current status of the durable function, which might look like this example:

            "runtimeStatus": "Running",
            "input": null,
            "output": null,
            "createdTime": "2017-12-01T05:37:33Z",
            "lastUpdatedTime": "2017-12-01T05:37:36Z"
  4. Continue calling the statusQueryGetUri endpoint until the status changes to Completed, and you see a response like the following example:

            "runtimeStatus": "Completed",
            "input": null,
            "output": [
                "Hello Tokyo!",
                "Hello Seattle!",
                "Hello London!"
            "createdTime": "2017-12-01T05:38:22Z",
            "lastUpdatedTime": "2017-12-01T05:38:28Z"

Your first durable function is now up and running in Azure.

Next steps