Important
|
For a general information about building and deploying Azure Functions with Spring Cloud Function, consult the Azure Adapter documentation.
|
Azure Functions may be invoked via HTTP requests to build serverless APIs. Find more about the HTTP triggers.
Use the script below to run the function locally.
./mvnw azure-functions:run
Note
|
To run locally on top of Azure Functions , and to deploy to your live Azure environment, you will need Azure Functions Core Tools installed along with the Azure CLI (see here).
|
Note
|
Azure Functions Core Tools version 4.0.5030 or newer is required!
|
For some configuration you would need the Azurite emulator as well.
Make sure you are logged in your Azure account.
az login
then build and deploy
./mvnw clean package
./mvnw azure-functions:deploy
Run the function in debug mode.
./mvnw azure-functions:run -DenableDebug
Alternatively and the JAVA_OPTS
value to your local.settings.json
like this:
{
"IsEncrypted": false,
"Values": {
...
"FUNCTIONS_WORKER_RUNTIME": "java",
"JAVA_OPTS": "-Djava.net.preferIPv4Stack=true -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=127.0.0.1:5005"
}
}
For VSCode remote debug use configuration like this:
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Attach to Remote Program",
"request": "attach",
"hostName": "localhost",
"port": "5005"
},
...
]
}