Skip to content

Configuration

Hanxiao Liu edited this page Jun 18, 2024 · 13 revisions

Configuration for Azure Functions Plugin for gradle

Azure Functions Plugin for gradle supports below configuration properties in file build.gradle:

This Plugin supports the following configuration properties:

Property Required Description
allowTelemetry false Specifies whether to allow this plugin to send telemetry data; default value is true.
auth false Specifies then authentication method and default type is auto, details could be found in Authentication section.
subscription false Specifies the target subscription. Use this setting when you have multiple subscriptions in your azure account.
resourceGroup true Specifies the Azure Resource Group for your Azure Functions.
appName true Specifies the name of your Azure Functions.
region* false Specifies the region where your Azure Functions will be hosted; default value is westus. All valid regions are at Supported Regions section.
runtime false The runtime environment configuration, default runtime is windows. Details could be found in Runtime section.
pricingTier* false Specifies the pricing tier for your Azure Functions; default value is Consumption. All valid pricing tiers are at Supported Pricing Tiers section.
appServicePlanResourceGroup false Specifies the resource group of the existing App Service Plan when you do not want to create a new one. If this setting is not specified, the plugin will use the value defined in resourceGroup.
appServicePlanName false Specifies the name of the existing App Service Plan when you do not want to create a new one.
appSettings false Specifies the application settings for your Azure Functions, which are defined in name-value pairs deployment
localDebug false The config string of debug options, you may visit here for more information. The default value is transport=dt_socket,server=y,suspend=n,address=5005;
appInsightsKey false Specifies the instrumentation key of application insights which will bind to your function app.
appInsightsInstance false Specifies the name of application insights which will bind to your function app, must be in the same resource group with function app.
disableAppInsights false Specifies whether to disable application insights for your function app, default value is false.

*: This setting will be used to create a new Azure Functions if specified Azure Functions does not exist; if target Azure Functions already exists, this setting will be ignored.

Authentication

Property Required Description
type false Specifies which authentication method will be used, see document for more types.
client false Specifies the Client ID of your service principal.
tenant false Specifies the Tenant ID of your service principal.
key false Specifies the password if your service principal uses password authentication.
certificate false Specifies the absolute path of your certificate if your service principal uses certificate authentication.
Note: Only PKCS12 certificates are supported.
certificatePassword false Specifies the password for your certificate, if there is any.
environment false Specifies the target Azure cloud environment; the default value is AZURE.
The possible values are:
- AZURE
- AZURE_CHINA
- AZURE_GERMANY
- AZURE_US_GOVERNMENT

Some examples:

authentication {               
   type = 'azure_cli' // or 'auto' 
}
auth {        
     client = 'df4d03fa-135b-4b7b-932d-2f2ba6449792'
     tenant = '72f988bf-86f1-41af-91ab-2d7cd011db47'
     key = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
     environment = 'AZURE'
}

Supported Regions

All valid regions are listed as below. Read more at Azure Region Availability.

  • westus
  • westus2
  • eastus
  • eastus2
  • northcentralus
  • southcentralus
  • westcentralus
  • canadacentral
  • canadaeast
  • brazilsouth
  • northeurope
  • westeurope
  • uksouth
  • eastasia
  • southeastasia
  • japaneast
  • japanwest
  • australiaeast
  • australiasoutheast
  • centralindia
  • southindia

Supported Pricing Tiers

Consumption plan is the default if you don't specify anything for your Azure Functions.

You can also run Functions within your App Service Plan. Both Premium plan and Dedicated plan are suported. All valid pricing tiers are listed as below. Read more at Azure App Service Plan Pricing.

Runtime

Supported values are Linux, Windows and Docker.

runtime {
    os = 'windows' 
}
runtime {
    os = 'linux' 
}

For docker runtime function, please please set the following parameters

  runtime {
    os = 'docker'
    image = '<your image name>'
    registryUrl = 'http://localhost:5000/v2'
    authentication {
      username = '<username>'
      password = System.getenv("PRIVATE_DOCKER_CREDENTIAL")
   }
 }

App settings

  appSettings {
      foo = 'bar'
  }