Skip to main content

Tools for Azure Functions

Project description

func-az

Simple tools for Azure Functions

pip install func-az

Safe Start-up

Sometimes you deploy a function, and it breaks. And you have no idea why.

import azure.functions as func
import func_az as fz

def make() -> func.FunctionApp:
  ...

def handle_err(exc):
  logging.error(f'An error occurred during startup: {exc}')
  return 'An error occurred'

app = fz.startup(make, error_message=handle_err)

If it breaks, it sets up a /health route that you can use to trigger the handler.

Scheduled Job

You can set up a timer trigger, and also an HTTP trigger. But not both. This bridges the gap:

import azure.functions as func
import func_az as fz

app = func.FunctionApp()

@fz.job(app, 'greet-users', route='greet', timer='0 */5 * * * *')
async def greet_users():
  ...

Runs at the given timer, or can be triggered at /greet.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

func_az-0.1.9.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

func_az-0.1.9-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page