A minimal Azure Functions project demonstrating an HTTP-triggered endpoint that responds with a friendly greeting. The project includes a CI/CD pipeline for packaging and deploying to Azure Functions.
- HTTP-triggered Azure Function returning a customizable greeting.
- Minimal configuration using the Azure Functions programming model v2 for Python.
- Azure Pipelines workflow to build and deploy the function app package.
The repository uses the Azure Functions Python worker with a single HTTP-triggered function defined in function_app.py. The FunctionApp instance registers routes, while host.json configures host-level settings such as logging and extension bundle versions. CI/CD is managed through Azure Pipelines, which installs dependencies, zips the app, and deploys it to an Azure Function App using az functionapp deployment source config-zip.
- Python 3.9
- Azure Functions (Python worker)
- Azure CLI (for deployment)
- Azure Pipelines (CI/CD)
.
├── azure-pipelines.yml # CI/CD pipeline for build and deploy
├── function_app.py # Azure Functions app and HTTP route
├── host.json # Host-level configuration
├── requirements.txt # Python dependencies
└── .vscode/extensions.json # VS Code extension recommendations
- Install Python 3.9.
- (Recommended) Create and activate a virtual environment.
- Install dependencies:
pip install -r requirements.txt
- Install the Azure Functions Core Tools for local development and debugging.
This sample uses no custom environment variables. Azure Functions provides built-in settings for the HTTP trigger. If deploying to Azure, ensure the following app settings are configured as needed:
FUNCTIONS_EXTENSION_VERSION(managed by Azure)WEBSITE_RUN_FROM_PACKAGE=1(set in the pipeline deployment step)
Use Azure Functions Core Tools to start the local runtime:
func startThen call the HTTP endpoint:
curl "http://localhost:7071/api/HttpTrigger?name=YourName"Expected response:
Hello, YourName!
If no name is provided, the function responds with Hello, World!.
No automated tests are provided. You can manually exercise the function via cURL or an HTTP client.
No Dockerfile or Kubernetes manifests are included. Deployment is handled via Azure Functions package deployment.
| Method | Route | Auth Level | Description |
|---|---|---|---|
| GET | /api/HttpTrigger | Anonymous | Returns a greeting using name query |
Azure Pipelines (azure-pipelines.yml) builds and deploys the function:
- Use Python 3.9 on Ubuntu agent.
- Install dependencies and package the app into
functionapp.zip. - Publish the zip as a pipeline artifact.
- Deploy via Azure CLI by setting
WEBSITE_RUN_FROM_PACKAGE=1and callingaz functionapp deployment source config-zipwith the packaged artifact.
- Add automated tests for the HTTP trigger.
- Parameterize greetings or support multiple languages.
- Add environment-specific configuration for development and production.