Skip to content

Webapp Configuration

Andy Xu(devdiv) edited this page Jul 29, 2021 · 2 revisions

Configuration for Azure WebApp Plugin for gradle

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

This Plugin supports the following configuration properties, they are :

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 Azure Resource Group for your Web App.
appName true The name of your Web App.
region false Specifies the region where your Web App will be hosted; the default value is westeurope. All valid regions at Supported Regions section.
runtime false The runtime environment configuration, default runtime is linux. Details could be found in Runtime section.
pricingTier false The pricing tier for your Web App. The default value is P1V2.
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 Web App.

*: Some settings are required to create a new Azure WebApp; if target Web App already exists, these setting will be ignored, for example: region

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:

auth {               
   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.

Runtime

Supported values are Linux, Windows and Docker.

For Java SE

runtime {
    os = 'windows'
    javaVersion ='Java 11'
    webContainer = 'Java SE'
}

For Tomcat runtime configuration:

runtime {
    os = 'linux'
    javaVersion ='Java 8'
    webContainer = 'Tomcat 8.5'
}

For docker runtime web app, please please set the following parameters

runtime {
    os = 'docker'
    image ='<your docker image name>'
    registryUrl = '<your private registry url, it is optional for public images>'
    username = '<your login name for private image, it is optional for public images>'
    password = '<your password for private image, it is optional for public images>'
}

App settings

  appSettings {
      foo = 'bar'
  }
Clone this wiki locally