Skip to content

Commit ea2e643

Browse files
committed
New event + acrolinx
1 parent 8fd0ff0 commit ea2e643

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

articles/azure-functions/errors-diagnostics/diagnostic-events/azfd0011.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.date: 01/24/2024
99

1010
# AZFD0011: The FUNCTIONS_WORKER_RUNTIME setting is required
1111

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.
1313

1414
| | Value |
1515
|-|-|
@@ -18,13 +18,15 @@ This event occurs when a function app does not have `FUNCTIONS_WORKER_RUNTIME` s
1818

1919
## Event description
2020

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.
2222

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.
2426

2527
## How to resolve the event
2628

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).
2830

2931
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).
3032

articles/azure-functions/functions-dotnet-dependency-injection.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ This example uses the [Microsoft.Extensions.Http](https://www.nuget.org/packages
7171

7272
A series of registration steps run before and after the runtime processes the startup class. Therefore, keep in mind the following items:
7373

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.
7575

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.
7777

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).
7979

8080
## Use injected dependencies
8181

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.
8383

8484
The following sample demonstrates how the `IMyService` and `HttpClient` dependencies are injected into an HTTP-triggered function.
8585

@@ -142,7 +142,7 @@ Application Insights is added by Azure Functions automatically.
142142
143143
### ILogger\<T\> and ILoggerFactory
144144

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 opt in to extra filters and categories.
146146

147147
The following example demonstrates how to add an `ILogger<HttpTrigger>` with logs that are exposed to the host.
148148

@@ -208,7 +208,7 @@ Overriding services provided by the host is currently not supported. If there a
208208

209209
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.
210210

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).
212212

213213
Consider the following class that includes a property named consistent with an app setting:
214214

@@ -258,11 +258,11 @@ public class HttpTrigger
258258
}
259259
```
260260

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).
262262

263263
## Using ASP.NET Core user secrets
264264

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.
266266

267267
To configure a .NET Azure Functions project to use user secrets, run the following command in the project root.
268268

@@ -280,9 +280,9 @@ To access user secrets values in your function app code, use `IConfiguration` or
280280

281281
## Customizing configuration sources
282282

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.
284284

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.
286286

287287
```csharp
288288
using System.IO;
@@ -316,7 +316,7 @@ Add configuration providers to the `ConfigurationBuilder` property of `IFunction
316316

317317
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.
318318

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.
320320

321321
```xml
322322
<None Update="appsettings.json">

0 commit comments

Comments
 (0)