The Functions builder is used to create Azure Functions accounts. It abstracts the App Host and Service Plan into the same component, and will also create and configure a linked App Insights resource. In addition, it will automatically create a backing storage account required by the functions runtime.

  • Web Site (Microsoft.Web/sites)
  • Web Host (Microsoft.Web/serverfarms)
  • Application Insights (Microsoft.Insights/components)
  • Storage Accounts (Microsoft.Storage/storageAccounts)

Builder Keywords

nameSets the name of the functions instance.
service_plan_nameSets the name of the service plan hosting the function instance.
link_to_service_planInstructs Farmer to link this webapp to an existing service plan rather than creating a new one.
link_to_storage_accountDo not create an automatic storage account; instead, link to a storage account that is created outside of this Functions instance.
https_onlyDisables http for this functions app so that only HTTPS is used.
app_insights_auto_nameSets the name of the automatically-created app insights instance.
app_insights_offRemoves any automatic app insights creation, configuration and settings for this webapp.
link_to_app_insightsInstead of creating a new AI instance, configure this webapp to point to another AI instance that you are managing yourself.
use_runtimeSets the runtime of the Functions host.
use_extension_versionSets the extension version of the functions host.
operating_systemSets the operating system of the Functions host.
settingSets an app setting of the web app in the form “key” “value”.
settingsSets a list of app setting of the web app as tuples in the form of (“key”, “value”).
depends_onSets dependencies for the web app.
enable_corsEnables CORS support for the app. Either specify AllOrigins or a list of valid URIs.
enable_cors_credentialsAllows CORS requests with credentials.

Post-deployment Builder Keywords

The Functions builder contains special commands that are executed after the ARM deployment is completed.

zip_deploySupplying a folder or zip file will instruct Farmer to upload the contents directly to the Azure Functions once the ARM deployment is complete.

Configuration Members

PublishingPasswordGets the ARM expression path to the publishing password of this functions app.
StorageAccountKeyGets the ARM expression path to the storage account key of this functions app.
AppInsightsKeyGets the ARM expression path to the app insights key of this functions app, if it exists.
DefaultKeyGets the ARM expression path for the default key of this functions app.
MasterKeyGets the ARM expression path for the master key of this functions app.


open Farmer
open Farmer.Builders

let myFunctions = functions {
    name "myWebApp"
    service_plan_name "myServicePlan"
    setting "myKey" "aValue"