Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.13 KB

File metadata and controls

47 lines (34 loc) · 1.13 KB

CodeQL

springcloud-azurefunction

Azure Function built with Spring Cloud Function in Java 21

Prerequisites

Build

mvn clean package

Run Locally

mvn azure-functions:run

Then use curl to interact with the REST API:

# Create a user
curl -X POST -H 'Content-Type:application/json' http://localhost:7072/api/AzureWebAdapter/user -d '{"userId":"1","lastName":"Doe","firstName":"John","email":"john@example.com"}'

# Get a user
curl -X GET http://localhost:7072/api/AzureWebAdapter/user/1

Deploy to Azure

az login
mvn azure-functions:deploy -Pdeploy

You can override the default Azure resource settings with -D flags:

mvn azure-functions:deploy -Pdeploy \
  -DfunctionAppName=my-app \
  -DfunctionAppRegion=westus \
  -DfunctionResourceGroup=my-resource-group