Skip to content

Commit 6c1f574

Browse files
committed
Fixing F# Samples
1 parent 18678e0 commit 6c1f574

File tree

12 files changed

+150
-130
lines changed

12 files changed

+150
-130
lines changed
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
2-
"bindings": [
3-
{
4-
"type": "apiHubTrigger",
5-
"connection": "AzureWebJobsDropBox",
6-
"direction": "in",
7-
"path": "test/{name}",
8-
"name": "input"
9-
},
10-
{
11-
"name": "output",
12-
"type": "apiHub",
13-
"connection": "AzureWebJobsDropBox",
14-
"direction": "out",
15-
"path": "testOut/{name}"
16-
}
17-
]
2+
"bindings": [
3+
{
4+
"type": "apiHubFileTrigger",
5+
"connection": "AzureWebJobsDropBox",
6+
"direction": "in",
7+
"path": "test/{name}",
8+
"name": "input"
9+
},
10+
{
11+
"name": "output",
12+
"type": "apiHubFile",
13+
"connection": "AzureWebJobsDropBox",
14+
"direction": "out",
15+
"path": "testOut/{name}"
16+
}
17+
]
1818
}
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"bindings": [
3-
{
4-
"type": "blobTrigger",
5-
"name": "blob",
6-
"direction": "in",
7-
"path": "samples-input-csharp/{name}"
8-
},
9-
{
10-
"type": "blob",
11-
"name": "output",
12-
"direction": "out",
13-
"path": "samples-output-csharp/{name}"
14-
}
15-
]
2+
"bindings": [
3+
{
4+
"type": "blobTrigger",
5+
"name": "blob",
6+
"direction": "in",
7+
"path": "samples-input-fsharp/{name}"
8+
},
9+
{
10+
"type": "blob",
11+
"name": "output",
12+
"direction": "out",
13+
"path": "samples-output-fsharp/{name}"
14+
}
15+
]
1616
}
Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
{
2-
"bindings": [
3-
{
4-
"type": "queueTrigger",
5-
"direction": "in",
6-
"queueName": "samples-documentdb-csharp"
7-
},
8-
{
9-
"type": "documentdb",
10-
"direction": "out",
11-
"name": "newItem",
12-
"databaseName": "ItemDb",
13-
"collectionName": "ItemCollection",
14-
"createIfNotExists": false
15-
}
16-
]
2+
"bindings": [
3+
{
4+
"type": "queueTrigger",
5+
"name": "input",
6+
"direction": "in",
7+
"queueName": "samples-documentdb-fsharp"
8+
},
9+
{
10+
"type": "documentdb",
11+
"direction": "out",
12+
"name": "newItem",
13+
"databaseName": "ItemDb",
14+
"collectionName": "ItemCollection",
15+
"createIfNotExists": false
16+
}
17+
]
1718
}
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
2-
"bindings": [
3-
{
4-
"type": "httpTrigger",
5-
"direction": "in",
6-
"methods": [ "get" ]
7-
},
8-
{
9-
"type": "http",
10-
"direction": "out"
11-
}
12-
]
2+
"bindings": [
3+
{
4+
"type": "httpTrigger",
5+
"name": "req",
6+
"direction": "in",
7+
"methods": [ "get" ]
8+
},
9+
{
10+
"type": "http",
11+
"name": "res",
12+
"direction": "out"
13+
}
14+
]
1315
}
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
2-
"bindings": [
3-
{
4-
"type": "httpTrigger",
5-
"direction": "in",
6-
"methods": [ "post" ]
7-
},
8-
{
9-
"type": "http",
10-
"direction": "out"
11-
}
12-
]
2+
"bindings": [
3+
{
4+
"type": "httpTrigger",
5+
"name": "req",
6+
"direction": "in",
7+
"methods": [ "post" ]
8+
},
9+
{
10+
"type": "http",
11+
"name": "res",
12+
"direction": "out"
13+
}
14+
]
1315
}
Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
{
2-
"bindings": [
3-
{
4-
"type": "queueTrigger",
5-
"direction": "in",
6-
"queueName": "samples-easytables-csharp"
7-
},
8-
{
9-
"type": "easyTable",
10-
"name": "newItem",
11-
"direction": "out"
12-
}
13-
]
2+
"bindings": [
3+
{
4+
"type": "queueTrigger",
5+
"name": "input",
6+
"direction": "in",
7+
"queueName": "samples-mobiletables-fsharp"
8+
},
9+
{
10+
"type": "mobileTable",
11+
"name": "newItem",
12+
"direction": "out",
13+
"connection": "AzureWebJobs_TestMobileUri"
14+
}
15+
]
1416
}
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
2-
"bindings": [
3-
{
4-
"type": "queueTrigger",
5-
"direction": "in",
6-
"queueName": "samples-notificationHub-csharp"
7-
},
8-
{
9-
"type": "notificationHub",
10-
"direction": "out",
11-
"name": "messageProperties"
12-
}
13-
]
2+
"bindings": [
3+
{
4+
"type": "queueTrigger",
5+
"name": "input",
6+
"direction": "in",
7+
"queueName": "samples-notificationHub-fsharp"
8+
},
9+
{
10+
"type": "notificationHub",
11+
"name": "messageProperties",
12+
"direction": "out"
13+
}
14+
]
1415
}

sample/QueueTrigger-FSharp/run.fsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1+
//----------------------------------------------------------------------------------------
2+
// This prelude allows scripts to be edited in Visual Studio or another F# editing environment
3+
4+
#if !COMPILED
5+
#I "../../bin/Binaries/WebJobs.Script.Host"
6+
#r "Microsoft.Azure.WebJobs.Host.dll"
7+
#endif
8+
9+
//----------------------------------------------------------------------------------------
10+
// This is the implementation of the function
11+
112
open System
2-
open System.IO
13+
open Microsoft.Azure.WebJobs.Host
314

4-
let inputPath = Environment.GetEnvironmentVariable("input")
5-
let input = File.ReadAllText(inputPath)
6-
let message = sprintf "F# script processed queue message '%s'" input
7-
Console.Out.WriteLine(message)
15+
let Run (input: string, log: TraceWriter) =
16+
log.Info(sprintf "F# script processed queue message '%s'" input)
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"bindings": [
3-
{
4-
"type": "timerTrigger",
5-
"schedule": "0 * * * * *",
6-
"runOnStartup": true,
7-
"direction": "in"
8-
}
9-
]
2+
"bindings": [
3+
{
4+
"type": "timerTrigger",
5+
"name": "timerInfo",
6+
"schedule": "0 * * * * *",
7+
"direction": "in"
8+
}
9+
]
1010
}

sample/TimerTrigger-FSharp/run.fsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ open System
1414
open Microsoft.Azure.WebJobs
1515
open Microsoft.Azure.WebJobs.Host
1616

17-
let Run(input: TimerInfo, log: TraceWriter ) =
18-
log.Verbose("C# Timer trigger function executed.");
17+
let Run(timerInfo: TimerInfo, log: TraceWriter ) =
18+
log.Verbose("F# Timer trigger function executed.");

0 commit comments

Comments
 (0)