Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Example "Hello, world" Spring Boot application that runs on Azure Functions

License

Notifications You must be signed in to change notification settings

nakazax/hello-spring-function-azure-with-dev-container

 
 

Repository files navigation

page_type languages products description urlFragment
sample
java
azure
This is a sample application to showcase the use of Spring Cloud Function on top of Azure Functions.
hello-spring-function-azure

Example "Hello, world" Spring Boot application that runs on Azure Functions

This is a sample application to showcase the use of Spring Cloud Function on top of Azure Functions.

Build tool

This branch uses Maven to build the application, please use the gradle branch to use Gradle instead:

Switch to the gradle branch

This branch uses Maven to build the application:

Features

This is just a "Hello, world", but it uses domain objects so it's easy to extend to do something more complex.

Getting Started

Prerequisites

This project uses the Maven Wrapper, so all you need is Java installed.

Installation

  • Clone the project: git clone https://github.com/Azure-Samples/hello-spring-function-azure.git
  • Configure the project to use your own resource group and your own application name (it should be unique across Azure)
    • Open the pom.xml file
    • Customize the resourceGroup and appName properties
  • Build the project: ./mvnw clean package

Quickstart

Once the application is built, you can run it locally using the Azure Function Maven plug-in:

./mvnw azure-functions:run

And you can test it using a cURL command:

curl http://localhost:7071/api/hello -d "{\"name\":\"Azure\"}"

Deploying to Azure Functions

Deploy the application on Azure Functions with the Azure Function Maven plug-in:

./mvnw azure-functions:deploy

You can then test the running application:

curl https://<YOUR_SPRING_FUNCTION_NAME>.azurewebsites.net/api/hello -d "{\"name\":\"Azure\"}"

Replace the <YOUR_SPRING_FUNCTION_NAME> part by the name of your Spring Function.

About

Example "Hello, world" Spring Boot application that runs on Azure Functions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 84.3%
  • Dockerfile 15.7%