-
Notifications
You must be signed in to change notification settings - Fork 150
Azure Functions Gradle Plugin
Andy Xu(devdiv) edited this page Apr 23, 2020
·
3 revisions
Azure Function Gradle Plugin is in Alpha stage, API may be changed or removed in stable releases.
- Gradle 4.10+
- Latest Function Core Tools
- Azure CLI. This plugin use Azure CLI for authentication, please make sure you have Azure CLI installed and logged in.
az login
az account set -s <your subscription id>
mvn archetype:generate -DarchetypeGroupId=com.microsoft.azure -DarchetypeArtifactId=azure-functions-archetype
Follow https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-java-maven to create your azure function java project(maven)
the content of build.gradle, remember to replace :
plugins {
id "com.microsoft.azure.azurefunctions" version "1.0.1"
}
apply plugin: "java"
group 'com.fabrikam.functions'
version '1.0-SNAPSHOT'
dependencies {
implementation 'com.microsoft.azure.functions:azure-functions-java-library:1.3.1'
testCompile 'org.mockito:mockito-core:2.23.4'
testCompile 'org.junit.jupiter:junit-jupiter-api:5.4.2'
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
repositories {
mavenCentral()
}
azurefunctions {
subscription = <your subscription ID>
resourceGroup = 'java-functions-group'
appName = 'fabrikam-functions-20191216104001380-01'
pricingTier = 'Consumption'
region = 'westus'
runtime {
os = 'windows'
}
appSettings {
foo = 'bar'
}
authentication {
type = 'azure_cli'
}
localDebug = "transport=dt_socket,server=y,suspend=n,address=5005"
deployment {
type = 'run_from_blob'
}
}
the content of settings.gradle:
rootProject.name = 'fabrikam-functions'
This step is to test whether your local env is ready.
This step is to prepare your staging folder (equals to mvn package
).
Test local run behavior like maven functions plugin(equals to mvn azure-functions:run
)
Test local deploy behavior like maven functions plugin(equals to mvn azure-functions:deploy
)
- Home
- Authentication
- Proxy
- Common Configurations
-
Maven Plugin for Azure Web Apps
- Quickstarts
- Goals
- Configuration Details
- Samples
-
Maven Plugin for Azure Functions
- Quickstarts
- Archetype
- Goals
- Configuration Details
-
Maven Plugin for Azure Spring Apps
- Quickstarts
- Goals
- Configuration Details
- Maven Plugin for Azure Container Apps
- Using in CI/CD