Skip to content

Commit 5e1e2b0

Browse files
authored
http streams edits
1 parent 665be89 commit 5e1e2b0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

articles/azure-functions/functions-reference-python.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,9 @@ You can view other SDK type bindings samples for Blob storage in the Python exte
523523

524524
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.
525525

526-
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.
526+
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.
527+
528+
Note that when enabling HTTP streams, the function app will default to using HTTP streaming, and the original HTTP functionality will not work.
527529
::: zone pivot="python-mode-configuration"
528530
> [!IMPORTANT]
529531
> Support for HTTP streams requires the [Python v2 programming model](functions-reference-python.md?pivots=python-mode-decorators#http-streams-preview).
@@ -549,10 +551,13 @@ HTTP streams are disabled by default. You need to enable this feature in your ap
549551

550552
:::code language="python" source="~/functions-python-extensions/azurefunctions-extensions-http-fastapi/samples/fastapi_samples_streaming_download/function_app.py" range="8" :::
551553

552-
1. When you deploy to Azure, add these [application settings](./functions-how-to-use-azure-function-app-settings.md#settings) in your function app:
554+
1. When you deploy to Azure, add the following [application setting](./functions-how-to-use-azure-function-app-settings.md#settings) in your function app:
555+
556+
`"PYTHON_ISOLATE_WORKER_DEPENDENCIES": "1"`
557+
558+
If you are deploying to Linux Consumption, also add
553559

554-
+ `"PYTHON_ISOLATE_WORKER_DEPENDENCIES": "1"`
555-
+ `"PYTHON_ENABLE_INIT_INDEXING": "1"`
560+
`"PYTHON_ENABLE_INIT_INDEXING": "1"`
556561

557562
When running locally, you also need to add these same settings to the `local.settings.json` project file.
558563

0 commit comments

Comments
 (0)