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/functions-reference-python.md
+19-14Lines changed: 19 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Python developer reference for Azure Functions
3
3
description: Understand how to develop, validate, and deploy your Python code projects to Azure Functions using the Python library for Azure Functions.
4
4
ms.topic: article
5
-
ms.date: 12/29/2024
5
+
ms.date: 07/31/2025
6
6
ms.devlang: python
7
7
ms.custom:
8
8
- devx-track-python
@@ -20,7 +20,7 @@ This guide is an introduction to developing Azure Functions by using Python. The
20
20
> This article supports both the v1 and v2 programming model for Python in Azure Functions.
21
21
> The Python v1 model uses a *functions.json* file to define functions, and the new v2 model lets you instead use a decorator-based approach. This new approach results in a simpler file structure, and it's more code-centric. Choose the **v2** selector at the top of the article to learn about this new programming model.
22
22
23
-
As a Python developer, you might also be interested in these topics:
23
+
As a Python developer, you might also be interested in these articles:
24
24
25
25
## [Get started](#tab/get-started)
26
26
@@ -536,7 +536,7 @@ For select triggers and bindings, you can work with data types implemented by th
536
536
537
537
## HTTP streams
538
538
539
-
HTTP streams lets you accept and return data from your HTTP endpoints using FastAPI request and response APIs enabled in your functions. These APIs lets the host process large data in HTTP messages as chunks instead of reading an entire message into memory.
539
+
HTTP streams is a feature that lets you accept and return data from your HTTP endpoints using FastAPI request and response APIs enabled in your functions. These APIs lets the host process large data in HTTP messages as chunks instead of reading an entire message into memory.
540
540
541
541
This feature makes it possible to handle large data stream, OpenAI integrations, deliver dynamic content, and support other core HTTP scenarios requiring real-time interactions over HTTP. You can also use FastAPI response types with HTTP streams. Without HTTP streams, the size of your HTTP requests and responses are limited by memory restrictions that can be encountered when processing entire message payloads all in memory.
542
542
@@ -1077,13 +1077,18 @@ For local development, application settings are [maintained in the *local.settin
1077
1077
1078
1078
Azure Functions supports the following Python versions:
> Python 3.13 is currently supported on the Flex Consumption, Premium, and Dedicated plans. Python 3.13 support on the Consumption plan is pending.
1080
+
| Python<sup>1</sup> versions | Support level |
1081
+
| ----- | ----- |
1082
+
| 3.13 | Preview<sup>2</sup> |
1083
+
| 3.12 | Generally available (GA) |
1084
+
| 3.11 | GA |
1085
+
| 3.10 | GA |
1086
+
1087
+
1. Official Python distributions
1088
+
2. Python 3.13 support is in preview and currently isn't supported by the [Consumption plan](./consumption-plan.md).
1085
1089
1086
-
\* Official Python distributions
1090
+
> [!IMPORTANT]
1091
+
> Python 3.13 support introduces some improvements and a few breaking changes. For more information, see [Python 3.13+ in Azure Functions](./python-313-changes.md).
1087
1092
1088
1093
To request a specific Python version when you create your function app in Azure, use the `--runtime-version` option of the [`az functionapp create`](/cli/azure/functionapp#az-functionapp-create) command. The Functions runtime version is set by the `--functions-version` option. The Python version is set when the function app is created, and it can't be changed for apps running in a Consumption plan.
Note that with this approach, no additional package or setup is required. The function can be tested by calling `python function_app.py`, and it results in `Hello, World!` output in the terminal.
1370
+
With this approach, extra packages and configuration isn't required. The function can be tested by calling `python function_app.py`, and it results in `Hello, World!` output in the terminal.
1366
1371
1367
1372
> [!NOTE]
1368
1373
> Durable Functions require special syntax for unit testing. For more information, refer to [Unit Testing Durable Functions in Python](durable/durable-functions-unit-testing-python.md)
@@ -1374,7 +1379,7 @@ Note that with this approach, no additional package or setup is required. The fu
1374
1379
The `tempfile.gettempdir()` method returns a temporary folder, which on Linux is */tmp*. Your application can use this directory to store temporary files that are generated and used by your functions when they're running.
1375
1380
1376
1381
> [!IMPORTANT]
1377
-
> Files written to the temporary directory aren't guaranteed to persist across invocations. During scaleout, temporary files aren't shared between instances.
1382
+
> Files written to the temporary directory aren't guaranteed to persist across invocations. During scale-out, temporary files aren't shared between instances.
1378
1383
1379
1384
The following example creates a named temporary file in the temporary directory (*/tmp*):
1380
1385
@@ -1418,13 +1423,13 @@ The Azure Functions Python worker requires a specific set of libraries. You can
1418
1423
> If your function app's *requirements.txt* file contains an `azure-functions-worker` entry, remove it. The functions worker is automatically managed by the Azure Functions platform, and we regularly update it with new features and bug fixes. Manually installing an old version of worker in the *requirements.txt* file might cause unexpected issues.
1419
1424
1420
1425
> [!NOTE]
1421
-
> If your package contains certain libraries that might collide with worker's dependencies (for example, protobuf, tensorflow, or grpcio), configure [`PYTHON_ISOLATE_WORKER_DEPENDENCIES`](functions-app-settings.md#python_isolate_worker_dependencies) to `1` in app settings to prevent your application from referring to worker's dependencies.
1426
+
> If your package contains certain libraries that might collide with worker's dependencies (for example, protobuf, TensorFlow, or grpcio), configure [`PYTHON_ISOLATE_WORKER_DEPENDENCIES`](functions-app-settings.md#python_isolate_worker_dependencies) to `1` in app settings to prevent your application from referring to worker's dependencies.
1422
1427
1423
1428
### The Azure Functions Python library
1424
1429
1425
1430
Every Python worker update includes a new version of the [Azure Functions Python library (azure.functions)](https://github.com/Azure/azure-functions-python-library). This approach makes it easier to continuously update your Python function apps, because each update is backwards-compatible. For a list of releases of this library, go to [azure-functions PyPi](https://pypi.org/project/azure-functions/#history).
1426
1431
1427
-
The runtime library version is fixed by Azure, and it can't be overridden by *requirements.txt*. The `azure-functions` entry in *requirements.txt* is only for linting and customer awareness.
1432
+
The runtime library version is set by Azure, and it can't be overridden by *requirements.txt*. The `azure-functions` entry in *requirements.txt* is only for linting and customer awareness.
1428
1433
1429
1434
Use the following code to track the actual version of the Python functions library in your runtime:
1430
1435
@@ -1468,7 +1473,7 @@ You can use a Python worker extension library in your Python functions by doing
1468
1473
1. Configure the extension instance, if needed. Configuration requirements should be called out in the extension's documentation.
1469
1474
1470
1475
> [!IMPORTANT]
1471
-
> Third-party Python worker extension libraries aren't supported or warrantied by Microsoft. You must make sure that any extensions that you use in your function app is trustworthy, and you bear the full risk of using a malicious or poorly written extension.
1476
+
> Third-party Python worker extension libraries aren't supported or warranted by Microsoft. You must make sure that any extensions that you use in your function app is trustworthy, and you bear the full risk of using a malicious or poorly written extension.
1472
1477
1473
1478
Third-parties should provide specific documentation on how to install and consume their extensions in your function app. For a basic example of how to consume an extension, see [Consuming your extension](develop-python-worker-extensions.md#consume-your-extension-locally).
title: Updates for Python 3.13+ in Azure Functions
3
+
description: Understand key changes, new features, and compatibility considerations for running Azure Functions with Python 3.13 and later versions.
4
+
ms.topic: concept-article
5
+
ms.date: 07/24/2025
6
+
ms.devlang: python
7
+
ms.custom: devx-track-python, py-fresh-zinc
8
+
---
9
+
10
+
# Changes and guidance for Python 3.13+ in Azure Functions
11
+
12
+
This article outlines important Python feature updates introduced by Azure Functions starting with Python 3.13. These changes include runtime version management, performance enhancements, and several removed features.
13
+
14
+
## Python runtime version control
15
+
16
+
Starting with Python 3.13, Functions introduces runtime version control, a new opt-in feature that lets you target specific versions of the Functions Python runtime used by your app.
17
+
18
+
Without version control enabled, your app continues to run on a default version of the Python runtime, which is managed by Functions. You must modify your *requirements.txt* file to instead request the latest released version, a prereleased version, or to be able to pin your app to a specific version of the Python runtime.
19
+
20
+
You enable runtime version control by adding a reference to the Python runtime package to your *requirements.txt* file, where the value assigned to the package determines the runtime version used.
21
+
22
+
The specific reference you add in *requirements.txt* depends on your Python programming model, which can be one of these values:
This table indicates the versioning behavior based on the version value of this setting in your *requirements.txt* file:
30
+
31
+
| Version | Example | Behavior |
32
+
| --- | ---- | ---- |
33
+
| No value set |`azure-functions-runtime`| Your Python 3.13+ app runs on the latest available version of the Functions Python runtime. This option is best for staying current with platform improvements and features, since your app automatically receives the latest stable runtime updates. |
34
+
| Pinned to a specific version |`azure-functions-runtime==1.2.0`| Your Python 3.13+ app stays on the pinned runtime version and doesn't receive automatic updates. You must instead manually update your pinned version to take advantage of new features, fixes, and improvements in the runtime. Pinning is recommended for critical production workloads where stability and predictability are essential. Pinning also lets you test your app on prereleased runtime versions during development. |
35
+
| No package reference | n/a | By not setting the `azure-functions-runtime`, your Python 3.13+ app runs on a default version of the Python runtime that is behind the latest released version. Updates are made periodically by Functions. This option ensures stability and broad compatibility. However, access to the newest features and fixes are delayed until the default version is updated. |
36
+
37
+
Keep these considerations in mind when using runtime version control with your Python 3.13+ app:
38
+
39
+
- Avoid pinning any production app to prerelease (alpha, beta, or dev) runtime versions.
40
+
- Review [Python runtime release notes](https://github.com/Azure/azure-functions-python-worker/releases) regularly to be aware of changes that are being applied to your app's Python runtime or to determine when to update a pinned version.
41
+
42
+
43
+
## Other changes and improvements introduced in Python 3.13
44
+
45
+
Python 3.13 introduces several enhancements to Functions that improve performance and reliability and otherwise affect runtime behaviors:
46
+
47
+
### Dependency isolation now enabled by default
48
+
49
+
Your apps can now benefit from full *dependency isolation*, which means that when your app includes a dependency that's also used by the Python worker, such as `azure-functions` or `grpcio`, your app can use its own version even though the Python runtime uses a different version internally.
50
+
51
+
This isolation prevents version conflicts and improves compatibility with custom packages.
52
+
53
+
### Improved cold start performance
54
+
55
+
Python 3.13 provides a measurable reduction in [cold start time](./event-driven-scaling.md#cold-start) compared to Python 3.11, which results in faster app startup.
56
+
57
+
### Faster JSON handling with `Orjson` support
58
+
59
+
Functions now supports the automatic use of `Orjson`, a high-performance JSON library written in Rust. When `Orjson` is included in your app’s dependencies, the runtime automatically uses it for JSON serialization and deserialization without you having to make any changes in your code.
60
+
61
+
Using `Orjson` can provide both lower latency and higher throughput for JSON-heavy workloads, such as HTTP API calls and event processing. To ensure backward compatibility, the standard `json` library is used when `Orjson` isn't available.
62
+
63
+
### Simplified opt-in for HTTP streaming
64
+
65
+
- The [HTTP Streaming](./functions-bindings-http-webhook-trigger.md?tabs=python-v2&pivots=programming-language-python#http-streams-1) feature is now available without requiring any changes to your app setting or other configurations. While you must still opt in at the function level, you no longer need to add the `PYTHON_ENABLE_INIT_INDEXING` setting to use the feature.
66
+
67
+
## Feature support removed in Python
68
+
69
+
These features are no longer supported by Functions when using Python 3.13 and later versions:
70
+
71
+
-**[Worker Extensions](./functions-reference-python.md#python-worker-extensions)**: Custom worker extensions aren't compatible with the Python 3.13+ runtime. If your app rely on these extensions, you must reevaluate or migrate to using supported alternatives.
72
+
-**[Shared Memory](./functions-reference-python.md#shared-memory)**: The shared memory feature used for large payload optimization isn't available starting with Python 3.13. By default, all communication now uses gRPC-based messaging.
description: Frequently asked questions about migrating from AFD/CDN Classic to AFD Standard or Premium.
4
+
author: jainsabal
5
+
ms.author: jainsabal
6
+
ms.service: azure-frontdoor
7
+
ms.topic: overview
8
+
ms.date: 08/06/2025
9
+
10
+
#CustomerIntent: As a <type of user>, I want <what?> so that <why?>.
11
+
---
12
+
13
+
# AFD and CDN Classic Migration FAQ
14
+
15
+
This document provides answers to frequently asked questions regarding the migration from Azure Front Door (AFD) Classic and CDN Classic to AFD Standard/Premium.
16
+
17
+
### Will there be downtime during migration?
18
+
19
+
No, there is no downtime during the migration. This is a control plane-only migration, meaning traffic delivery is unaffected.
20
+
21
+
During migration, the classic Azure Front Door (AFD) endpoint mydomain.azurefd.net is created as a dummy custom domain on AFD standard/premium that is CNAMEd to AFD standard/premium endpoint mydomain.randomstring.z01.azurefd.net. It continues to receive traffic until you update the DNS record of AFD custom domain (www.mydomain.com) to mydomain.randomstring.z01.azurefd.net directly. It is highly recommended to change the CNAME from classic endpoint to AFD standard/premium endpoint after verification.
22
+
23
+
Even in rare cases where the migration fails, traffic delivery continues to work as expected.
24
+
25
+
There is no rollback support, please reach out to the support team for help if migration fails.
26
+
27
+
28
+
29
+
### What should I do after migration?
30
+
31
+
After migration:
32
+
33
+
- Verify traffic delivery continues to work.
34
+
35
+
- Update the DNS CNAME record for your custom domain to point to the AFD Standard/Premium endpoint (exampledomain-hash.z01.azurefd.net) instead of the classic endpoint (exampledomain.azurefd.net for classic AFD or exampledomain.azureedge.net). Wait for the DNS update propagation until DNS TTL expires, depending on how long TTL is configured on DNS provider.
36
+
37
+
- Verify again that traffic works in the custom domain.
38
+
39
+
- Once confirmed, delete the pseudo custom domain (i.e., the classic endpoint that was pointing to the AFD Standard/Premium endpoint) from the AFD Standard/Premium profile.
40
+
41
+
### When I change my DNS CNAME from classic AFD endpoint to AFD standard/premium endpoint, does DNS propagation cause downtime?
42
+
43
+
No, both classic endpoint and Std/premium endpoints point to the same IP, so the final resolution remains the same before and after DNS propagation.
44
+
45
+
### When should I delete the classic SKU?
46
+
47
+
For AFD Classic: After verifying that traffic works and the DNS record has been updated to point to the AFD Standard/Premium endpoint, you can safely delete the classic resource.
48
+
49
+
For CDN Classic: You do not need to delete the classic resource. Migration is treated as a SKU upgrade, and the classic resource can remain.
50
+
51
+
### Do I need to update my DevOps pipeline?
52
+
53
+
Yes. After migration, make sure to update your DevOps pipeline to reflect the new AFD Standard/Premium configuration and endpoints.
54
+
55
+
## Next step
56
+
57
+
* Understand the [settings mapping between Azure Front Door tiers](tier-mapping.md).
58
+
* Learn how to [migrate from Azure Front Door (classic) to Standard or Premium tier](migrate-tier.md) using the Azure portal.
59
+
* Learn how to [migrate from Azure Front Door (classic) to Standard or Premium tier](migrate-tier-powershell.md) using Azure PowerShell.
60
+
* Learn how to [migrate from Azure CDN from Microsoft (classic)](migrate-tier.md) to Azure Front Door using the Azure portal.
0 commit comments