azure.functions
Module azure.functions
Declarations
Definitions
ballerinax/azure.functions Ballerina library
Package Overview
This module provides an annotation-based Azure Functions extension implementation for Ballerina.
- For information on the operations, which you can perform with this module, see API Docs.
- For more information on the deployment, see the Azure Functions Deployment Guide.
- For examples on the usage of the operations, see the Azure Functions Deployment Example.
Azure Setup
- An Azure "Function App" needs to be created in a given resource group with the following requirements
- Runtime stack - "Java 21"
- Hosting operating system - "Windows" (This is the default and Linux is not supported in Azure for custom handlers at the moment)
Supported Triggers and bindings:
- Http - Trigger and Output Binding
- Queue - Trigger and Output Binding
- Blob - Trigger, Input and Output Binding
- Twilio - Output Binding
- CosmosDB - Trigger, Input and Output Binding
- Timer - Trigger
Report Issues
To report bugs, request new features, start new discussions, view project boards, etc., go to the Ballerina Azure Functions repository.
Useful Links
- Discuss code changes of the Ballerina project in ballerina-dev@googlegroups.com.
- Chat live with us via our Discord server.
- Post all technical questions on Stack Overflow with the #ballerina tag.
Service types
azure.functions: HttpService
azure.functions: QueueService
azure.functions: CosmosService
azure.functions: TimerService
azure.functions: BlobService
Listeners
azure.functions: BlobListener
attach
function attach(BlobService svc, string[]|string? name) returns error?
detach
function detach(BlobService svc) returns error?
Parameters
- svc BlobService -
'start
function 'start() returns error?
gracefulStop
function gracefulStop() returns error?
immediateStop
function immediateStop() returns error?
azure.functions: CosmosDBListener
attach
function attach(CosmosService svc, string[]|string? name) returns error?
detach
function detach(CosmosService svc) returns error?
Parameters
- svc CosmosService -
'start
function 'start() returns error?
gracefulStop
function gracefulStop() returns error?
immediateStop
function immediateStop() returns error?
azure.functions: HttpListener
attach
function attach(HttpService svc, string[]|string? name) returns error?
detach
function detach(HttpService svc) returns error?
Parameters
- svc HttpService -
'start
function 'start() returns error?
gracefulStop
function gracefulStop() returns error?
immediateStop
function immediateStop() returns error?
azure.functions: QueueListener
attach
function attach(QueueService svc, string[]|string? name) returns error?
detach
function detach(QueueService svc) returns error?
Parameters
- svc QueueService -
'start
function 'start() returns error?
gracefulStop
function gracefulStop() returns error?
immediateStop
function immediateStop() returns error?
azure.functions: TimerListener
attach
function attach(TimerService svc, string[]|string? name) returns error?
detach
function detach(TimerService svc) returns error?
Parameters
- svc TimerService -
'start
function 'start() returns error?
gracefulStop
function gracefulStop() returns error?
immediateStop
function immediateStop() returns error?
Annotations
azure.functions: BindingName
@azurefunctions:BindingName annotation.
azure.functions: BlobInput
@azurefunctions:BlobInput annotation.
azure.functions: BlobOutput
@azurefunctions:BlobOutput annotation.
azure.functions: BlobTrigger
@azurefunctions:BlobTrigger annotation.
azure.functions: CosmosDBInput
@azurefunctions:CosmosDBInput annotation.
azure.functions: CosmosDBOutput
@azurefunctions:CosmosDBOutput annotation.
azure.functions: CosmosDBTrigger
@azurefunctions:CosmosDBTrigger annotation.
azure.functions: Function
azure.functions: Header
The annotation which is used to define the Header resource signature parameter.
azure.functions: HttpOutput
@azurefunctions:HttpOutput annotation
azure.functions: HttpTrigger
azure.functions: Payload
azure.functions: QueueOutput
@azurefunctions:QueueOutput annotation.
azure.functions: QueueTrigger
@azurefunctions:QueueOutput annotation.
azure.functions: TimerTrigger
@azurefunctions:TimerTrigger annotation.
azure.functions: TwilioSmsOutput
@azurefunctions:TwilioSmsOutput annotation.
Records
azure.functions: BindingNameConfiguration
BindingName annotation configuration.
Fields
- name? string - The binding name
azure.functions: BlobConfiguration
Blob annotation configuration.
Fields
- path string - The blob container path
- connection string(default "AzureWebJobsStorage") - The name of the app setting which contains the Storage connection string
azure.functions: CosmosDBInputConfiguration
CosmosDB input annotation configuration.
Fields
- connectionStringSetting string - The name of the app setting which contains the connection string for CosmosDB account
- databaseName string - The database name
- collectionName string - The collection name
- id? string - The id of the document to retrieve
- sqlQuery? string - An Azure Cosmos DB SQL query used to retrieve multiple documents
azure.functions: CosmosDBOutputConfiguration
CosmosDB output annotation configuration.
Fields
- connectionStringSetting string - The name of the app setting which contains the connection string for CosmosDB account
- databaseName string - The database name
- collectionName string - The collection name
azure.functions: CosmosDBTriggerConfiguration
CosmosDB trigger annotation configuration.
Fields
- connectionStringSetting string - The name of the app setting which contains the connection string for CosmosDB account
- databaseName string - The database name
- collectionName string - The collection name
- createLeaseCollectionIfNotExists boolean(default true) - The lease collection is automatically created when this is set to true
- leasesCollectionThroughput? int - The request throughput of the lease collection
azure.functions: FunctionConfiguration
Fields
- name string -
azure.functions: HttpHeader
Defines the Header resource signature parameter.
Fields
- name? string - Specifies the name of the required header
azure.functions: HTTPTriggerConfiguration
HTTPTrigger annotation configuration.
Fields
- authLevel AUTH_LEVEL(default "anonymous") - The authentication level of the function
azure.functions: QueueConfiguration
Queue annotation configuration.
Fields
- queueName string - The queue name
- connection string(default "AzureWebJobsStorage") - The name of the app setting which contains the Storage connection string
azure.functions: TimerMetadata
Represents details about the Timer trigger event
Fields
- Schedule TimerSchedule - Schedule the timer is being executed on
- ScheduleStatus? anydata - Status of the Schedule
- IsPastDue boolean - Weather the timer is past its due time
azure.functions: TimerSchedule
Represents the details about timer schedule
Fields
- AdjustForDST boolean - shows weather time is adjusted for DST
azure.functions: TimerTriggerConfiguration
TimerTrigger annotation configuration.
Fields
- schedule string - The CRON expression representing the timer schedule.
- runOnStartup boolean(default true) - The flag to state if the timer should be started on a runtime restart
azure.functions: TwilioSmsConfiguration
Twilio annotation configuration.
Fields
- accountSidSetting string(default "AzureWebJobsTwilioAccountSid") - The app setting which holds the Twilio Account Sid
- authTokenSetting string(default "AzureWebJobsTwilioAuthToken") - The app setting which holds the Twilio authentication token
- 'from string -
- to string - The phone number the SMS is sent to
azure.functions: TwilioSmsOutputBinding
Twilion SMS output binding data.
Fields
- to? string - The SMS recipient phone number
- body? string - The message body
Errors
Union types
azure.functions: AUTH_LEVEL
AUTH_LEVEL
azure.functions: RemoteService
RemoteService
Import
import ballerinax/azure.functions;
Metadata
Released date: 1 day ago
Version: 4.2.0
License: Apache-2.0
Compatibility
Platform: java21
Ballerina version: 2201.11.0
GraalVM compatible: Yes
Pull count
Total: 37
Current verison: 0
Weekly downloads
Keywords
azure
functions
serverless
cloud