AZ-204Chapter 36 of 102Objective 1.1

Function App Settings and Configuration

This chapter covers Function App settings and configuration, a critical area for the AZ-204 exam that appears in roughly 15-20% of Compute domain questions. You will learn the purpose and mechanics of each setting, how to configure them via the Azure portal, CLI, and ARM templates, and how misconfiguration leads to common exam traps. Mastering these settings is essential for deploying scalable, secure, and maintainable serverless applications on Azure Functions.

25 min read
Intermediate
Updated May 31, 2026

Function App as a Customizable Factory

Imagine a factory that processes items on a conveyor belt. The factory itself is the Function App — it provides the building, power, and conveyor system. Each station along the belt represents a function, and the workers are the runtime. Now, the factory manager can adjust settings: the 'Application Settings' are like the master control panel that sets the factory's operating parameters — temperature, speed, and which raw materials to accept. 'Connection strings' are like the pipes that bring in water and electricity from external utilities. 'Environment variables' are like the whiteboard where the manager writes shift schedules and safety instructions that every worker can read. 'Function app settings' such as FUNCTIONS_WORKER_RUNTIME determine whether the workers speak C#, JavaScript, or Python. 'WEBSITE_RUN_FROM_PACKAGE' is like running the factory entirely from a pre-loaded blueprint on a USB drive — no installation needed, just plug and play. 'AzureWebJobsStorage' is the central warehouse where all work-in-progress and finished goods are tracked. If the warehouse connection breaks, the factory stops. Each setting must be correctly configured before the first item hits the belt; otherwise, the factory either fails to start or produces defective output. Just as a factory manager must know every dial and gauge, an Azure developer must master these settings to ensure reliable serverless execution.

How It Actually Works

What Are Function App Settings and Why Do They Exist?

Azure Functions is a serverless compute service that lets you run event-driven code without managing infrastructure. A Function App is the container that hosts one or more individual functions. The settings of a Function App control its runtime behavior, connectivity to other Azure services, security, performance, and deployment mechanics. They are the knobs and levers that turn a generic hosting container into a tailored execution environment.

On the AZ-204 exam, you must know which settings are available, their default values, how to configure them, and the impact of changing them. The exam tests not just recall but the ability to troubleshoot and choose the correct configuration for a given scenario.

How Function App Settings Work Internally

When you create a Function App in Azure, the platform provisions a dedicated App Service plan (consumption, premium, or dedicated) or runs on a Linux/Windows container. The settings you configure are stored in two places:

Application Settings: Key-value pairs stored in the Azure Resource Manager (ARM) metadata for the Function App. They are injected as environment variables into the function runtime process at startup. The runtime reads these variables to configure itself — for example, FUNCTIONS_WORKER_RUNTIME tells the host which language worker to load.

Connection Strings: Also stored in ARM metadata but treated specially: they can be encrypted at rest and are injected as environment variables with a prefix (e.g., SQLAZURECONNSTR_*, CUSTOMCONNSTR_*). The runtime and your code can access them via Environment.GetEnvironmentVariable.

At startup, the Functions host (the process that manages function execution) reads the configuration from the local appsettings.json file and then overlays it with values from Azure. The final effective configuration is a merge: Azure settings override local ones. This allows you to have different configurations for development, staging, and production without changing code.

Key Components, Values, Defaults, and Timers

#### FUNCTIONS_WORKER_RUNTIME - Purpose: Specifies the language runtime for the function app. - Valid values: dotnet (for .NET, C#), dotnet-isolated (for .NET 8+ isolated process), node (JavaScript), python, java, powershell. - Default: None — must be explicitly set when creating the app. - Exam trap: If you omit this setting, the Functions host will fail to start. The exam may present a scenario where a function app is created via CLI without --functions-worker-runtime and then the app doesn't work.

