To provide a smart overview how Azure Stack Functions work and how to use them, a simple hello world function is described here.
To start, you just have to deploy the corresponding Function App
:
![](https://static.packt-cdn.com/products/9781786466297/graphics/b5377402-78b4-4078-b072-1ae1e4a3b22c.png)
For being deployed, you will have to set a unique name and a storage account. After it has been deployed, you can set your function type:
![](https://static.packt-cdn.com/products/9781786466297/graphics/643129ff-4122-4425-841e-3505e133728c.png)
And now you can start writing your code:
![](https://static.packt-cdn.com/products/9781786466297/graphics/ce55a624-6ed8-4d97-a4eb-6776c8e6a830.png)
In the function detail, you will find the following view:
![](https://static.packt-cdn.com/products/9781786466297/graphics/e22b0187-bc84-48ca-a144-90db42d63a0a.png)
As you can see, you can define the Triggers
, the Inputs
, and the Outputs
:
![](https://static.packt-cdn.com/products/9781786466297/graphics/2351323e-900c-4adf-aa2e-390c96fe3160.png)
You can write the code for your function in a language of your choice and save the code and configuration files in the same folder. The JSON configuration data is being named function.json
. It defines the bindings
and other configuration settings. The function uses this file to determine how to send data into and return it from function execution.
This is a sample JSON file:
![](https://static.packt-cdn.com/products/9781786466297/graphics/5cef1998-7532-4be6-9230-baf1d3db0179.png)
The code for the functions in a defined Function App has to be saved in a root
folder...