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
156156
157157 Write-Host " PowerShell function with SQL Output Binding processed a request."
158158
159- # Update req_body with the body of the request
160159 $req_body = @ (
161160 @{
162161 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+
14using namespace System.Net
25
36# Trigger binding data passed in via param block
@@ -6,7 +9,6 @@ param($Request, $TriggerMetadata)
69# Write to the Azure Functions log stream.
710Write-Host " PowerShell function with SQL Output Binding processed a request."
811
9- # Update req_body with the body of the request
1012# Note that this expects the body to be a JSON object or array of objects
1113# which have a property matching each of the columns in the table to upsert to.
1214$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+
14using namespace System.Net
25
36# Trigger binding data passed in via param block
@@ -6,7 +9,6 @@ param($Request, $TriggerMetadata)
69# Write to the Azure Functions log stream.
710Write-Host " PowerShell function with SQL Output Binding processed a request."
811
9- # Update req_query with the query of the request
1012# Currently the Powershell worker does not allow empty/null values to be passed through the
1113# query parameters. We use TriggerMetadata here as a workaround for that issue.
1214# 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+
14using namespace System.Net
25
36# Trigger binding data passed in via param block
@@ -6,7 +9,6 @@ param($Request, $TriggerMetadata)
69# Write to the Azure Functions log stream.
710Write-Host " PowerShell function with SQL Output Binding processed a request."
811
9- # Update req_body with the body of the request
1012# Note that this expects the body to be a JSON object or array of objects
1113# which have a property matching each of the columns in the table to upsert to.
1214$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+
14using namespace System.Net
25
36# Trigger binding data passed in via param block
@@ -6,7 +9,7 @@ param($Request, $TriggerMetadata)
69# Write to the Azure Functions log stream.
710Write-Host " PowerShell function with SQL Output Binding processed a request."
811
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.
1013$req_query = [ordered ]@ {
1114 Name = $Request.QUERY.name ;
1215 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+
14using namespace System.Net
25
36# Trigger binding data passed in via param block
@@ -6,7 +9,7 @@ param($Request, $TriggerMetadata)
69# Write to the Azure Functions log stream.
710Write-Host " PowerShell function with SQL Output Binding processed a request."
811
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.
1013$req_query = [ordered ]@ {
1114 ProductId = if ($Request.QUERY.productId ) { [int ]$Request.QUERY.productId } else { $null };
1215 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+
14using namespace System.Net
25
36# Trigger binding data passed in via param block
@@ -6,7 +9,7 @@ param($Request, $TriggerMetadata)
69# Write to the Azure Functions log stream.
710Write-Host " PowerShell function with SQL Output Binding processed a request."
811
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.
1013$req_query = [ordered ]@ {
1114 ExternalId = $Request.QUERY.externalId ;
1215 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+
14using namespace System.Net
25
36# Trigger binding data passed in via param block
@@ -6,7 +9,6 @@ param($Request, $TriggerMetadata)
69# Write to the Azure Functions log stream.
710Write-Host " PowerShell function with SQL Output Binding processed a request."
811
9- # Update req_body with the body of the request
1012# Note that this expects the body to be a JSON object or array of objects
1113# which have a property matching each of the columns in the table to upsert to.
1214$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+
14using namespace System.Net
25
36# Trigger binding data passed in via param block
@@ -6,9 +9,9 @@ param($Request, $TriggerMetadata)
69# Write to the Azure Functions log stream.
710Write-Host " PowerShell function with SQL Output Binding processed a request."
811
9- # Update req_body with the body of the request
1012# Note that this expects the body to be a JSON object or array of objects
1113# 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.
1215$req_body = @ ([ordered ]@ {
1316 Name = " Cup" ;
1417 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+
14using namespace System.Net
25
36# This function uses a SQL input binding to get products from the Products table
47# and upsert those products to the ProductsWithIdentity table.
5-
68param ($Request , $TriggerMetadata , $products )
79
810Push-OutputBinding - Name productsWithIdentity - Value $products
You can’t perform that action at this time.
0 commit comments