azure-bootstrap
A Python library that gives Azure Functions apps safe configuration, secrets, logging, telemetry and alerting from the first line of code.
What problem it solves
Every new Azure app re-builds the same plumbing: load configuration, pull secrets, start logging before configuration exists, wire up telemetry, and alert someone when it breaks. Each copy is slightly different, and the differences are where outages and leaked secrets come from.
azure-bootstrap packages that layer once, tested and maintained. The README says it is used across 17+ Azure Functions repositories, so a fix lands everywhere with a version bump instead of a hunt through every app.
Key features
- Bootstrap logging that works before configuration loads, then loads Azure App Configuration and Key Vault values into the environment
- Application Insights telemetry through OpenTelemetry
- Structured logging with correlation IDs and masking of secrets, emails and control characters
- Tiered alerts (warn, error, critical) with dedup, rate limits and escalation, plus global exception hooks
- Ingress hardening: a four-gate attachment classifier, zip-bomb defense and PDF action stripping
- Service Bus consumer helpers with dead-letter routing and lock renewal
- Ten logging transports, including Sumo Logic, Panther, Blob, SQL, Azure Data Explorer and Event Hubs
- Opt-in pip extras, so you install only what you use
Quick start
From the README:
pip install azure-bootstrap# requirements.txt
azure-bootstrap>=3.0,<4from azure_bootstrap.alerts import install_global_exception_hooks, register_dispatcher
from azure_bootstrap.bootstrap import ensure_bootstrap
from azure_bootstrap.logging import configure_logging
def my_email_sender(recipients, subject, html_body):
... # any callable matching this signature
configure_logging()
install_global_exception_hooks()
ensure_bootstrap()
register_dispatcher(my_email_sender, recipients=["de********@*****le.com"])Commands are copied from the project's own README or files. For everything else, see the repository (opens in a new tab).
Requirements, license and versions
Requirements
- Python 3.11 or later
- Azure App Configuration, Azure Key Vault and Application Insights for the full bootstrap (the v1.0 release notes say it falls back gracefully for local development)
- Core dependencies install automatically: azure-appconfiguration-provider, azure-keyvault-secrets, azure-identity, azure-monitor-opentelemetry and opentelemetry-api, with minimum versions pinned for known CVEs
License: MIT License
Use, modify and redistribute freely, including commercially, as long as you keep the copyright and license notice.
What's changed
- 3.0.2. Security patch. No source changes. Moves the cryptography dependency floor to 50.0.1 so installs pick up fixes for PYSEC-2026-3552, 3553 and 3554.
- 3.0.1. Faster, cheaper App Configuration health probe; new documentation site with a generated API reference; dev builds moved to TestPyPI.
- 3.0.0. Ten logging transports, database and transactional outbox, ACS email, a hardened HTTP client, AKS runtime helpers, governance hooks and a scaffold CLI.
Status: Production-used
Production-used: version 3.0.2 on PyPI, marked Production/Stable, with CI, a documentation site and an 86% coverage badge. The GitHub Releases page stops at v2.1.0, while tags and PyPI are at 3.0.2.
Related offering
Cloud Migration & Cost Optimization
“What breaks first, and how long until we're running again?”
More open-source tools:
Need help implementing this?
Talk to a Principal Engineer who has used it on real projects. We will tell you how it fits your environment, and when it does not.
Prefer email? Send us a note instead.