#### AzureWebJobsStorage - Purpose: Connection string to an Azure Storage account used by the Functions runtime for internal operations: managing triggers (blob, queue, timer), storing execution state, and coordinating scaling. - Default: None — must be provided. For consumption plan, this is mandatory. - Exam trap: The exam loves to ask what happens if this setting is missing. Answer: The function app will fail to start or will not process triggers correctly. For timer triggers, it will not fire.

#### WEBSITE_RUN_FROM_PACKAGE - Purpose: Tells the runtime to run the function app from a deployment package (a .zip file) stored in Azure Blob Storage or a URL. This is the recommended deployment method for production. - Valid values: 1 (enable from the package URL specified in WEBSITE_RUN_FROM_PACKAGE_URL), 0 (disable), or a URL directly. - Default: 0. - Mechanism: When enabled, the runtime downloads the package to local storage (under D:\home\data\SitePackages) and mounts it as the read-only app root. This eliminates file locking issues and improves cold-start performance. - Exam trap: If you set WEBSITE_RUN_FROM_PACKAGE=1 but don't provide a URL, the app will fail. Also, if you update the package but the app still uses the old version, you may need to restart the app.

#### FUNCTIONS_EXTENSION_VERSION - Purpose: Controls the version of the Azure Functions runtime host. - Valid values: ~4 (latest 4.x), ~3 (deprecated), ~2 (deprecated). - Default: ~4 when creating via portal. - Exam trap: The exam may ask which version to use for new apps. Always ~4. Also, if you need a specific minor version, you can pin to a full version like 4.0.13120.

#### WEBSITE_CONTENTAZUREFILECONNECTIONSTRING and WEBSITE_CONTENTSHARE - Purpose: Used in consumption and premium plans to store function app content on Azure Files. The connection string points to a storage account, and the share name is the file share where the app content is stored. - Default: Automatically generated when creating via portal. - Exam trap: If you delete the storage account or the file share, the function app will become unresponsive. The exam may present a scenario where the app stops working after storage cleanup.

#### FUNCTIONS_WORKER_PROCESS_COUNT - Purpose: For .NET isolated process, specifies the number of worker processes to use. Default is 1. This is used for process-level parallelism. - Exam relevance: Less common but may appear in advanced scenarios.

#### APPINSIGHTS_INSTRUMENTATIONKEY - Purpose: Enables integration with Application Insights for monitoring. - Default: None. - Exam trap: Without this, you lose telemetry. The exam may ask how to enable logging — answer: add this setting with the instrumentation key.

Configuration and Verification Commands

You can configure settings using Azure CLI, PowerShell, ARM templates, or the portal. Key CLI commands:

# Create a function app with settings
az functionapp create --name MyFunctionApp --storage-account MyStorage --resource-group MyRG --consumption-plan-location westus --runtime dotnet --functions-version 4

# List all settings
az functionapp config appsettings list --name MyFunctionApp --resource-group MyRG

# Set a setting
az functionapp config appsettings set --name MyFunctionApp --resource-group MyRG --settings "FUNCTIONS_EXTENSION_VERSION=~4" "AzureWebJobsStorage=DefaultEndpointsProtocol=https;AccountName=..."

# Delete a setting
az functionapp config appsettings delete --name MyFunctionApp --resource-group MyRG --setting-names "MySetting"

For ARM templates, settings are defined under properties.siteConfig.appSettings:

{
  "type": "Microsoft.Web/sites/config",
  "apiVersion": "2022-03-01",
  "name": "appsettings",
  "properties": {
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2021-02-01').keys[0].value)]"
  }
}

Interaction with Related Technologies

Azure Storage: AzureWebJobsStorage connects to a storage account. The runtime uses blob containers (azure-webjobs-hosts, azure-webjobs-secrets), queues (azure-webjobs-*), and tables for coordination.

Application Insights: APPINSIGHTS_INSTRUMENTATIONKEY sends telemetry to Application Insights. Without it, you lose visibility into function execution.

