Skip to content

Commit ed30715

Browse files
Merge pull request #250930 from mattchenderson/coldstart
adding 64-bit requirement notes
2 parents 03f3e48 + 68216fa commit ed30715

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

articles/azure-functions/dotnet-isolated-process-guide.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ Placeholders are a platform capability that improves cold start. Normally, you d
229229

230230
- Set the `WEBSITE_USE_PLACEHOLDER_DOTNETISOLATED` application setting to "1"
231231
- Ensure that the `netFrameworkVersion` property of the function app matches your project's target framework, which must be .NET 6 or later.
232+
- Ensure that the function app is configured to use a 64-bit process.
232233
- Update your project file:
233234
- Upgrade [Microsoft.Azure.Functions.Worker] to version 1.19.0 or later
234235
- Upgrade [Microsoft.Azure.Functions.Worker.Sdk] to version 1.14.1 or later
@@ -239,11 +240,12 @@ Placeholders are a platform capability that improves cold start. Normally, you d
239240
> [!NOTE]
240241
> Setting `FunctionsEnableWorkerIndexing` to "True" may cause an issue when debugging locally using version 4.0.5274 or earlier of the [Azure Functions Core Tools](./functions-run-local.md). The issue manifests with the debugger not being able to attach. If you encounter this issue, remove the `FunctionsEnableWorkerIndexing` property during local testing.
241242
242-
The following CLI commands will set the application setting and update the `netFrameworkVersion` property. Replace `<groupName>` with the name of the resource group, and replace `<appName>` with the name of your function app. Replace `<framework>` with the appropriate version string, such as "v6.0" or "v7.0", according to your target .NET version.
243+
The following CLI commands will set the application setting, update the `netFrameworkVersion` property, and make the app run as 64-bit. Replace `<groupName>` with the name of the resource group, and replace `<appName>` with the name of your function app. Replace `<framework>` with the appropriate version string, such as "v6.0" or "v7.0", according to your target .NET version.
243244

244245
```azurecli
245246
az functionapp config appsettings set -g <groupName> -n <appName> --settings 'WEBSITE_USE_PLACEHOLDER_DOTNETISOLATED=1'
246247
az functionapp config set -g <groupName> -n <appName> --net-framework-version <framework>
248+
az functionapp config set -g <groupName> -n <appName> --use-32bit-worker-process false
247249
```
248250

249251
The following example shows a project file with the appropriate changes in place:
@@ -326,34 +328,42 @@ You can compile your function app as [ReadyToRun binaries](/dotnet/core/deployin
326328

327329
ReadyToRun requires you to build the project against the runtime architecture of the hosting app. **If these are not aligned, your app will encounter an error at startup.** Select your runtime identifier from the table below:
328330

329-
|Operating System | App is 32-bit | Runtime identifier |
331+
|Operating System | App is 32-bit<sup>1</sup> | Runtime identifier |
330332
|-|-|-|
331333
| Windows | True | `win-x86` |
332334
| Windows | False | `win-x64` |
333335
| Linux | True | N/A (not supported) |
334336
| Linux | False | `linux-x64` |
335337

338+
<sup>1</sup> Only 64-bit apps are eligible for some other performance optimizations such as [placeholders](#placeholders-preview).
339+
336340
To check if your Windows app is 32-bit or 64-bit, you can run the following CLI command, substituting `<group_name>` with the name of your resource group and `<app_name>` with the name of your application. An output of "true" indicates that the app is 32-bit, and "false" indicates 64-bit.
337341

338342
```azurecli
339343
az functionapp config show -g <group_name> -n <app_name> --query "use32BitWorkerProcess"
340344
```
341345

342-
To compile your project as ReadyToRun, update your project file by adding the `<PublishReadyToRun>` and `<RuntimeIdentifier>` elements. The following examples shows a configuration for publishing to a Windows 32-bit function app.
346+
You can change your application to 64-bit with the following command, using the same substitutions:
347+
348+
```azurecli
349+
az functionapp config set -g <group_name> -n <app_name> --use-32bit-worker-process false`
350+
```
351+
352+
To compile your project as ReadyToRun, update your project file by adding the `<PublishReadyToRun>` and `<RuntimeIdentifier>` elements. The following examples shows a configuration for publishing to a Windows 64-bit function app.
343353

344354
```xml
345355
<PropertyGroup>
346356
<TargetFramework>net6.0</TargetFramework>
347357
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
348-
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
358+
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
349359
<PublishReadyToRun>true</PublishReadyToRun>
350360
</PropertyGroup>
351361
```
352362

353-
If you don't want to set the `<RuntimeIdentifier>` as part of the project file, you can also configure this as part of the publish gesture itself. For example, with a Windows 32-bit function app, the .NET CLI command would be:
363+
If you don't want to set the `<RuntimeIdentifier>` as part of the project file, you can also configure this as part of the publish gesture itself. For example, with a Windows 64-bit function app, the .NET CLI command would be:
354364

355365
```dotnetcli
356-
dotnet publish --runtime win-x86
366+
dotnet publish --runtime win-x64
357367
```
358368

359369
In Visual Studio, the "Target Runtime" option in the publish profile should be set to the correct runtime identifier. If it is set to the default value "Portable", ReadyToRun will not be used.

0 commit comments

Comments
 (0)