Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Things to Know When Writing Azure Functions in Java
process_id=$(sudo lsof -nP -i4TCP:7071 | grep LISTEN | awk '{print $2}')
sudo kill -9 $process_id
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
...
<properties>
...
<java.version>1.8</java.version>
<javaVersion>8</javaVersion>
...
</properties>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-functions-maven-plugin</artifactId>
<version>${azure.functions.maven.plugin.version}</version>
<configuration>
...
<runtime>
<!-- runtime os, could be windows, linux or docker-->
<os>windows</os>
<javaVersion>${javaVersion}</javaVersion>
...
</runtime>
...
</plugin>
...
</plugins>
</build>
</project>
resource <symbolic-name> 'Microsoft.Web/sites@2021-02-01' = {
...
properties: {
...
siteConfig: {
...
// Linux plan only
linuxFxVersion = 'Java|11'
// Windows Plan only
javaVersion = '11'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment