e56b207bc4 | ||
---|---|---|
.. | ||
gradle | ||
src | ||
CHANGELOG.md | ||
README.md | ||
build.gradle | ||
gradle.properties | ||
gradlew | ||
gradlew.bat |
README.md
Azure Functions Plugin for Gradle
This plugin provides seamless integration into Gradle projects. You can package a Java Functions project, run it locally or deploy it to Azure with tasks provided by this plugin.
Prerequisites
Tool | Required Version |
---|---|
JDK | 1.8 |
Gradle | 4.10 and above |
.Net Core SDK | Latest version |
Azure Functions Core Tools | 2.0 and above |
Setup
In your Gradle Java project, add the plugin to your build.gradle
:
plugins {
id "com.microsoft.azure.azurefunctions" version "1.5.0"
}
Configuration
Here is a sample configuration, for details, please refer to this document.
azurefunctions {
subscription = <your subscription id>
resourceGroup = <your resource group>
appName = <your function app name>
pricingTier = <price tier like 'Consumption'>
region = <region like 'westus'>
runtime {
os = <os like 'windows'>
}
appSettings {
<key> = <value>
}
authentication {
type = 'azure_cli'
}
// enable local debug
// localDebug = "transport=dt_socket,server=y,suspend=n,address=5005"
deployment {
type = 'run_from_blob'
}
}
Usage
Package Staging folder
Use the script below to to package your staging folder:
gradle azureFunctionsPackage
or package the staging folder with a zip file:
gradle azureFunctionsPackageZip
Run Azure Functions locally
Use the script below to run the function locally, if you want to debug your functions, please add localDebug = "transport=dt_socket,server=y,suspend=n,address=5005"
to the azurefunctions
section of your build.gradle.
gradle azureFunctionsRun
Deploy Azure Functions to Azure Cloud
gradle azureFunctionsDeploy
Common Questions
Q: How to do when reporting "Cannot run functions locally due to error: Azure Functions Core Tools can not be found."
A: You can install Azure Functions Core Tools at: https://aka.ms/azfunc-install
Feedback and Questions
To report bugs or request new features, file issues on Issues. Or, ask questions on Stack Overflow with tag azure-java-tools.
Data and Telemetry
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.