Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Last active February 15, 2022 07:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinyoo/a41dc3bb8c19141f3844f214593956c8 to your computer and use it in GitHub Desktop.
Save justinyoo/a41dc3bb8c19141f3844f214593956c8 to your computer and use it in GitHub Desktop.
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