Overview
The Azure Functions module enables you to build serverless, event-driven applications using Microsoft Azure Functions. Model your functions in Intent Architect and generate production-ready code that responds to HTTP requests, timers, queues, Cosmos DB changes, and more. Azure Functions is a serverless computing service that enables developers to build and deploy scalable, cost-effective applications without managing infrastructure. Functions automatically scale to handle increased workloads and charge only for actual compute resources used.Installation
Related Modules
Azure Functions Dispatch
Dispatch patterns for routing requests
Azure Functions OpenAPI
Swagger generation for HTTP triggers
Modeling Functions
You can model Azure Functions in multiple ways within the Services designer:- Azure Function - Direct function modeling
- Commands & Queries - Mark as “Expose as Azure Function”
- Service Operations - Expose operations as Azure Functions
Trigger Types
HTTP Triggers
HTTP triggers respond to HTTP requests and support RESTful API patterns. Configuration:- Set Trigger type to
Http Trigger - Configure HTTP Settings:
- Verb: GET, POST, PUT, DELETE, etc.
- Route: URL path for the endpoint
- Return Type Mediatype: Response content type
Learn more: Azure Functions HTTP Triggers
Cosmos DB Triggers
Respond to changes in Azure Cosmos DB containers using the change feed. Configuration:- Set Trigger to
Cosmos DB Trigger - Configure:
- Connection: Connection string name in app settings
- Database name: Cosmos DB database being monitored
- Container name: Container being monitored
- LeaseContainerName: Container for storing leases
- CreateLeaseContainerIfNotExists: Auto-create lease container
Learn more: Cosmos DB Triggers
Timer Triggers
Execute functions on a schedule using NCRONTAB expressions. Configuration:- Set Trigger to
Timer Trigger - Schedule Expression: NCRONTAB expression (e.g.,
0 */5 * * * *for every 5 minutes)
Learn more: Timer Triggers
Queue Triggers
Process messages from Azure Queue Storage. Configuration:- Set Trigger to
Queue Trigger - Queue Name: Name of the queue to consume
- Connection: Connection string name in app settings
Include Message Envelope to access the underlying QueueMessage:
Queue Output Binding stereotype to write results to another queue:
Isolated Process:
Execution Models
Isolated Process (Recommended)
The isolated worker process model runs functions in a separate process from the Azure Functions runtime, providing:- Better isolation and control
- Support for .NET 8+
- More flexibility with dependencies
In-Process (Legacy)
Runs functions in the same process as the Functions host (deprecated for .NET 6+).Migrate to Isolated Process for new projects. See Migration Guide below.
Module Settings
Simple Function Names
Simplifies[FunctionName] attributes by using operation names instead of full path names.
Default: true
Use Global Exception Middleware
Enables a global exception handler for all functions. Default:false
Local Development
Azure Storage Emulator - Azurite
Azurite emulates Azure Storage services locally for development. Installation:Azure Storage Explorer
Browse and interact with Azurite or production storage: Download Azure Storage ExplorerMigrating from In-Process
To migrate from .NET 6 In-Process to Isolated Process:- Open Intent Architect with your application
- Manage Modules → Update
Intent.AzureFunctionsto latest - Visual Studio Designer → Select API host project
- Change .NET Version from 6 to 8 (or higher)
- Change Output Type to
Console(EXE) - Upgrade all C# Projects to .NET 8
- Run Software Factory
Startup.cs removed, Program.cs created, all functions updated to Isolated Process model.
Advanced Scenarios
Using Newtonsoft.Json for HTTP Triggers
By default, HTTP triggers useSystem.Text.Json. To use Newtonsoft.Json:
- Add package references:
- Update AzureFunctionHelper:
- Configure in Program.cs:
Best Practices
Optimize Cold Starts
Optimize Cold Starts
- Use consumption plan for sporadic workloads
- Consider premium plan for consistent traffic
- Minimize dependencies and assembly size
- Use dependency injection efficiently
Security
Security
- Use Azure Key Vault for secrets
- Implement proper authorization levels
- Validate all inputs
- Use managed identities when possible
Monitoring
Monitoring
- Enable Application Insights
- Log structured data
- Monitor execution time and failures
- Set up alerts for critical functions
Error Handling
Error Handling
- Implement retry policies for transient failures
- Use dead-letter queues for poison messages
- Log exceptions with context
- Consider circuit breakers for external dependencies
Resources
Azure Functions Documentation
Official Microsoft documentation
Best Practices
Performance and reliability guidance
Triggers & Bindings
Complete reference for all trigger types
Deployment Guide
Deployment strategies and CI/CD
