bootstrap
azure_bootstrap.bootstrap
¶
v1-compatible wrappers and helpers.
ensure_bootstrap() is the lazy idempotent entry-point most apps want;
load_local_settings() mirrors the Azure Functions local.settings.json
convention for ergonomic dev setups.
Functions:
| Name | Description |
|---|---|
bootstrap_initialized |
Process-local state probe — useful for /api/health/ready endpoints. |
ensure_bootstrap |
Lazy idempotent wrapper around v1 |
load_local_settings |
Load env vars from an Azure-Functions-style |
ensure_bootstrap
¶
Lazy idempotent wrapper around v1 initialize_application.
Short-circuits when USE_MOCK_BOOTSTRAP is truthy (sets the
initialized flag and returns without contacting Azure). On real
bootstrap, calls v1 initialize_application() and sets the flag.
Re-raises on failure after logging at ERROR with traceback.
Source code in azure_bootstrap/bootstrap/__init__.py
load_local_settings
¶
Load env vars from an Azure-Functions-style local.settings.json.
Behavior:
- Missing file: silent, returns 0.
- Keys starting with _ are documentation sentinels; skipped.
- Never overrides an existing os.environ entry.
- JSON / OS errors are logged at WARNING and return 0.