Skip to content

Choosing a Worker Runtime

Shelvin Datt edited this page Mar 26, 2025 · 1 revision

Azure Functions Local Development: Choosing a Worker Runtime

The screenshot depicts the local development environment for Azure Functions, specifically the step where you're prompted to "Choose option:" for the worker runtime.

Key Observation:

  • The prompt lists various worker runtime options:
    • dotnet (isolated worker model)
    • dotnet (in-process model)
    • node
    • python
    • powershell
    • custom

Why is this happening?

This prompt typically appears during the initial setup or when the Azure Functions Core Tools are unable to determine the project's runtime based on the configuration.

The most common reason for this is the absence or misconfiguration of the local.settings.json file in your Azure Functions project directory.

Explanation:

The local.settings.json file plays a crucial role in local development. It stores:

  • Application settings: Environment variables, connection strings, etc., that your function app needs to run locally.
  • Runtime information: The FUNCTIONS_WORKER_RUNTIME setting, which specifies the language and runtime to be used.

If local.settings.json is missing or the FUNCTIONS_WORKER_RUNTIME setting is not defined, the Azure Functions Core Tools cannot automatically detect the runtime, hence prompting you to select one manually.

Solution:

  1. Create local.settings.json: If the file doesn't exist, create it in the root of your Azure Functions project directory.
  2. Add FUNCTIONS_WORKER_RUNTIME: Within the Values section of your local.settings.json file, add the FUNCTIONS_WORKER_RUNTIME setting with the appropriate value (e.g., "dotnet-isolated", "dotnet", "node", "python", "powershell").

Example local.settings.json (for Python):

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "python",
    "AzureWebJobsStorage": "UseDevelopmentStorage=true"
  }
}

Clone this wiki locally