A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Azure-Samples/python-worker-extension-timer below:

Azure-Samples/python-worker-extension-timer: Sample repository to demonstrate how to publish a Python worker extension for Azure Functions

Python Worker Extension Timer

This is an example repo to demonstrate how to build a Python Worker extension in Azure Functions.

This project framework provides the following features:

  1. Open a Windows PowerShell or any Linux shell as you prefer.
  2. Change your directory into the _example/
  3. Create a Python virtual environment by py -m venv .venv in Windows, or python3 -m venv .venv in Linux.
  4. Activate the Python virutal environment with .venv\Scripts\Activate.ps1 in Windows PowerShell or source .venv/bin/activate in Linux shell.
  5. Install the packages for your function app project pip install -r requirements.txt
  6. Start the function host with func host start --verbose

You should now be able to access http://localhost:7071/api/HttpTrigger. Each http response reports the time elapsed of processing the request.

To install this Python worker extension package in an existing function app:

from python_worker_extension_timer import TimerExtension
TimerExtension.configure(append_to_http_response=True)

In the v1 programming model, add the lines in the __init.py__ file. In the v2 programming model, add the lines in the function_app.py file.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4