Azure Function built with Spring Cloud Function in Java 21
- JDK 21
- Maven
- Azure Functions Core Tools v4+
mvn clean package
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":"[email protected]"}' # Get a user curl -X GET http://localhost:7072/api/AzureWebAdapter/user/1
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