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/develop-python-worker-extensions.md
+17-4Lines changed: 17 additions & 4 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: Develop Python worker extensions for Azure Functions
3
3
description: Learn how to create and publish worker extensions that let you inject middleware behavior into Python functions running in Azure.
4
4
ms.topic: how-to
5
-
ms.date: 6/1/2021
5
+
ms.date: 3/29/2023
6
6
ms.custom: devx-track-python, py-fresh-zinc
7
7
---
8
8
@@ -20,9 +20,9 @@ In this tutorial, you'll learn how to:
20
20
21
21
Before you start, you must meet these requirements:
22
22
23
-
*[Python 3.6.x or above](https://www.python.org/downloads/release/python-374/). To check the full list of supported Python versions in Azure Functions, see the [Python developer guide](functions-reference-python.md#python-version).
23
+
*[Python 3.7 or above](https://www.python.org/downloads). To check the full list of supported Python versions in Azure Functions, see the [Python developer guide](functions-reference-python.md#python-version).
24
24
25
-
* The [Azure Functions Core Tools](functions-run-local.md#v2), version 3.0.3568 or later.
25
+
* The [Azure Functions Core Tools](functions-run-local.md#v2), version 4.0.5095 or later to support the [v2 Python programming model](./functions-reference-python). Check your version with `func --version`. To learn about updating, see [Azure Functions Core Tools on GitHub](https://github.com/Azure/azure-functions-core-tools).
26
26
27
27
*[Visual Studio Code](https://code.visualstudio.com/) installed on one of the [supported platforms](https://code.visualstudio.com/docs/supporting/requirements#_platforms).
28
28
@@ -48,7 +48,7 @@ The folder for your extension project should be like the following structure:
48
48
|**.venv/**| (Optional) Contains a Python virtual environment used for local development. |
49
49
|**python_worker_extension/**| Contains the source code of the Python worker extension. This folder contains the main Python module to be published into PyPI. |
50
50
|**setup.py**| Contains the metadata of the Python worker extension package. |
51
-
|**readme.md**|(Optional) Contains the instruction and usage of your extension. This content is displayed as the description in the home page in your PyPI project. |
51
+
|**readme.md**| Contains the instruction and usage of your extension. This content is displayed as the description in the home page in your PyPI project. |
52
52
53
53
### Configure project metadata
54
54
@@ -76,6 +76,19 @@ The `pre_invocation_app_level` method is called by the Python worker before the
76
76
77
77
Similarly, the `post_invocation_app_level` is called after function execution. This example calculates the elapsed time based on the start time and current time. It also overwrites the return value of the HTTP response.
78
78
79
+
### Create a readme.md
80
+
81
+
Create a readme.md file in the root folder of your extension project. This file contains the instruction and usage of your extension. This content is displayed as the description in the home page in your PyPI project.
82
+
83
+
```markdown
84
+
# Python Worker Extension Timer
85
+
86
+
In this file, tell your customers when they need to call `Extension.configure()`.
87
+
88
+
The readme should also document the extension capabilities, possible configuration,
89
+
and usage of your extension.
90
+
```
91
+
79
92
## Consume your extension locally
80
93
81
94
Now that you've created an extension, you can use it in an app project to verify it works as intended.
0 commit comments