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: "AZFD0013: The configured runtime does not match the worker runtime metadata found in the deployed function app artifacts."
3
+
titleSuffix: "Azure Functions"
4
+
description: "Learn how to troubleshoot the event 'AZFD0013: The configured runtime does not match the worker runtime metadata found in the deployed function app artifacts' in Azure Functions."
5
+
ms.topic: reference
6
+
ms.date: 09/03/2024
7
+
8
+
---
9
+
10
+
# AZFD0013: The configured runtime does not match the worker runtime metadata found in the deployed function app artifacts
11
+
12
+
This event occurs when a function app has a `FUNCTIONS_WORKER_RUNTIME` setting specifying a language stack, but a payload for a different stack is deployed to it.
13
+
14
+
|| Value |
15
+
|-|-|
16
+
|**Event ID**|AZFD0013|
17
+
|**Severity**|Warning or Error|
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`][fwr] reference. The deployed application must correspond with the provided value. If there is a mismatch, it means that either the value of `FUNCTIONS_WORKER_RUNTIME` is incorrect, or that an unexpected payload was deployed to the application.
22
+
23
+
This event may appear for apps that were previously using inconsistent and undefined behavior to continue running while in a mismatch state. Follow the instructions in this article to resolve the event for these applications. Doing so allows these apps to take advantage of performance enhancements and ensure that they can continue to operate as expected.
24
+
25
+
.NET apps undergoing a [migration from the in-process model to the isolated worker][isolated-migration] may encounter this event temporarily during that process. When `FUNCTIONS_WORKER_RUNTIME` is updated to "dotnet-isolated", but the application is still using an in-process model payload, this event may appear until the migration is completed. See the migration guidance for instructions on using deployment slots to prevent this event from appearing in your production environment.
26
+
27
+
## How to resolve the event
28
+
29
+
The event message indicates the current value of `FUNCTIONS_WORKER_RUNTIME` and the detected runtime metadata from the app payload. The values must be aligned, either by deploying an application of the appropriate type or by updating the value of `FUNCTIONS_WORKER_RUNTIME` to match.
30
+
31
+
For most applications, the correct resolution is to update the value of [`FUNCTIONS_WORKER_RUNTIME`][fwr]. To do so, on your function app in Azure, set the `FUNCTIONS_WORKER_RUNTIME`[application setting][app-settings] to the [expected value][fwr] for your application payload. When running locally in the Azure Functions Core Tools, you should also add `FUNCTIONS_WORKER_RUNTIME` to the [local.settings.json file](../../functions-develop-local.md#local-settings-file).
32
+
33
+
For apps following a migration guide, see that guide for relevant instructions. [Migrating .NET applications to the isolated worker model][isolated-migration] involves first setting `FUNCTIONS_WORKER_RUNTIME` to "dotnet-isolated" before deploying the updated application payload, and this event may appear temporarily between those steps.
Copy file name to clipboardExpand all lines: articles/azure-functions/migrate-dotnet-to-isolated-model.md
+34-19Lines changed: 34 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ This guide assumes that your app is running on version 4.x of the Functions runt
21
21
-[Migrate apps from Azure Functions version 2.x and 3.x to version 4.x](./migrate-version-3-version-4.md)
22
22
-[Migrate apps from Azure Functions version 1.x to version 4.x](./migrate-version-1-version-4.md)
23
23
24
-
These host version migration guides will also help you migrate to the isolated worker model as you work through them.
24
+
These host version migration guides also help you migrate to the isolated worker model as you work through them.
25
25
26
26
## Identify function apps to migrate
27
27
@@ -60,22 +60,22 @@ This guide doesn't present specific examples for .NET 7 or .NET 6. If you need t
60
60
61
61
If you haven't already, identify the list of apps that need to be migrated in your current Azure Subscription by using the [Azure PowerShell](#identify-function-apps-to-migrate).
62
62
63
-
Before you migrate an app to the isolated worker model, you should thoroughly review the contents of this guide and familiarize yourself with the features of the [isolated worker model][isolated-guide] and the [differences between the two models](./dotnet-isolated-in-process-differences.md).
63
+
Before you migrate an app to the isolated worker model, you should thoroughly review the contents of this guide. You should also familiarize yourself with the features of the [isolated worker model][isolated-guide] and the [differences between the two models](./dotnet-isolated-in-process-differences.md).
64
64
65
65
To migrate the application, you will:
66
66
67
-
1.Complete the steps in [Migrate your local project](#migrate-your-local-project) to migrate your local project to the isolated worker model.
67
+
1.Migrate your local project to the isolated worker model by following the steps in [Migrate your local project](#migrate-your-local-project).
68
68
1. After migrating your project, fully test the app locally using version 4.x of the [Azure Functions Core Tools](functions-run-local.md).
69
69
1.[Update your function app in Azure](#update-your-function-app-in-azure) to the isolated model.
70
70
71
71
## Migrate your local project
72
72
73
-
The section outlines the various changes that you need to make to your local project to move it to the isolated worker model. Some of the steps change based on your target version of .NET. Use the tabs to select the instructions which match your desired version. These steps assume a local C# project, and if your app is instead using C# script (`.csx` files), you should [convert to the project model](./functions-reference-csharp.md#convert-a-c-script-app-to-a-c-project) before continuing.
73
+
The section outlines the various changes that you need to make to your local project to move it to the isolated worker model. Some of the steps change based on your target version of .NET. Use the tabs to select the instructions that match your desired version. These steps assume a local C# project, and if your app is instead using C# script (`.csx` files), you should [convert to the project model](./functions-reference-csharp.md#convert-a-c-script-app-to-a-c-project) before continuing.
74
74
75
75
> [!TIP]
76
76
> If you are moving to an LTS or STS version of .NET, the [.NET Upgrade Assistant] can be used to automatically make many of the changes mentioned in the following sections.
77
77
78
-
First, you'll convert the project file and update your dependencies. As you do, you will see build errors for the project. In subsequent steps, you'll make the corresponding changes to remove these errors.
78
+
First, convert the project file and update your dependencies. As you do, you will see build errors for the project. In subsequent steps, you'll make the corresponding changes to remove these errors.
79
79
80
80
### Project file
81
81
@@ -186,17 +186,17 @@ Some key types change between the in-process model and the isolated worker model
186
186
- How the function obtains an `ILogger`/`ILogger<T>`
187
187
- Trigger and binding attributes and parameters
188
188
189
-
The rest of this section will walk you through each of these steps.
189
+
The rest of this section walks you through each of these steps.
190
190
191
191
#### Function attributes
192
192
193
-
The `FunctionName` attribute is replaced by the `Function` attribute in the isolated worker model. The new attribute has the same signature, and the only difference is in the name. You can therefore just perform a string replacement across your project.
193
+
The `Function` attribute in the isolated worker model replaces the `FunctionName` attribute. The new attribute has the same signature, and the only difference is in the name. You can therefore just perform a string replacement across your project.
194
194
195
195
#### Logging
196
196
197
-
In the in-process model, you could include an additional`ILogger` parameter to your function, or you could use dependency injection to get an `ILogger<T>`. If you were already using dependency injection, the same mechanisms work in the isolated worker model.
197
+
In the in-process model, you could include an optional`ILogger` parameter to your function, or you could use dependency injection to get an `ILogger<T>`. If your app already used dependency injection, the same mechanisms work in the isolated worker model.
198
198
199
-
However, for any Functions that relied on the `ILogger` method parameter, you will need to make a change. It is recommended that you use dependency injection to obtain an `ILogger<T>`. Use the following steps to migrate the function's logging mechanism:
199
+
However, for any Functions that relied on the `ILogger` method parameter, you need to make a change. It is recommended that you use dependency injection to obtain an `ILogger<T>`. Use the following steps to migrate the function's logging mechanism:
200
200
201
201
1. In your function class, add a `private readonly ILogger<MyFunction> _logger;` property, replacing `MyFunction` with the name of your function class.
202
202
1. Create a constructor for your function class that takes in the `ILogger<T>` as a parameter:
@@ -207,7 +207,7 @@ However, for any Functions that relied on the `ILogger` method parameter, you wi
1. For logging operations in your function code, replace references to the `ILogger` parameter with `_logger`.
213
213
1. Remove the `ILogger` parameter from your function signature.
@@ -223,8 +223,8 @@ When you [changed your package references in a previous step](#package-reference
223
223
1. Foreachbindingattribute, changetheattribute's name as specified in its reference documentation, which you can find in the [Supported bindings](./functions-triggers-bindings.md#supported-bindings) index. In general, the attribute names change as follows:
Upgrading your function app to the isolated model consists of two steps:
371
+
Updating your function app to the isolated model involves two changes that should be completed together, because if you only complete one, the app is in an error state. Both of these changes also cause the app process to restart. For these reasons, you should perform the update using a [staging slot](./functions-deployment-slots.md). Staging slots help minimize downtime for your app and allow you to test and verify your migrated code with your updated configuration in Azure. You can then deploy your fully migrated app to the production slot through a swap operation.
372
372
373
-
1. Change the configuration of the function app to use the isolated model by setting the `FUNCTIONS_WORKER_RUNTIME` application setting to `dotnet-isolated`. Make sure that any deployment automation is similarly updated.
374
-
2. Publish your migrated project to the updated function app.
373
+
> [!IMPORTANT]
374
+
> [When an app's deployed payload doesn't match the configured runtime, it will be in an error state](./errors-diagnostics/diagnostic-events/azfd0013.md). During the migration process, you will put the app into this state, ideally only temporarily. Deployment slots help mitigate the impact of this, because the error state will be resolved in your staging (non-production) environment before the changes are applied as single update to your production environment. Slots also defend against any mistakes and allow you to detect any other issues before reaching production.
375
+
>
376
+
> During the process, you might still see errors in logs coming from your staging (non-production) slot. This is expected, though these should go away as you proceed through the steps. Before you perform the slot swap operation, you should confirm that these errors stop being raised and that your application is working as expected.
377
+
378
+
Use the following steps to use deployment slots to update your function app to the isolated worker model:
379
+
380
+
1.[Create a deployment slot](./functions-deployment-slots.md#add-a-slot) if you haven't already. You might also want to familiarize yourself with the slot swap process and ensure that you can make updates to the existing application with minimal disruption.
381
+
1. Change the configuration of the staging (non-production) slot to use the isolated worker model by setting the `FUNCTIONS_WORKER_RUNTIME` application setting to `dotnet-isolated`. `FUNCTIONS_WORKER_RUNTIME` should **not** be marked as a "slot setting".
382
+
383
+
If you are also targeting a different version of .NET as part of your update, you should also change the stack configuration. To do so, see the [instructions to update the stack configuration for the isolated worker model](./update-language-versions.md?pivots=programming-language-csharp#update-the-stack-configuration). You will use the same instructions for any future .NET version updates you make.
384
+
385
+
If you have any automated infrastructure provisioning such as a CI/CD pipeline, make sure that the automations are also updated to keep `FUNCTIONS_WORKER_RUNTIME` set to `dotnet-isolated` and to target the correct .NET version.
375
386
376
-
When you use Visual Studio to publish an isolated worker model project to an existing function app that uses the in-process model, you're prompted to let Visual Studio update the function app during deployment. This accomplishes both steps at once.
387
+
1. Publish your migrated project to the staging (non-production) slot of your function app.
388
+
389
+
If you use Visual Studio to publish an isolated worker model project to an existing app or slot that uses the in-process model, it can also complete the previous step for you at the same time. If you did not complete the previous step, Visual Studio prompts you to update the function app during deployment. Visual Studio presents this as a single operation, but these are still two separate operations. You might still see errors in your logs from the staging (non-production) slot during the interim state.
377
390
378
-
If you need to minimize downtime, consider using a [staging slot](functions-deployment-slots.md) to test and verify your migrated code with your updated configuration in Azure. You can then deploy your fully migrated app to the production slot through a swap operation.
391
+
1. Confirm that your application is working as expected within the staging (non-production) slot.
392
+
1. Perform a [slot swap operation](./functions-deployment-slots.md#swap-slots). This applies the changes you made in your staging (non-production) slot to the production slot. A slot swap happens as a single update, which avoids introducing the interim error state in your production environment.
393
+
1. Confirm that your application is working as expected within the production slot.
379
394
380
-
Once you've completed these steps, your app has been fully migrated to the isolated model. Congratulations! Repeat the steps from this guide as necessary for [any other apps needing migration](#identify-function-apps-to-migrate).
395
+
Once you complete these steps, the migration is complete, and your app runs on the isolated model. Congratulations! Repeat the steps from this guide as necessary for [any other apps needing migration](#identify-function-apps-to-migrate).
0 commit comments