Skip to content

Commit 3611543

Browse files
committed
adding documentdb scripting
1 parent fe4bb7a commit 3611543

File tree

27 files changed

+395
-28
lines changed

27 files changed

+395
-28
lines changed

WebJobs.Script.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EasyTable-Node", "EasyTable
172172
sample\EasyTables-Node\index.js = sample\EasyTables-Node\index.js
173173
EndProjectSection
174174
EndProject
175+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DocumentDB-CSharp", "DocumentDB-CSharp", "{437EB182-8CB9-42BD-9019-E5F6E69D1DB3}"
176+
ProjectSection(SolutionItems) = preProject
177+
sample\DocumentDB-CSharp\function.json = sample\DocumentDB-CSharp\function.json
178+
sample\DocumentDB-CSharp\run.csx = sample\DocumentDB-CSharp\run.csx
179+
EndProjectSection
180+
EndProject
181+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DocumentDB-Node", "DocumentDB-Node", "{8811DCFB-1023-4577-AB9C-B4F191200082}"
182+
ProjectSection(SolutionItems) = preProject
183+
sample\DocumentDB-Node\function.json = sample\DocumentDB-Node\function.json
184+
sample\DocumentDB-Node\index.js = sample\DocumentDB-Node\index.js
185+
EndProjectSection
186+
EndProject
175187
Global
176188
GlobalSection(SolutionConfigurationPlatforms) = preSolution
177189
Debug|Any CPU = Debug|Any CPU
@@ -232,5 +244,7 @@ Global
232244
{C23BB3D1-6921-4FCF-8E45-09540E1F986E} = {FF9C0818-30D3-437A-A62D-7A61CA44F459}
233245
{B51AE854-21D2-49D2-B83D-9FA18780A175} = {FF9C0818-30D3-437A-A62D-7A61CA44F459}
234246
{87E44645-EA02-4F12-8C3E-820B5710292D} = {FF9C0818-30D3-437A-A62D-7A61CA44F459}
247+
{437EB182-8CB9-42BD-9019-E5F6E69D1DB3} = {FF9C0818-30D3-437A-A62D-7A61CA44F459}
248+
{8811DCFB-1023-4577-AB9C-B4F191200082} = {FF9C0818-30D3-437A-A62D-7A61CA44F459}
235249
EndGlobalSection
236250
EndGlobal
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
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+
]
17+
}

sample/DocumentDB-CSharp/run.csx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using System;
2+
3+
public static void Run(string input, out object newItem)
4+
{
5+
newItem = new
6+
{
7+
text = "Hello from C#! " + input
8+
};
9+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"bindings": [
3+
{
4+
"type": "queueTrigger",
5+
"direction": "in",
6+
"queueName": "samples-documentdb-node"
7+
},
8+
{
9+
"type": "documentdb",
10+
"direction": "out",
11+
"name": "item",
12+
"databaseName": "ItemDb",
13+
"collectionName": "ItemCollection",
14+
"createIfNotExists": false
15+
}
16+
]
17+
}

sample/DocumentDB-Node/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = function (context, input) {
2+
context.log('Node.js queue-triggered DocumentDB function called with input ' + input);
3+
4+
context.bindings.item = {
5+
text: "Hello from Node! " + input
6+
};
7+
8+
context.done();
9+
}

