-
Notifications
You must be signed in to change notification settings - Fork 28
Quickstart
Tool | Required Version |
---|---|
JDK | 1.8 |
Gradle | 4.10 and above |
.Net Core SDK | Latest version |
Azure CLI | Latest version |
There are several ways of installing Azure Functions Core Tools, for example, use npm
```cmd
npm i -g azure-functions-core-tools@2 --unsafe-perm true
az login
az account set --subscription <your subscription id>
```
```cmd
mvn archetype:generate -DarchetypeGroupId=com.microsoft.azure -DarchetypeArtifactId=azure-functions-archetype
```
In the console prompt, input com.fabrikam.functions
for groupId and fabrikam-functions
for artifactId.
Open the generated folder fabrikam-functions
in VSCode, create a new file build.gradle
with the following content:
plugins {
id "com.microsoft.azure.azurefunctions" version "1.5.0"
}
apply plugin: "java"
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
group 'com.fabrikam.functions'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
implementation 'commons-io:commons-io:2.6'
testCompile group: 'junit', name: 'junit', version: '4.12'
implementation 'com.microsoft.azure.functions:azure-functions-java-library:1.4.0'
}
azurefunctions {
subscription = '__SUBSCRIPTION_ID__'
resourceGroup = '__RESOURCE_GROUP_NAME__'
appName = '__APP_NAME__'
pricingTier = '__PRICING_TIER__'
region = '__LOCATION_NAME__'
runtime {
os = 'windows'
}
// localDebug = "transport=dt_socket,server=y,suspend=n,address=5005"
}
This command will generate the staging folder, under the folder: build/azure-functions
. The staging folder will be used to local run or deploy the function app. There is another similar task named azureFunctionsPackageZip
which will generate a zip under the folder: build/azure-functions
, this zip file can be deployed to Azure cloud manually.
This command will run the functions on local azure function simulator, if you have not run gradle azureFunctionsPackage
before, it will be triggered automatically so you needn't run gradle azureFunctionsPackage
before azureFunctionsRun.
This command will deploy the project to the target Function App defined at the azurefunctions section of build.gradle
.
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 at the azurefunctions section of build.gradle
.
azurefunctions {
subscription = '__SUBSCRIPTION_ID__'
...
allowTelemetry = false
}