GithubHelp home page GithubHelp logo

cloudmelon / functions-java-hello Goto Github PK

View Code? Open in Web Editor NEW

This project forked from squillace/functions-java-hello

1.0 1.0 0.0 2.67 MB

A Hello World for Azure Functions as a GitHub template. Use the vsonline branch to launch directly into VS Online.

Shell 19.89% Java 80.11%

functions-java-hello's Introduction

Azure Functions using Java template repository

Clone this repository to start building Azure Functions in Java.

Using the CNAB bundle directly

You can deploy the bundle directly by creating the credentials needed to pass to the bundle and then installing the bundle.

  1. To view the bundle's parameter and credential requirements, you can type porter explain --tag squillace/functions-java-hello:v0.5.5
  2. To generate your local copy of credentials needed to install the bundle, type porter creds generate functions --tag squillace/functions-java-hello:v0.5.5
  3. To install the bundle, type porter install -c functions --tag squillace/functions-java-hello:v0.5.5 --param resource_group=java-functions --param function_name=mytestfunction

To see the output of the install action, type porter show azure-functions-java-hello; the function's URL will be displayed along with the deployment log.

Testing the function

This bundle has a custom CNAB action called functions.java.hello.test. To use the custom action, type porter invoke azure-functions-java-hello --action functions.java.hello.test --param test_url=$(porter show azure-functions-java-hello -o json | jq -r '.outputs.HOSTNAME') -c functions. (This assumes that you have jq installed; you might need to install it, or use another mechanism to capture and reuse the function's URL.)

Development Environments

You can begin using this bundle without cloning it locally by using the VS Online button, which will launch a VS Code online workspace and load up all the extensions and requirements to build and run the application and then build the CNAB bundle using Porter.

Alternatively, you can do this all yourself by cloning it to your organization, and then cloning locally and installing dependencies.

VS Code Online

Open in Visual Studio Online

Local

The following steps are necessary to use the repository with a local development environment.

Prerequisites:

  1. java -version should be OpenJDK version 11.0.6 or greater (to build the application)
  2. maven installation (to build the application)
  3. porter (from https://porter.sh) to build the bundle
  4. a code editor of some form.
  5. git

Cloning, building, and pushing the application requires the following steps:

  1. clone the template repo by clicking on the
  2. add docker secrets to it
  3. git clone locally
  4. modify the invocationImage and tag registry names to yours
  5. build the app: mvn package
  6. test the app: F5 which launches java and function runtime (requires some extensions that are checked in)
  7. build the bundle: porter build (requires porter locally)
  8. install, test, and uninstall the local bundle
  9. git add porter.yaml changes, and any app changes
  10. git push origin master
  11. Navigate to the Actions tab for your repository to watch the build function.

functions-java-hello's People

Contributors

jeffhollan avatar squillace avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.