sample/EasyTables-Node/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = function (context, input) {
2-
context.log('Node.js triggered function via EasyTables called with input ' + input);
2+
context.log('Node.js queue-triggered EasyTable function called with input ' + input);
33

44
context.bindings.item = {
55
Text: "Hello from Node! " + input

src/WebJobs.Script.Host/WebJobs.Script.Host.csproj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,24 @@
6363
<HintPath>..\..\packages\Microsoft.AspNet.WebHooks.Receivers.1.2.0-beta6\lib\net45\Microsoft.AspNet.WebHooks.Receivers.dll</HintPath>
6464
<Private>True</Private>
6565
</Reference>
66+
<Reference Include="Microsoft.Azure.Documents.Client, Version=1.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
67+
<HintPath>..\..\packages\Microsoft.Azure.DocumentDB.1.5.3\lib\net40\Microsoft.Azure.Documents.Client.dll</HintPath>
68+
<Private>True</Private>
69+
</Reference>
6670
<Reference Include="Microsoft.Azure.WebJobs, Version=1.1.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6771
<HintPath>..\..\packages\Microsoft.Azure.WebJobs.Core.1.1.2-alpha-10267\lib\net45\Microsoft.Azure.WebJobs.dll</HintPath>
6872
<Private>True</Private>
6973
</Reference>
7074
<Reference Include="Microsoft.Azure.WebJobs.Extensions, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
71-
<HintPath>..\..\packages\Microsoft.Azure.WebJobs.Extensions.1.0.2-alpha-10251\lib\net45\Microsoft.Azure.WebJobs.Extensions.dll</HintPath>
75+
<HintPath>..\..\packages\Microsoft.Azure.WebJobs.Extensions.1.0.2-alpha-10252\lib\net45\Microsoft.Azure.WebJobs.Extensions.dll</HintPath>
76+
<Private>True</Private>
77+
</Reference>
78+
<Reference Include="Microsoft.Azure.WebJobs.Extensions.DocumentDB, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
79+
<HintPath>..\..\packages\Microsoft.Azure.WebJobs.Extensions.DocumentDB.1.0.0-alpha-10252\lib\net45\Microsoft.Azure.WebJobs.Extensions.DocumentDB.dll</HintPath>
7280
<Private>True</Private>
7381
</Reference>
7482
<Reference Include="Microsoft.Azure.WebJobs.Extensions.EasyTables, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
75-
<HintPath>..\..\packages\Microsoft.Azure.WebJobs.Extensions.EasyTables.1.0.0-alpha-10251\lib\net45\Microsoft.Azure.WebJobs.Extensions.EasyTables.dll</HintPath>
83+
<HintPath>..\..\packages\Microsoft.Azure.WebJobs.Extensions.EasyTables.1.0.0-alpha-10252\lib\net45\Microsoft.Azure.WebJobs.Extensions.EasyTables.dll</HintPath>
7684
<Private>True</Private>
7785
</Reference>
7886
<Reference Include="Microsoft.Azure.WebJobs.Extensions.SendGrid, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">

src/WebJobs.Script.Host/packages.config

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net45" />
77
<package id="Microsoft.AspNet.WebHooks.Common" version="1.2.0-rc1" targetFramework="net46" />
88
<package id="Microsoft.AspNet.WebHooks.Receivers" version="1.2.0-beta6" targetFramework="net46" />
9+
<package id="Microsoft.Azure.DocumentDB" version="1.5.3" targetFramework="net46" />
910
<package id="Microsoft.Azure.Mobile.Client" version="2.0.1" targetFramework="net46" />
1011
<package id="Microsoft.Azure.ServiceBus.EventProcessorHost" version="1.4.0" targetFramework="net46" />
1112
<package id="Microsoft.Azure.WebJobs" version="1.1.2-alpha-10267" targetFramework="net46" />
1213
<package id="Microsoft.Azure.WebJobs.Core" version="1.1.2-alpha-10267" targetFramework="net46" />
13-
<package id="Microsoft.Azure.WebJobs.Extensions" version="1.0.2-alpha-10251" targetFramework="net46" />
14-
<package id="Microsoft.Azure.WebJobs.Extensions.EasyTables" version="1.0.0-alpha-10251" targetFramework="net46" />
14+
<package id="Microsoft.Azure.WebJobs.Extensions" version="1.0.2-alpha-10252" targetFramework="net46" />
15+
<package id="Microsoft.Azure.WebJobs.Extensions.DocumentDB" version="1.0.0-alpha-10252" targetFramework="net46" />
16+
<package id="Microsoft.Azure.WebJobs.Extensions.EasyTables" version="1.0.0-alpha-10252" targetFramework="net46" />
1517
<package id="Microsoft.Azure.WebJobs.Extensions.SendGrid" version="1.0.2-alpha-10251" targetFramework="net46" />
1618
<package id="Microsoft.Azure.WebJobs.ServiceBus" version="1.1.2-alpha-10267" targetFramework="net46" />
1719
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net46" />

src/WebJobs.Script.WebHost/WebJobs.Script.WebHost.csproj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,24 @@
119119
<HintPath>..\..\packages\Microsoft.AspNet.WebHooks.Receivers.WordPress.1.2.0-beta6\lib\net45\Microsoft.AspNet.WebHooks.Receivers.WordPress.dll</HintPath>
120120
<Private>True</Private>
121121
</Reference>
122+
<Reference Include="Microsoft.Azure.Documents.Client, Version=1.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
123+
<HintPath>..\..\packages\Microsoft.Azure.DocumentDB.1.5.3\lib\net40\Microsoft.Azure.Documents.Client.dll</HintPath>
124+
<Private>True</Private>
125+
</Reference>
122126
<Reference Include="Microsoft.Azure.WebJobs, Version=1.1.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
123127
<HintPath>..\..\packages\Microsoft.Azure.WebJobs.Core.1.1.2-alpha-10267\lib\net45\Microsoft.Azure.WebJobs.dll</HintPath>
124128
<Private>True</Private>
125129
</Reference>
126130
<Reference Include="Microsoft.Azure.WebJobs.Extensions, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
127-
<HintPath>..\..\packages\Microsoft.Azure.WebJobs.Extensions.1.0.2-alpha-10251\lib\net45\Microsoft.Azure.WebJobs.Extensions.dll</HintPath>
131+
<HintPath>..\..\packages\Microsoft.Azure.WebJobs.Extensions.1.0.2-alpha-10252\lib\net45\Microsoft.Azure.WebJobs.Extensions.dll</HintPath>
132+
<Private>True</Private>
133+
</Reference>
134+
<Reference Include="Microsoft.Azure.WebJobs.Extensions.DocumentDB, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
135+
<HintPath>..\..\packages\Microsoft.Azure.WebJobs.Extensions.DocumentDB.1.0.0-alpha-10252\lib\net45\Microsoft.Azure.WebJobs.Extensions.DocumentDB.dll</HintPath>
128136
<Private>True</Private>
129137
</Reference>
130138
<Reference Include="Microsoft.Azure.WebJobs.Extensions.EasyTables, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
131-
<HintPath>..\..\packages\Microsoft.Azure.WebJobs.Extensions.EasyTables.1.0.0-alpha-10251\lib\net45\Microsoft.Azure.WebJobs.Extensions.EasyTables.dll</HintPath>
139+
<HintPath>..\..\packages\Microsoft.Azure.WebJobs.Extensions.EasyTables.1.0.0-alpha-10252\lib\net45\Microsoft.Azure.WebJobs.Extensions.EasyTables.dll</HintPath>
132140
<Private>True</Private>
133141
</Reference>
134142
<Reference Include="Microsoft.Azure.WebJobs.Extensions.SendGrid, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">

src/WebJobs.Script.WebHost/packages.config

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@
2222
<package id="Microsoft.AspNet.WebHooks.Receivers.Stripe" version="1.2.0-beta6" targetFramework="net45" />
2323
<package id="Microsoft.AspNet.WebHooks.Receivers.Trello" version="1.2.0-beta6" targetFramework="net45" />
2424
<package id="Microsoft.AspNet.WebHooks.Receivers.WordPress" version="1.2.0-beta6" targetFramework="net45" />
25+
<package id="Microsoft.Azure.DocumentDB" version="1.5.3" targetFramework="net46" />
2526
<package id="Microsoft.Azure.Mobile.Client" version="2.0.1" targetFramework="net46" />
2627
<package id="Microsoft.Azure.WebJobs" version="1.1.2-alpha-10267" targetFramework="net46" />
2728
<package id="Microsoft.Azure.WebJobs.Core" version="1.1.2-alpha-10267" targetFramework="net46" />
28-
<package id="Microsoft.Azure.WebJobs.Extensions" version="1.0.2-alpha-10251" targetFramework="net46" />
29-
<package id="Microsoft.Azure.WebJobs.Extensions.EasyTables" version="1.0.0-alpha-10251" targetFramework="net46" />
29+
<package id="Microsoft.Azure.WebJobs.Extensions" version="1.0.2-alpha-10252" targetFramework="net46" />
30+
<package id="Microsoft.Azure.WebJobs.Extensions.DocumentDB" version="1.0.0-alpha-10252" targetFramework="net46" />
31+
<package id="Microsoft.Azure.WebJobs.Extensions.EasyTables" version="1.0.0-alpha-10252" targetFramework="net46" />
3032
<package id="Microsoft.Azure.WebJobs.Extensions.SendGrid" version="1.0.2-alpha-10251" targetFramework="net46" />
3133
<package id="Microsoft.Azure.WebJobs.ServiceBus" version="1.1.2-alpha-10267" targetFramework="net46" />
3234
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net46" />

0 commit comments

Comments
 (0)