Skip to content

Commit 33a5fad

Browse files
Ticket ## : Update Documentation
1 parent 22d0e97 commit 33a5fad

File tree

14 files changed

+166
-100
lines changed

14 files changed

+166
-100
lines changed

docs/docfx.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"resource": [
2828
{
2929
"files": [
30-
"images/**",
30+
"documentation/**.png",
3131
"charts/**"
3232
]
3333
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Create a function
2+
3+
Install FaasNet template. This utility can be used to generate Function project in C#.
4+
5+
```
6+
dotnet new --install FaasNet.Templates
7+
```
8+
9+
Create a Function project
10+
11+
```
12+
mkdir QuickStart
13+
cd QuickStart
14+
15+
mkdir src
16+
cd src
17+
18+
dotnet new faasnetfn -n Function
19+
```
20+
21+
The following files will be created :
22+
23+
* *Startup.cs* and *Program.cs*: the application entry point.
24+
* *HelloWorldConfiguration.cs*: configuration properties of the function.
25+
* *FunctionHandler.cs*: contains the business logic. This class has one function which accepts one parameter and returns a JSON result. The input parameter has two distinct properties :
26+
27+
* Configuration: its value is coming from the gateway, it will be used to configure the behavior of the function for example : `ConnectionString` and `SQL Statement`.
28+
* Input: value passed by caller.
29+
30+
In case the Visual Studio Support is needed, a solution can be created :
31+
32+
```
33+
cd ..
34+
dotnet new sln -n QuickStart
35+
```
36+
37+
Add the Function project into the solution.
38+
39+
```
40+
dotnet sln add ./src/Function/Function.csproj
41+
```
42+
43+
# Deploy a function
44+
45+
> [!WARNING]
46+
> Before you start, Make sure your working environment is properly configured.
47+
48+
When the Function project is ready, it can be deployed to the Gateway API.
49+
50+
First of all, open a command prompt and execute the following command line to create a Docker file. The `DIRECTORY` variable must be replaced by the directory of the Function.csproj project.
51+
52+
```
53+
FaasNet.CLI function -df <DIRECTORY>
54+
```
55+
56+
Execute the following instruction to locally build the Docker image.
57+
The `DIRECTORY` variable must be replaced by the directory of the Function.csproj project, and the `IMAGENAME` variable must be replaced by the name of the Docker image for example : localhost:5000/function.
58+
59+
```
60+
FaasNet.CLI function -db <DIRECTORY> -t <IMAGENAME>
61+
```
62+
63+
Execute the following command line to push the local Docker image into a registry. The `IMAGENAME` variable must be replaced by the name of the Docker Image.
64+
65+
```
66+
FaasNet.CLI function -dp <IMAGENAME>
67+
```
68+
69+
Finally, execute the latest command line to deploy the function into the Gateway API. Replace the `FUNCTIONNAME` variable by the name of your function and replace the `IMAGENAME` variable by the name of your Docker image.
70+
71+
```
72+
FaasNet.CLI function deploy -name <FUNCTIONAME> -image <IMAGENAME>
73+
```
74+
75+
# Execute a function
76+
77+
> [!WARNING]
78+
> Before you start, Make sure you have a function deployed in the Gateway API.
79+
80+
Execute the following command to invoke a function. Replace the `FUNCTIONNAME` variable by the name of your function.
81+
82+
```
83+
FaasNet.CLI function invoke <FUNCTIONNAME> -input {} -configuration {'firstName':'coucou'}
84+
```
85+
86+
The following message is displayed
87+
88+
```
89+
{
90+
"content": {
91+
"message": "Hello 'coucou'"
92+
}
93+
}
94+
```

docs/documentation/functions/manage.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

docs/documentation/gettingstarted/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ kubectl apply -f https://raw.githubusercontent.com/simpleidserver/FaasNet/master
3939
kubectl apply -f https://raw.githubusercontent.com/simpleidserver/FaasNet/master/kubernetes/mssql-internal-svc.yml --namespace=faas
4040
```
4141

42-
Authenticate to the SQLServer database `127.0.0.1, 30002` with the following credentials :
42+
Authenticate to the SQLServer database `127.0.0.1, 30010` with the following credentials :
4343

4444
| Parameter | Value |
4545
| --------- | ------------ |
22 KB
Loading
15.1 KB
Loading
26.9 KB
Loading
29.7 KB
Loading
54.1 KB
Loading

docs/documentation/portal/index.md

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)