azure-functions

Structure Azure Functions projects with Hexagonal Architecture and MediatR handlers.

Updated Apr 19, 2026
One-click install
npx skills add https://github.com/lcmassena/AI_Skills --skill azure-functions-lcmassena
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: azure-functions
Source: https://github.com/lcmassena/AI_Skills/tree/main/hexagonal-architect/azure-functions
Command: npx skills add https://github.com/lcmassena/AI_Skills --skill azure-functions-lcmassena

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Azure Functions development often leads to tangled business logic scattered across functions. This Skill demonstrates a Hexagonal Architecture approach that keeps domain rules inside MediatR handlers, enforces environment-driven configuration, and provides consistent patterns for HTTP, timer, queue, and worker triggers.

Core Features & Use Cases

  • Hexagonal structure with API and Worker projects for HTTP, Timer, and Queue triggers
  • MediatR-driven command and query handling to keep business logic separate from infrastructure
  • Environment-based configuration and OpenAPI documentation across all endpoints

Quick Start

Install dependencies, configure environment settings, and run the solution to start HTTP endpoints and background workers.

Frequently Asked Questions about azure-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure Azure Functions using hexagonal architecture?

Hexagonal architecture in Azure Functions is structured by separating API and Worker projects, keeping domain rules inside MediatR handlers and isolating infrastructure concerns. This ensures business logic remains independent of triggers like HTTP, Timer, and Queue.

How do I use MediatR with Azure Functions to handle business logic?

MediatR is used with Azure Functions by routing command and query handling through MediatR handlers. This pattern separates business logic execution from infrastructure concerns, maintaining a clean domain layer across HTTP, Timer, and Queue triggers.

Does Azure Functions support OpenAPI documentation with hexagonal architecture?

Azure Functions supports OpenAPI documentation within a hexagonal architecture by applying consistent documentation patterns across all HTTP endpoints. The architecture ensures API definitions remain aligned with the MediatR-driven command structure.

Can I use environment-based configuration across Azure Functions triggers?

Environment-based configuration can be applied across Azure Functions triggers by enforcing environment variable settings throughout the solution. This approach ensures HTTP endpoints and background workers consistently access external configurations.

How do I handle errors in Azure Functions using FluentResults?

Errors in Azure Functions are handled using FluentResults to return structured error outcomes instead of throwing exceptions. This enforces a consistent error-handling mechanism within the MediatR handlers across the hexagonal architecture.

What is the best way to scale Azure Functions with background workers?

Scaling Azure Functions with background workers is best achieved by using a hexagonal architecture blueprint that separates API and Worker projects. This structure scales HTTP, Timer, and Queue triggers independently while maintaining consistent domain logic.