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
Copy file name to clipboardExpand all lines: articles/azure-functions/errors-diagnostics/diagnostic-events/azfd0011.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ ms.date: 01/24/2024
9
9
10
10
# AZFD0011: The FUNCTIONS_WORKER_RUNTIME setting is required
11
11
12
-
This event occurs when a function app does not have `FUNCTIONS_WORKER_RUNTIME`set as an application setting.
12
+
This event occurs when a function app doesn't have the `FUNCTIONS_WORKER_RUNTIME`application setting, which is required.
13
13
14
14
|| Value |
15
15
|-|-|
@@ -18,13 +18,15 @@ This event occurs when a function app does not have `FUNCTIONS_WORKER_RUNTIME` s
18
18
19
19
## Event description
20
20
21
-
The `FUNCTIONS_WORKER_RUNTIME` application setting is used to specify the language or language stack of the worker runtime to load in the function app. This corresponds to the language being used in your application (for example, `python`). For more information on valid values, see the [`FUNCTIONS_WORKER_RUNTIME`](../../functions-app-settings.md#functions_worker_runtime) reference.
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
22
23
-
In most cases, the Functions host can determine the proper language without this setting, but there are also cases where it cannot. This can result in exceptions or unexected behavior. For this reason, `FUNCTIONS_WORKER_RUNTIME` will be a required setting in a future version of the host. It is recommended that all existing applications and deployment scripts include this to prevent any downtime.
23
+
While note currently required, you should always specify `FUNCTIONS_WORKER_RUNTIME` for your function apps. If you don't use 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 future downtime.
24
26
25
27
## How to resolve the event
26
28
27
-
In a production application, add `FUNCTIONS_WORKER_RUNTIME` to the [application settings](../../functions-how-to-use-azure-function-app-settings.md).
29
+
In a production application, add `FUNCTIONS_WORKER_RUNTIME` to the [application settings](../../functions-how-to-use-azure-function-app-settings.md#settings).
28
30
29
31
When running locally in Azure Functions Core Tools, 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
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,15 +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
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. Additional configuration 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).
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).
79
79
80
80
## Use injected dependencies
81
81
82
-
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.
83
83
84
84
The following sample demonstrates how the `IMyService` and `HttpClient` dependencies are injected into an HTTP-triggered function.
85
85
@@ -142,7 +142,7 @@ Application Insights is added by Azure Functions automatically.
142
142
143
143
### ILogger\<T\> and ILoggerFactory
144
144
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 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.
146
146
147
147
The following example demonstrates how to add an `ILogger<HttpTrigger>` with logs that are exposed to the host.
148
148
@@ -208,7 +208,7 @@ Overriding services provided by the host is currently not supported. If there a
208
208
209
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.
210
210
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. 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).
212
212
213
213
Consider the following class that includes a property named consistent with an app setting:
214
214
@@ -258,11 +258,11 @@ public class HttpTrigger
258
258
}
259
259
```
260
260
261
-
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).
262
262
263
263
## Using ASP.NET Core user secrets
264
264
265
-
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.
266
266
267
267
To configure a .NET Azure Functions project to use user secrets, run the following command in the project root.
268
268
@@ -280,9 +280,9 @@ To access user secrets values in your function app code, use `IConfiguration` or
280
280
281
281
## Customizing configuration sources
282
282
283
-
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.
284
284
285
-
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.
286
286
287
287
```csharp
288
288
usingSystem.IO;
@@ -316,7 +316,7 @@ Add configuration providers to the `ConfigurationBuilder` property of `IFunction
316
316
317
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.
318
318
319
-
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.
0 commit comments