Key Vault: You can reference Key Vault secrets in app settings using @Microsoft.KeyVault(SecretUri=https://myvault.vault.azure.net/secrets/mysecret/). This is a secure way to store sensitive values.

Deployment Slots: Each slot can have its own app settings. You can mark settings as 'sticky' (slot-specific) so they don't swap with the production slot.

Best Practices for Exam Scenarios

Always set FUNCTIONS_WORKER_RUNTIME and AzureWebJobsStorage when creating a function app.

Use WEBSITE_RUN_FROM_PACKAGE=1 for production deployments to avoid file locking and improve cold starts.

Store sensitive settings like connection strings in Key Vault and reference them via @Microsoft.KeyVault(...).

For consumption plan, ensure the storage account is in the same region to avoid latency.

Use FUNCTIONS_EXTENSION_VERSION=~4 for all new apps.

Common Exam Questions on Settings

What happens if AzureWebJobsStorage is missing? The function app fails to start or triggers don't fire.

How to enable runtime scaling? Set FUNCTIONS_WORKER_PROCESS_COUNT > 1 for isolated process.

How to change runtime version? Update FUNCTIONS_EXTENSION_VERSION.

How to deploy from a package? Set WEBSITE_RUN_FROM_PACKAGE=1 and provide the URL via WEBSITE_RUN_FROM_PACKAGE_URL.

Advanced: Slot-Specific Settings and Sticky Settings

When using deployment slots, you can mark certain app settings as "sticky" (slot-specific). These settings stay with the slot during swaps. For example, you might have a staging slot with a different AzureWebJobsStorage pointing to a test storage account. To make a setting sticky, use the --slot-settings flag in CLI or the slotConfigNames property in ARM.

az functionapp config appsettings set --name MyFunctionApp --resource-group MyRG --slot-settings "MyStickySetting=value"

Troubleshooting with Kudu

You can view the effective environment variables by navigating to https://<functionappname>.scm.azurewebsites.net/Env.cshtml. This is useful for debugging configuration issues.

Performance Considerations

WEBSITE_RUN_FROM_PACKAGE reduces cold start time because the runtime doesn't need to deploy files; it directly mounts the package.

AzureWebJobsStorage should be a general-purpose v2 storage account (not blob-only) because queues and tables are needed.

For high-throughput scenarios, consider using a premium plan with dedicated workers and tune FUNCTIONS_WORKER_PROCESS_COUNT.

Security Implications

Connection strings and keys stored in app settings are encrypted at rest but can be accessed by anyone with contributor access to the function app. Use Key Vault references for production.

Setting WEBSITE_RUN_FROM_PACKAGE to a public URL can expose your code. Always use a SAS token or managed identity to access the package blob.

Summary of Key Defaults

| Setting | Default | Mandatory? | |---|---|---| | FUNCTIONS_WORKER_RUNTIME | None | Yes | | AzureWebJobsStorage | None | Yes (consumption) | | FUNCTIONS_EXTENSION_VERSION | ~4 | Yes | | WEBSITE_RUN_FROM_PACKAGE | 0 | No | | APPINSIGHTS_INSTRUMENTATIONKEY | None | No (recommended) |

Interaction with App Service Plan

Consumption plan: AzureWebJobsStorage is mandatory; scaling is automatic based on triggers.

Premium plan: Same as consumption but with pre-warmed instances and VNet integration.

Dedicated plan: You can use any storage account; scaling is manual or auto-scale based on metrics.

Exam Tip: The 'Missing Setting' Trap

The exam often presents a scenario where a function app was created but is not working. You check the logs and see an error like "No job functions found. Try making your job classes public." This is often due to missing FUNCTIONS_WORKER_RUNTIME. Another common error: "The 'AzureWebJobsStorage' connection string is not set." Always check these two first.

Code Example: Accessing Settings in a Function

public static void Run([TimerTrigger("0 */5 * * * *")] TimerInfo myTimer, ILogger log)
{
    string storageConnection = Environment.GetEnvironmentVariable("AzureWebJobsStorage");
    log.LogInformation($"Storage connection: {storageConnection}");
}

For .NET isolated, use IConfiguration:

public class Function1
{
    private readonly IConfiguration _configuration;
    public Function1(IConfiguration configuration)
    {
        _configuration = configuration;
    }
    [Function("Function1")]
    public void Run([TimerTrigger("0 */5 * * * *")] TimerInfo myTimer, FunctionContext context)
    {
        string value = _configuration["MySetting"];
    }
}

This covers the core explanation of Function App settings and configuration. The next sections will solidify your understanding with step-by-step procedures, real-world scenarios, and exam-focused insights.

Walk-Through

1

Create a Function App with CLI

Use the Azure CLI to create a function app. First, create a resource group: `az group create --name MyRG --location westus`. Then create a storage account: `az storage account create --name mystorageaccount --location westus --resource-group MyRG --sku Standard_LRS`. Finally, create the function app: `az functionapp create --name MyFunctionApp --storage-account mystorageaccount --resource-group MyRG --consumption-plan-location westus --runtime dotnet --functions-version 4`. This sets `FUNCTIONS_WORKER_RUNTIME` to `dotnet` and `FUNCTIONS_EXTENSION_VERSION` to `~4`. The `AzureWebJobsStorage` is automatically configured to point to the storage account. If you omit `--runtime`, the command fails. Verify with `az functionapp config appsettings list`.

2

Configure Application Settings via Portal

In the Azure portal, navigate to your Function App. Under Settings, select Configuration. Here you see Application settings and Connection strings. Click 'New application setting' to add a key-value pair. For example, add `MyCustomSetting` with value `HelloWorld`. This setting becomes an environment variable accessible via `Environment.GetEnvironmentVariable("MyCustomSetting")`. You can also toggle 'Deployment slot setting' to make it sticky. For connection strings, choose the type (SQLAzure, Custom, etc.) and the value will be injected with a prefix. Save and the app restarts. The portal shows a JSON view of all settings.

3

Set WEBSITE_RUN_FROM_PACKAGE for Deployment

To deploy from a package, first build your function app and zip it. Upload the zip to a blob container in your storage account. Generate a SAS URL with read permissions. Then set `WEBSITE_RUN_FROM_PACKAGE=1` and `WEBSITE_RUN_FROM_PACKAGE_URL=<SAS URL>` via CLI or portal. The runtime will download the package on startup. To update, upload a new zip and update the URL (or use the same URL with a new version). Restart the app to pick up changes. Verify by checking the app root – it should be read-only. This method improves cold start and avoids file locking.

4

Enable Application Insights Integration

To enable monitoring, create an Application Insights resource: `az monitor app-insights component create --app MyAppInsights --location westus --resource-group MyRG`. Get the instrumentation key: `az monitor app-insights component show --app MyAppInsights --resource-group MyRG --query instrumentationKey -o tsv`. Then set it as an app setting: `az functionapp config appsettings set --name MyFunctionApp --resource-group MyRG --settings "APPINSIGHTS_INSTRUMENTATIONKEY=<key>"`. The runtime will automatically send telemetry. You can also set `APPLICATIONINSIGHTS_CONNECTION_STRING` for newer SDKs. Verify by checking Application Insights logs after running a function.

5

Use Key Vault References in Settings

Store sensitive values like connection strings in Azure Key Vault. First, create a Key Vault and a secret. Grant the function app's managed identity access to read secrets: `az keyvault set-policy --name MyVault --object-id <function-app-identity> --secret-permissions get`. Then set the app setting value to a reference: `@Microsoft.KeyVault(SecretUri=https://myvault.vault.azure.net/secrets/mysecret/)`. The runtime will resolve this at startup. This avoids storing secrets in plain text. Note: The function app must have a system-assigned managed identity enabled. Test by accessing the setting in code.

What This Looks Like on the Job

Enterprise Scenario 1: E-Commerce Order Processing

A large e-commerce company uses Azure Functions to process orders as they arrive from a web frontend. The function app runs on a consumption plan and uses blob triggers to process new order files. The team configured AzureWebJobsStorage to point to a general-purpose v2 storage account in the same region as the function app to minimize latency. They also set WEBSITE_RUN_FROM_PACKAGE=1 to ensure consistent deployments across thousands of instances during peak shopping seasons. The APPINSIGHTS_INSTRUMENTATIONKEY was set to monitor execution times and error rates. One day, orders stopped processing. The team discovered that the storage account key had been rotated, but the AzureWebJobsStorage setting still held the old key. They updated it via the portal and restarted the app. The lesson: always use Key Vault references for connection strings to avoid manual updates. In production, they also enabled slot-specific settings for staging vs production, using sticky settings for AzureWebJobsStorage to prevent the staging slot from accidentally processing production orders during a swap.

Enterprise Scenario 2: Microservices with Durable Functions

A financial services firm uses Durable Functions to orchestrate complex workflows for loan approvals. Each function app hosts multiple orchestrator and activity functions. They needed to scale out to handle thousands of concurrent orchestrations. They configured FUNCTIONS_WORKER_PROCESS_COUNT=4 for the .NET isolated process to utilize multiple cores. They also set FUNCTIONS_EXTENSION_VERSION=~4 to use the latest runtime. The AzureWebJobsStorage was a premium storage account to handle high throughput. They used WEBSITE_RUN_FROM_PACKAGE with a SAS URL that included a short expiry to ensure security. During a performance test, they noticed that cold starts were causing delays. They mitigated by enabling a premium plan with pre-warmed instances. The team learned that while settings can be changed on the fly, some changes (like switching from consumption to premium) require recreating the function app. They also used deployment slots to test configuration changes before production.

Common Misconfiguration Pitfalls

Missing `AzureWebJobsStorage`: The function app starts but triggers never fire. The portal shows 'Waiting for host' indefinitely. Always verify this setting.

Wrong storage account type: Using a blob-only storage account (StorageV2 with hierarchical namespace) will fail because Functions needs queues and tables. Use general-purpose v2.

Incorrect `FUNCTIONS_WORKER_RUNTIME`: Setting dotnet for a Python app causes the host to fail with 'No job functions found'. Double-check the runtime.

Not restarting after settings change: Some settings take effect immediately, but for WEBSITE_RUN_FROM_PACKAGE_URL, you must restart the app. The exam may ask: 'You updated the package URL but the app still runs old code. What should you do?' Answer: Restart the function app.

How AZ-204 Actually Tests This

What AZ-204 Tests on This Topic

AZ-204 objective 1.1 (Compute) includes 'Create and configure Azure Functions' and specifically tests your ability to manage Function App settings. You should expect questions that ask:

Which setting is missing when a function app fails to start?

How to enable deployment from a package?

How to integrate Application Insights?

How to store secrets securely?

How to use slot-specific settings?

Top 4 Wrong Answers Candidates Choose

1.

'The function app will run without `AzureWebJobsStorage` if you are using a timer trigger.' This is false. All trigger types require AzureWebJobsStorage for the runtime to manage leases and state. Without it, even timer triggers fail.

2.

'Setting `WEBSITE_RUN_FROM_PACKAGE=1` automatically deploys the latest code from source control.' No, it just tells the runtime to run from a package; you still need to upload the package and set the URL.

3.

'Connection strings in app settings are automatically encrypted in transit.' They are encrypted at rest, but in transit they are sent over HTTPS. However, the exam may test that they are not encrypted in memory.

4.

'You can change the runtime version by updating `FUNCTIONS_WORKER_RUNTIME`.' This setting only specifies the language; the runtime version is controlled by FUNCTIONS_EXTENSION_VERSION.

Numbers, Values, and Terms That Appear Verbatim

FUNCTIONS_EXTENSION_VERSION default: ~4

FUNCTIONS_WORKER_RUNTIME values: dotnet, dotnet-isolated, node, python, java, powershell

WEBSITE_RUN_FROM_PACKAGE valid values: 0, 1, or a URL

AzureWebJobsStorage required for consumption plan

Sticky settings: use –slot-settings flag

Key Vault reference syntax: @Microsoft.KeyVault(SecretUri=...)

Edge Cases and Exceptions

Linux vs Windows: Some settings are platform-specific. For example, WEBSITE_RUN_FROM_PACKAGE works on both, but file paths differ. On Linux, the package is mounted under /home/site/wwwroot.

Local development: When running locally, settings come from local.settings.json, and AzureWebJobsStorage can use UseDevelopmentStorage=true for the local emulator. The exam may ask about differences between local and Azure.

Slot swaps: If a setting is not marked sticky, it swaps with the slot. This can cause production to use staging settings if not careful.

How to Eliminate Wrong Answers

If a question involves a function app that won't start, immediately check if FUNCTIONS_WORKER_RUNTIME and AzureWebJobsStorage are set. If the scenario mentions 'triggers not firing', suspect AzureWebJobsStorage.

If the question is about secure storage, Key Vault references are the answer — not plain settings or connection strings.

If the question mentions deployment and the app runs old code, the fix is to restart the app or update the package URL and restart.

For scaling questions, remember that FUNCTIONS_WORKER_PROCESS_COUNT only applies to .NET isolated process and premium/dedicated plans.

Key Takeaways

Always set FUNCTIONS_WORKER_RUNTIME and AzureWebJobsStorage when creating a function app.

WEBSITE_RUN_FROM_PACKAGE=1 is the recommended deployment method for production; it improves cold start and avoids file locking.

Use Key Vault references (@Microsoft.KeyVault(...)) for sensitive settings like connection strings.

FUNCTIONS_EXTENSION_VERSION=~4 is the default for new function apps; never use deprecated versions.

Sticky settings (slot-specific) prevent settings from swapping during deployment slot swaps; use --slot-settings.

Application Insights integration requires setting APPINSIGHTS_INSTRUMENTATIONKEY or APPLICATIONINSIGHTS_CONNECTION_STRING.

Missing AzureWebJobsStorage causes triggers to fail; the host may start but won't process events.

Connection strings in app settings are prefixed based on type (e.g., SQLAZURECONNSTR_, CUSTOMCONNSTR_).

Deployment slots allow testing configuration changes before production; settings can be swapped or sticky.

Always restart the function app after changing WEBSITE_RUN_FROM_PACKAGE_URL or other critical settings.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

Consumption Plan

Scales automatically based on number of events; no reserved capacity

Billed per execution and resource consumption (GB-s)

Cold starts can cause latency; max execution timeout is 10 minutes (default 5)

AzureWebJobsStorage is mandatory; storage account must be in same region

Supports only certain runtime versions; limited to 1 GB memory

Dedicated Plan (App Service)

Scales manually or via auto-scale rules; reserved instances

Billed per hour for the VM instances (App Service Plan)

No cold starts if instances are always running; execution timeout can be up to 30 minutes (or unlimited if Always On is enabled)

AzureWebJobsStorage is optional but recommended; storage account can be in any region

Supports any runtime version; memory up to 14 GB (depending on plan size)

Watch Out for These

Mistake

AzureWebJobsStorage is optional for HTTP-triggered functions.

Correct

False. Even HTTP-triggered functions require AzureWebJobsStorage for the runtime to manage host state, secrets, and coordination. Without it, the host fails to start.

Mistake

Setting WEBSITE_RUN_FROM_PACKAGE to 1 automatically deploys code from a repository.

Correct

No. It only enables running from a package. You must provide the package URL via WEBSITE_RUN_FROM_PACKAGE_URL or the app will fail.

Mistake

FUNCTIONS_WORKER_RUNTIME and FUNCTIONS_EXTENSION_VERSION are the same thing.

Correct

They are different. FUNCTIONS_WORKER_RUNTIME specifies the language (e.g., dotnet, node), while FUNCTIONS_EXTENSION_VERSION specifies the Azure Functions runtime version (e.g., ~4).

Mistake

You can change the runtime version by updating FUNCTIONS_WORKER_RUNTIME.

Correct

No. Changing FUNCTIONS_WORKER_RUNTIME only changes the language worker; the runtime version remains as set by FUNCTIONS_EXTENSION_VERSION.

Mistake

Application settings are encrypted in transit and at rest, so they are completely secure.

Correct

They are encrypted at rest in Azure storage, but in transit they are sent over HTTPS. However, anyone with Contributor access to the function app can read them in plain text. For sensitive data, use Key Vault references.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the purpose of AzureWebJobsStorage in Azure Functions?

AzureWebJobsStorage is a connection string to an Azure Storage account that the Functions runtime uses internally. It stores runtime state, manages triggers (blob, queue, timer), coordinates scaling, and holds secrets. Without it, the function app cannot start or process triggers. It is mandatory for consumption and premium plans. Use a general-purpose v2 storage account (not blob-only) because queues and tables are required.

How do I deploy Azure Functions from a package?

Set WEBSITE_RUN_FROM_PACKAGE=1 and provide the package URL via WEBSITE_RUN_FROM_PACKAGE_URL. The package should be a .zip file uploaded to Azure Blob Storage with a SAS token for secure access. The runtime downloads and mounts the package as read-only. To update, upload a new package and update the URL, then restart the function app. This method is recommended for production because it eliminates file locking and reduces cold start times.

What is the difference between FUNCTIONS_WORKER_RUNTIME and FUNCTIONS_EXTENSION_VERSION?

FUNCTIONS_WORKER_RUNTIME specifies the language runtime for your function code (e.g., dotnet, node, python). FUNCTIONS_EXTENSION_VERSION specifies the version of the Azure Functions host runtime (e.g., ~4 for the latest 4.x). Changing the worker runtime changes the language, while changing the extension version updates the underlying host. Both are required for the function app to work.

How do I securely store connection strings for Azure Functions?

Use Azure Key Vault references in your app settings. Instead of storing the connection string directly, set the value to @Microsoft.KeyVault(SecretUri=https://myvault.vault.azure.net/secrets/mysecret/). The function app must have a managed identity with Get permission on the secret. This avoids storing secrets in plain text and allows centralized management. Alternatively, use App Service's built-in connection string encryption, but Key Vault is more secure.

Why is my timer trigger not firing?

Check that AzureWebJobsStorage is set correctly. Timer triggers rely on the storage account to store lease information and schedule the next invocation. If the connection string is missing, invalid, or the storage account is in a different region, the trigger may not fire. Also verify that the function app is running (not stopped) and that the timer expression is correct. Use Application Insights to see if the function is being invoked.

What are sticky settings in deployment slots?

Sticky settings (also called slot-specific settings) are app settings that remain with a slot during a swap. For example, you can mark AzureWebJobsStorage as sticky so that the staging slot always uses its own storage account, even after swapping with production. This prevents accidental data corruption. To configure, use the --slot-settings flag in CLI or check 'Deployment slot setting' in the portal.

Can I change the runtime version of an existing function app?

Yes, you can change the FUNCTIONS_EXTENSION_VERSION setting to a different version (e.g., from ~3 to ~4). However, this may cause breaking changes if your code uses deprecated APIs. Always test in a staging slot first. The change takes effect after a restart. Note that you cannot downgrade to a version that doesn't support your runtime (e.g., .NET 6 requires ~4).

Terms Worth Knowing

Ready to put this to the test?

You've just covered Function App Settings and Configuration — now see how well it sticks with free AZ-204 practice questions. Full explanations included, no account needed.

Done with this chapter?