Azure Function built with Spring Cloud Function in Java 21
- JDK 21
- Maven
- Azure Functions Core Tools v4+
mvn clean packagemvn azure-functions:runThen 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/1az login
mvn azure-functions:deploy -PdeployYou can override the default Azure resource settings with -D flags:
mvn azure-functions:deploy -Pdeploy \
-DfunctionAppName=my-app \
-DfunctionAppRegion=westus \
-DfunctionResourceGroup=my-resource-group