This plugin helps Java developers to deploy Maven projects to Azure App Service.
Tool | Required Version |
---|---|
JDK | 1.8 |
Gradle | 5.2 and above |
In your Gradle Java project, add the plugin to your build.gradle
:
plugins {
id "com.microsoft.azure.azurewebapp" version "1.2.0"
}
Here is a sample configuration, for details, please refer to this document.
azurewebapp {
subscription = '<your subscription id>'
resourceGroup = '<your resource group>'
appName = '<your app name>'
pricingTier = '<price tier like 'P1v2'>'
region = '<region like 'westus'>'
runtime {
os = 'Linux'
webContainer = 'Tomcat 9.0' // or 'Java SE' if you want to run an executable jar
javaVersion = 'Java 8'
}
appSettings {
<key> = <value>
}
auth {
type = 'azure_cli' // support azure_cli, oauth2, device_code and service_principal
}
}
azurewebapp {
subscription = "<your subscription id>"
resourceGroup = "<your resource group>"
appName = "<your app name>"
pricingTier = "<price tier like 'P1v2'>"
region = "<region like 'westus'>"
setRuntime(closureOf<com.microsoft.azure.gradle.configuration.GradleRuntimeConfig> {
os("Linux")
webContainer("Java SE")
javaVersion("Java 11")
})
setAppSettings(closureOf<MutableMap<String, String>> {
put("key", "value")
})
setAuth(closureOf<com.microsoft.azure.gradle.auth.GradleAuthConfig> {
type = "azure_cli"
})
}
gradle azureWebAppDeploy
To report bugs or request new features, file issues on Issues. Or, ask questions on Stack Overflow with tag azure-java-tools.
This project collects usage data and sends it to Microsoft to help improve our products and services.
Read Microsoft's privacy statement to learn more.
If you would like to opt out of sending telemetry data to Microsoft, you can set allowTelemetry
to false in the plugin configuration.
Please read our document to find more details about allowTelemetry.