Skip to content

Commit 81ee8b7

Browse files
committed
Refactoring/Fixing Script binding pipeline
1 parent c3fcdd1 commit 81ee8b7

File tree

32 files changed

+252
-123
lines changed

32 files changed

+252
-123
lines changed

WebJobs.Script.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EventHubTrigger", "EventHub
154154
index.js = index.js
155155
EndProjectSection
156156
EndProject
157+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BlobTrigger-Batch", "BlobTrigger-Batch", "{C23BB3D1-6921-4FCF-8E45-09540E1F986E}"
158+
ProjectSection(SolutionItems) = preProject
159+
sample\BlobTrigger-Batch\function.json = sample\BlobTrigger-Batch\function.json
160+
sample\BlobTrigger-Batch\run.bat = sample\BlobTrigger-Batch\run.bat
161+
EndProjectSection
162+
EndProject
157163
Global
158164
GlobalSection(SolutionConfigurationPlatforms) = preSolution
159165
Debug|Any CPU = Debug|Any CPU
@@ -211,5 +217,6 @@ Global
211217
{9B95236B-987B-4928-B2CB-561823B38FA1} = {FF9C0818-30D3-437A-A62D-7A61CA44F459}
212218
{15BA01AE-580C-4FBB-A117-F3B112B4BD02} = {FF9C0818-30D3-437A-A62D-7A61CA44F459}
213219
{B80C88CF-68EE-4400-A68D-216F1F85179C} = {FF9C0818-30D3-437A-A62D-7A61CA44F459}
220+
{C23BB3D1-6921-4FCF-8E45-09540E1F986E} = {FF9C0818-30D3-437A-A62D-7A61CA44F459}
214221
EndGlobalSection
215222
EndGlobal
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"bindings": [
3+
{
4+
"type": "blobTrigger",
5+
"direction": "in",
6+
"path": "samples-batch/{name}"
7+
},
8+
{
9+
"type": "blob",
10+
"name": "output",
11+
"direction": "out",
12+
"path": "samples-output/{name}"
13+
}
14+
]
15+
}

sample/BlobTrigger-Batch/run.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
echo OFF
2+
SET /p input=<%input%
3+
echo Windows Batch script processed blob '%input%'
4+
echo %input% > %output%

sample/QueueTrigger-Bash/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
read -r input
1+
input=$(<$input)
22
printf "Bash script processed queue message: $input"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
echo OFF
2-
SET /p input=
2+
SET /p input=<%input%
33
echo Windows Batch script processed queue message '%input%'
44
echo %input% > %output%

sample/QueueTrigger-FSharp/run.fsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
let input = System.Console.In.ReadLine()
1+
open System
2+
open System.IO
3+
4+
let inputPath = Environment.GetEnvironmentVariable("input")
5+
let input = File.ReadAllText(inputPath)
26
let message = sprintf "F# script processed queue message '%s'" input
3-
System.Console.Out.WriteLine(message)
7+
Console.Out.WriteLine(message)

sample/QueueTrigger-Php/run.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
$input = fgets(STDIN);
2+
$input = file_get_contents(getenv('input'));
33
$input = rtrim($input, "\n\r");
44
fwrite(STDOUT, "PHP script processed queue message '$input'");
55
?>

sample/QueueTrigger-Powershell/queueTrigger.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$in = [Console]::ReadLine()
1+
$in = Get-Content $Env:input
22

33
[Console]::WriteLine("Powershell script processed queue message '$in'")
44

sample/QueueTrigger-Python/function.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
{
99
"type": "table",
10-
"name": "input",
10+
"name": "tableInput",
1111
"direction": "in",
1212
"tableName": "samples",
1313
"partitionKey": "samples",

sample/QueueTrigger-Python/queueTrigger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
import json
33

44
# read the queue message and write to stdout
5-
input = input();
5+
input = open(os.environ['input']).read()
66
message = "Python script processed queue message '{0}'".format(input)
77
print(message)
88

99
# read the entities from the table binding
10-
tableData = open(os.environ['input'])
10+
tableData = open(os.environ['tableInput'])
1111
table = json.load(tableData)
1212
print("Read {0} Table entities".format(len(table)))
1313
for entity in table:

0 commit comments

Comments
 (0)