File tree Expand file tree Collapse file tree 24 files changed +73
-15
lines changed
samples/samples-powershell
AddProductWithIdentityColumnIncluded
AddProductWithIdentityColumn
AddProductWithMultiplePrimaryColumnsAndIdentity
AddProductsWithIdentityColumnArray
GetProductsStoredProcedureFromAppSetting
GetProductsStoredProcedure
test/Integration/test-powershell
AddProductIncorrectCasing
AddProductMissingColumnsExceptionFunction
AddProductsNoPartialUpsert
GetProductsColumnTypesSerialization Expand file tree Collapse file tree 24 files changed +73
-15
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,6 @@ Note: This tutorial requires that a SQL database is setup as shown in [Create a
156
156
157
157
Write-Host " PowerShell function with SQL Output Binding processed a request."
158
158
159
- # Update req_body with the body of the request
160
159
$req_body = @ (
161
160
@{
162
161
EmployeeId=1,
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License. See License.txt in the project root for license information.
3
+
1
4
using namespace System.Net
2
5
3
6
# Trigger binding data passed in via param block
@@ -6,7 +9,6 @@ param($Request, $TriggerMetadata)
6
9
# Write to the Azure Functions log stream.
7
10
Write-Host " PowerShell function with SQL Output Binding processed a request."
8
11
9
- # Update req_body with the body of the request
10
12
# Note that this expects the body to be a JSON object or array of objects
11
13
# which have a property matching each of the columns in the table to upsert to.
12
14
$req_body = $Request.Body
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License. See License.txt in the project root for license information.
3
+
1
4
using namespace System.Net
2
5
3
6
# Trigger binding data passed in via param block
@@ -6,7 +9,6 @@ param($Request, $TriggerMetadata)
6
9
# Write to the Azure Functions log stream.
7
10
Write-Host " PowerShell function with SQL Output Binding processed a request."
8
11
9
- # Update req_query with the query of the request
10
12
# Currently the Powershell worker does not allow empty/null values to be passed through the
11
13
# query parameters. We use TriggerMetadata here as a workaround for that issue.
12
14
# Issue link: https://github.com/Azure/azure-functions-powershell-worker/issues/895
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License. See License.txt in the project root for license information.
3
+
1
4
using namespace System.Net
2
5
3
6
# Trigger binding data passed in via param block
@@ -6,7 +9,6 @@ param($Request, $TriggerMetadata)
6
9
# Write to the Azure Functions log stream.
7
10
Write-Host " PowerShell function with SQL Output Binding processed a request."
8
11
9
- # Update req_body with the body of the request
10
12
# Note that this expects the body to be a JSON object or array of objects
11
13
# which have a property matching each of the columns in the table to upsert to.
12
14
$req_body = $Request.Body
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License. See License.txt in the project root for license information.
3
+
1
4
using namespace System.Net
2
5
3
6
# Trigger binding data passed in via param block
@@ -6,7 +9,7 @@ param($Request, $TriggerMetadata)
6
9
# Write to the Azure Functions log stream.
7
10
Write-Host " PowerShell function with SQL Output Binding processed a request."
8
11
9
- # Update req_query with the query of the request
12
+ # Output bindings require the [ordered] attribute. See https://github.com/Azure/azure-functions-sql-extension#output-bindings for more details.
10
13
$req_query = [ordered ]@ {
11
14
Name = $Request.QUERY.name ;
12
15
Cost = $Request.QUERY.cost ;
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License. See License.txt in the project root for license information.
3
+
1
4
using namespace System.Net
2
5
3
6
# Trigger binding data passed in via param block
@@ -6,7 +9,7 @@ param($Request, $TriggerMetadata)
6
9
# Write to the Azure Functions log stream.
7
10
Write-Host " PowerShell function with SQL Output Binding processed a request."
8
11
9
- # Update req_query with the body of the request
12
+ # Output bindings require the [ordered] attribute. See https://github.com/Azure/azure-functions-sql-extension#output-bindings for more details.
10
13
$req_query = [ordered ]@ {
11
14
ProductId = if ($Request.QUERY.productId ) { [int ]$Request.QUERY.productId } else { $null };
12
15
Name = $Request.QUERY.name ;
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License. See License.txt in the project root for license information.
3
+
1
4
using namespace System.Net
2
5
3
6
# Trigger binding data passed in via param block
@@ -6,7 +9,7 @@ param($Request, $TriggerMetadata)
6
9
# Write to the Azure Functions log stream.
7
10
Write-Host " PowerShell function with SQL Output Binding processed a request."
8
11
9
- # Update req_query with the body of the request
12
+ # Output bindings require the [ordered] attribute. See https://github.com/Azure/azure-functions-sql-extension#output-bindings for more details.
10
13
$req_query = [ordered ]@ {
11
14
ExternalId = $Request.QUERY.externalId ;
12
15
Name = $Request.QUERY.name ;
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License. See License.txt in the project root for license information.
3
+
1
4
using namespace System.Net
2
5
3
6
# Trigger binding data passed in via param block
@@ -6,7 +9,6 @@ param($Request, $TriggerMetadata)
6
9
# Write to the Azure Functions log stream.
7
10
Write-Host " PowerShell function with SQL Output Binding processed a request."
8
11
9
- # Update req_body with the body of the request
10
12
# Note that this expects the body to be a JSON object or array of objects
11
13
# which have a property matching each of the columns in the table to upsert to.
12
14
$req_body = $Request.Body
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License. See License.txt in the project root for license information.
3
+
1
4
using namespace System.Net
2
5
3
6
# Trigger binding data passed in via param block
@@ -6,9 +9,9 @@ param($Request, $TriggerMetadata)
6
9
# Write to the Azure Functions log stream.
7
10
Write-Host " PowerShell function with SQL Output Binding processed a request."
8
11
9
- # Update req_body with the body of the request
10
12
# Note that this expects the body to be a JSON object or array of objects
11
13
# which have a property matching each of the columns in the table to upsert to.
14
+ # Output bindings require the [ordered] attribute. See https://github.com/Azure/azure-functions-sql-extension#output-bindings for more details.
12
15
$req_body = @ ([ordered ]@ {
13
16
Name = " Cup" ;
14
17
Cost = 2 ;
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License. See License.txt in the project root for license information.
3
+
1
4
using namespace System.Net
2
5
3
6
# This function uses a SQL input binding to get products from the Products table
4
7
# and upsert those products to the ProductsWithIdentity table.
5
-
6
8
param ($Request , $TriggerMetadata , $products )
7
9
8
10
Push-OutputBinding - Name productsWithIdentity - Value $products
You can’t perform that action at this time.
0 commit comments