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
title: "AZFD0011: The FUNCTIONS_WORKER_RUNTIME setting is required"
3
+
titleSuffix: "Azure Functions"
4
+
description: "Learn how to troubleshoot the event 'AZFD0011: The FUNCTIONS_WORKER_RUNTIME setting is required' in Azure Functions."
5
+
ms.topic: reference
6
+
ms.date: 01/24/2024
7
+
8
+
---
9
+
10
+
# AZFD0011: The FUNCTIONS_WORKER_RUNTIME setting is required
11
+
12
+
This event occurs when a function app doesn't have the `FUNCTIONS_WORKER_RUNTIME` application setting, which is required.
13
+
14
+
|| Value |
15
+
|-|-|
16
+
|**Event ID**|AZFD0011|
17
+
|**Severity**|Warning|
18
+
19
+
## Event description
20
+
21
+
The `FUNCTIONS_WORKER_RUNTIME` application setting indicates the language or language stack on which the function app runs, such as `python`. For more information on valid values, see the [`FUNCTIONS_WORKER_RUNTIME`](../../functions-app-settings.md#functions_worker_runtime) reference.
22
+
23
+
While not currently required, you should always specify `FUNCTIONS_WORKER_RUNTIME` for your function apps. When you don't have this setting and the Functions host can't determine the correct language or language stack, you might see exceptions or unexpected behaviors.
24
+
25
+
Because `FUNCTIONS_WORKER_RUNTIME` is likely to become a required setting, you should explicitly set it in all of your existing function apps and deployment scripts to prevent any downtime in the future.
26
+
27
+
## How to resolve the event
28
+
29
+
In a production application, add `FUNCTIONS_WORKER_RUNTIME` to the [application settings](../../functions-how-to-use-azure-function-app-settings.md#settings).
30
+
31
+
When running locally in Azure Functions Core Tools, also add `FUNCTIONS_WORKER_RUNTIME` to the [local.settings.json file](../../functions-develop-local.md#local-settings-file).
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-dotnet-dependency-injection.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,13 +71,15 @@ This example uses the [Microsoft.Extensions.Http](https://www.nuget.org/packages
71
71
72
72
A series of registration steps run before and after the runtime processes the startup class. Therefore, keep in mind the following items:
73
73
74
-
-*The startup class is meant for only setup and registration.* Avoid using services registered at startup during the startup process. For instance, don't try to log a message in a logger that is being registered during startup. This point of the registration process is too early for your services to be available for use. After the `Configure` method is run, the Functions runtime continues to register additional dependencies, which can affect how your services operate.
74
+
-*The startup class is meant for only setup and registration.* Avoid using services registered at startup during the startup process. For instance, don't try to log a message in a logger that is being registered during startup. This point of the registration process is too early for your services to be available for use. After the `Configure` method is run, the Functions runtime continues to register other dependencies, which can affect how your services operate.
75
75
76
-
-*The dependency injection container only holds explicitly registered types*. The only services available as injectable types are what are setup in the `Configure` method. As a result, Functions-specific types like `BindingContext` and `ExecutionContext` aren't available during setup or as injectable types.
76
+
-*The dependency injection container only holds explicitly registered types*. The only services available as injectable types are what are set up in the `Configure` method. As a result, Functions-specific types like `BindingContext` and `ExecutionContext` aren't available during setup or as injectable types.
77
+
78
+
-*Configuring ASP.NET authentication isn't supported*. The Functions host configures ASP.NET authentication services to properly expose APIs for core lifecycle operations. Other configurations in a custom `Startup` class can override this configuration, causing unintended consequences. For example, calling `builder.Services.AddAuthentication()` can break authentication between the portal and the host, leading to messages such as [Azure Functions runtime is unreachable](./functions-recover-storage-account.md#aspnet-authentication-overrides).
77
79
78
80
## Use injected dependencies
79
81
80
-
Constructor injection is used to make your dependencies available in a function. The use of constructor injection requires that you do not use static classes for injected services or for your function classes.
82
+
Constructor injection is used to make your dependencies available in a function. The use of constructor injection requires that you don't use static classes for injected services or for your function classes.
81
83
82
84
The following sample demonstrates how the `IMyService` and `HttpClient` dependencies are injected into an HTTP-triggered function.
83
85
@@ -140,7 +142,7 @@ Application Insights is added by Azure Functions automatically.
140
142
141
143
### ILogger\<T\> and ILoggerFactory
142
144
143
-
The host injects `ILogger<T>` and `ILoggerFactory` services into constructors. However, by default these new logging filters are filtered out of the function logs. You need to modify the `host.json` file to opt-in to additional filters and categories.
145
+
The host injects `ILogger<T>` and `ILoggerFactory` services into constructors. However, by default these new logging filters are filtered out of the function logs. You need to modify the `host.json` file to optin to extra filters and categories.
144
146
145
147
The following example demonstrates how to add an `ILogger<HttpTrigger>` with logs that are exposed to the host.
146
148
@@ -206,7 +208,7 @@ Overriding services provided by the host is currently not supported. If there a
206
208
207
209
Values defined in [app settings](./functions-how-to-use-azure-function-app-settings.md#settings) are available in an `IConfiguration` instance, which allows you to read app settings values in the startup class.
208
210
209
-
You can extract values from the `IConfiguration` instance into a custom type. Copying the app settings values to a custom type makes it easy test your services by making these values injectable. Settings read into the configuration instance must be simple key/value pairs. Please note that, the functions running on Elastic Premium SKU has this constraint "App setting names can only contain letters, numbers (0-9), periods ("."), colons (":") and underscores ("_")"
211
+
You can extract values from the `IConfiguration` instance into a custom type. Copying the app settings values to a custom type makes it easy test your services by making these values injectable. Settings read into the configuration instance must be simple key/value pairs. For functions running in an Elastic Premium plan, application setting names can only contain letters, numbers (`0-9`), periods (`.`), colons (`:`) and underscores (`_`). For more information, see [App setting considerations](functions-app-settings.md#app-setting-considerations).
210
212
211
213
Consider the following class that includes a property named consistent with an app setting:
212
214
@@ -256,11 +258,11 @@ public class HttpTrigger
256
258
}
257
259
```
258
260
259
-
Refer to [Options pattern in ASP.NET Core](/aspnet/core/fundamentals/configuration/options) for more details regarding working with options.
261
+
For more information, see [Options pattern in ASP.NET Core](/aspnet/core/fundamentals/configuration/options).
260
262
261
263
## Using ASP.NET Core user secrets
262
264
263
-
When developing locally, ASP.NET Core provides a [Secret Manager tool](/aspnet/core/security/app-secrets#secret-manager) that allows you to store secret information outside the project root. It makes it less likely that secrets are accidentally committed to source control. Azure Functions Core Tools (version 3.0.3233 or later) automatically reads secrets created by the ASP.NET Core Secret Manager.
265
+
When you develop your app locally, ASP.NET Core provides a [Secret Manager tool](/aspnet/core/security/app-secrets#secret-manager) that allows you to store secret information outside the project root. It makes it less likely that secrets are accidentally committed to source control. Azure Functions Core Tools (version 3.0.3233 or later) automatically reads secrets created by the ASP.NET Core Secret Manager.
264
266
265
267
To configure a .NET Azure Functions project to use user secrets, run the following command in the project root.
266
268
@@ -278,9 +280,9 @@ To access user secrets values in your function app code, use `IConfiguration` or
278
280
279
281
## Customizing configuration sources
280
282
281
-
To specify additional configuration sources, override the `ConfigureAppConfiguration` method in your function app's `StartUp` class.
283
+
To specify other configuration sources, override the `ConfigureAppConfiguration` method in your function app's `StartUp` class.
282
284
283
-
The following sample adds configuration values from a base and an optional environment-specific app settings files.
285
+
The following sample adds configuration values from both base and optional environment-specific app settings files.
284
286
285
287
```csharp
286
288
usingSystem.IO;
@@ -314,7 +316,7 @@ Add configuration providers to the `ConfigurationBuilder` property of `IFunction
314
316
315
317
A `FunctionsHostBuilderContext` is obtained from `IFunctionsConfigurationBuilder.GetContext()`. Use this context to retrieve the current environment name and resolve the location of configuration files in your function app folder.
316
318
317
-
By default, configuration files such as *appsettings.json* are not automatically copied to the function app's output folder. Update your *.csproj* file to match the following sample to ensure the files are copied.
319
+
By default, configuration files such as `appsettings.json` aren't automatically copied to the function app's output folder. Update your `.csproj` file to match the following sample to ensure the files are copied.
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-recover-storage-account.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,15 +96,15 @@ For function apps that run on Linux in a container, the `Azure Functions runtime
96
96
97
97
1. Check for any logged errors that indicate that the container is unable to start successfully.
98
98
99
-
###Container image unavailable
99
+
## Container image unavailable
100
100
101
101
Errors can occur when the container image being referenced is unavailable or fails to start correctly. Check for any logged errors that indicate that the container is unable to start successfully.
102
102
103
103
You need to correct any errors that prevent the container from starting for the function app run correctly.
104
104
105
-
When the container image can't be found, you'll see a `manifest unknown` error in the Docker logs. In this case, you can use the Azure CLI commands documented at [How to target Azure Functions runtime versions](set-runtime-version.md?tabs=azurecli#manual-version-updates-on-linux) to change the container image being referenced. If you've deployed a [custom container image](./functions-how-to-custom-container.md), you need to fix the image and redeploy the updated version to the referenced registry.
105
+
When the container image can't be found, you see a `manifest unknown` error in the Docker logs. In this case, you can use the Azure CLI commands documented at [How to target Azure Functions runtime versions](set-runtime-version.md?tabs=azurecli#manual-version-updates-on-linux) to change the container image being referenced. If you've deployed a [custom container image](./functions-how-to-custom-container.md), you need to fix the image and redeploy the updated version to the referenced registry.
106
106
107
-
###App container has conflicting ports
107
+
## App container has conflicting ports
108
108
109
109
Your function app might be in an unresponsive state due to conflicting port assignment upon startup. This can happen in the following cases:
110
110
@@ -119,7 +119,12 @@ Starting with version 3.x of the Functions runtime, [host ID collision](storage-
119
119
120
120
## Read-only app settings
121
121
122
-
Changing any _read-only_[App Service application settings](../app-service/reference-app-settings.md#app-environment) can put your function app into an unreachable state.
122
+
Changing any _read-only_[App Service application settings](../app-service/reference-app-settings.md#app-environment) can put your function app into an unreachable state.
123
+
124
+
## ASP.NET authentication overrides
125
+
_Applies only to C# apps running [in-process with the Functions host](./functions-dotnet-class-library.md)._
126
+
127
+
Configuring ASP.NET authentication in a Functions startup class can override services that are required for the Azure portal to communicate with the host. This includes, but isn't limited to, any calls to `AddAuthentication()`. If the host's authentication services are overridden and the portal can't communicate with the host, it considers the app unreachable. This issue may result in errors such as: `No authentication handler is registered for the scheme 'ArmToken'.`.
0 commit comments