Scaffolding CLI for Azure Functions Python v2 projects
Project description
Azure Functions Scaffold
Read this in: 한국어 | 日本語 | 简体中文
Scaffolding CLI for production-ready Azure Functions Python v2 projects.
Why Use It
Starting a new Azure Functions project means setting up boilerplate: host.json, function_app.py, directory structure, tooling config, and tests. azure-functions-scaffold generates a production-ready project layout in one command, so you can focus on business logic from the start.
flowchart LR
Dev(["Developer"])
CLI["afs new my-api"]
T["Templates"]
P["Generated Project"]
VAL["azure-functions-validation"]
Dev --> CLI
CLI --> T
T --> P
CLI -- "--with-validation" --> VAL
VAL --> P
Scope
- Azure Functions Python v2 programming model
- Decorator-based
func.FunctionApp()applications - CLI-driven project generation and expansion
- Templates for HTTP, Timer, Queue, Blob, and Service Bus triggers
This tool generates project scaffolds. It does not provide runtime libraries.
Features
azure-functions-scaffold newcommand for project generation- Five built-in templates: HTTP, Timer, Queue, Blob, Service Bus
azure-functions-scaffold addcommand for expanding existing projects- Optional integrations:
--with-openapi,--with-validation,--with-doctor - Preset tooling levels:
--preset minimal|standard|strict - Interactive guided setup via
--interactive - Short alias:
afsworks as a drop-in forazure-functions-scaffold
Installation
pip install azure-functions-scaffold
Quick Start
Use this 4-step flow to create and run a local HTTP function:
- Install the CLI.
- Generate a new project.
- Install project dependencies.
- Start the local Functions runtime.
azure-functions-scaffold new my-api
cd my-api
pip install -e .
func start
Open http://localhost:7071/api/hello in your browser.
Expected response:
Hello, World!
Project names must start with an alphanumeric character and use only letters, numbers, hyphens, or underscores.
What You Get
The generated layout separates trigger bindings, business logic, shared runtime
concerns, and tests so teams can scale endpoints without coupling everything to
function_app.py.
my-api/
|- function_app.py # Azure Functions v2 entrypoint
|- host.json # Runtime configuration
|- local.settings.json.example
|- pyproject.toml # Dependencies and tooling config
|- app/
| |- core/
| | `- logging.py # Structured JSON logging
| |- functions/
| | `- http.py # HTTP trigger (Blueprint)
| |- schemas/
| | `- request_models.py # Request/response models
| `- services/
| `- hello_service.py # Business logic
`- tests/
`- test_http.py # Pytest tests
Why this layout works:
- Keep trigger-specific code in
app/functions. - Keep reusable business rules in
app/services. - Keep model contracts in
app/schemas. - Keep observability and runtime helpers in
app/core. - Keep integration checks in
tests.
Templates
| Template | Command | Use Case |
|---|---|---|
| http | azure-functions-scaffold new my-api |
REST APIs, webhooks |
| timer | azure-functions-scaffold new my-job --template timer |
Scheduled tasks, cron |
| queue | azure-functions-scaffold new my-worker --template queue |
Message processing (Azurite) |
| blob | azure-functions-scaffold new my-blob --template blob |
File processing (Azurite) |
| servicebus | azure-functions-scaffold new my-bus --template servicebus |
Enterprise messaging |
Note: afs is short for azure-functions-scaffold. Both work.
Template defaults:
http: public HTTP endpoint and service module.timer: scheduled trigger using NCRONTAB expression settings.queue: Storage Queue trigger ready for local Azurite development.blob: Blob trigger scaffold for file-ingestion pipelines.servicebus: Service Bus trigger scaffold with development placeholders.
Optional Features
--with-openapi- Swagger UI + OpenAPI spec endpoints--with-validation- Pydantic request/response validation--with-doctor- Health check diagnostics--preset minimal|standard|strict- Tooling level--interactive- Guided project setup
Example combinations:
azure-functions-scaffold new my-api --preset strict --with-validation
azure-functions-scaffold new my-api --with-openapi --with-validation
azure-functions-scaffold new my-api --template timer --preset minimal
Expand Your Project
Add functions to an existing scaffolded project:
azure-functions-scaffold add http get-user --project-root ./my-api
azure-functions-scaffold add timer cleanup --project-root ./my-api
azure-functions-scaffold add queue sync-jobs --project-root ./my-api
azure-functions-scaffold add blob ingest-reports --project-root ./my-api
azure-functions-scaffold add servicebus process-events --project-root ./my-api
Preview additions before writing files:
azure-functions-scaffold add servicebus process-events --project-root ./my-api --dry-run
Common expansion flow:
- Add a trigger with
azure-functions-scaffold add <trigger> <name>. - Implement business logic under
app/services. - Update contracts in
app/schemasif needed. - Add or update tests in
tests.
Deploy
func azure functionapp publish <APP_NAME>
Before publishing:
- Set required app settings for production connections.
- Review
host.jsonand function auth levels. - Run your project checks (
pytest, lint, and formatting). - Verify startup locally with
func start.
Documentation
- Full docs: yeongseon.github.io/azure-functions-scaffold
- Getting Started:
docs/guide/getting-started.md - CLI Reference:
docs/reference/cli.md - Project Structure:
docs/guide/project-structure.md - Templates:
docs/guide/templates.md - Troubleshooting:
docs/guide/troubleshooting.md
Development
Use Makefile commands as the canonical entry points:
make install
make check-all
make docs
make build
Ecosystem
- azure-functions-validation — Request and response validation
- azure-functions-openapi — OpenAPI and Swagger UI
- azure-functions-logging — Structured logging
- azure-functions-doctor — Diagnostic CLI
- azure-functions-python-cookbook — Recipes and examples
Disclaimer
This project is an independent community project and is not affiliated with, endorsed by, or maintained by Microsoft.
Azure and Azure Functions are trademarks of Microsoft Corporation.
License
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file azure_functions_scaffold-0.3.2.tar.gz.
File metadata
- Download URL: azure_functions_scaffold-0.3.2.tar.gz
- Upload date:
- Size: 66.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc399069b4d165414747e5e35f535bbc173c0eca98bdcf5429c388bf3d176129
|
|
| MD5 |
73514e682c1bfe825d4bc9e01ef37a26
|
|
| BLAKE2b-256 |
f57d85951c9afba162019e3721db7edfd081b21b212dd39c564247b75f6eb330
|
Provenance
The following attestation bundles were made for azure_functions_scaffold-0.3.2.tar.gz:
Publisher:
release.yml on yeongseon/azure-functions-scaffold
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
azure_functions_scaffold-0.3.2.tar.gz -
Subject digest:
cc399069b4d165414747e5e35f535bbc173c0eca98bdcf5429c388bf3d176129 - Sigstore transparency entry: 1154433615
- Sigstore integration time:
-
Permalink:
yeongseon/azure-functions-scaffold@96e7059d21fe8033012fe9f6a72a6a209d5a0aa5 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/yeongseon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@96e7059d21fe8033012fe9f6a72a6a209d5a0aa5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file azure_functions_scaffold-0.3.2-py3-none-any.whl.
File metadata
- Download URL: azure_functions_scaffold-0.3.2-py3-none-any.whl
- Upload date:
- Size: 81.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e22a5171a23269f15d4f17a69ba89659245a23de9d74d59aa629112a2ca407f
|
|
| MD5 |
12119eb2dea50375842835e4521468fe
|
|
| BLAKE2b-256 |
ee20fcb918fcfd36bbc6156f397561b37c64bf165aa40221ba73e50ea0b5d5d1
|
Provenance
The following attestation bundles were made for azure_functions_scaffold-0.3.2-py3-none-any.whl:
Publisher:
release.yml on yeongseon/azure-functions-scaffold
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
azure_functions_scaffold-0.3.2-py3-none-any.whl -
Subject digest:
2e22a5171a23269f15d4f17a69ba89659245a23de9d74d59aa629112a2ca407f - Sigstore transparency entry: 1154433618
- Sigstore integration time:
-
Permalink:
yeongseon/azure-functions-scaffold@96e7059d21fe8033012fe9f6a72a6a209d5a0aa5 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/yeongseon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@96e7059d21fe8033012fe9f6a72a6a209d5a0aa5 -
Trigger Event:
push
-
Statement type: