Skip to content

Commit 0e3bc70

Browse files
authored
Add copyright header and remove comments (Azure#622)
* remove the comment and add copyright header * add a comment about known issue
1 parent 7992981 commit 0e3bc70

File tree

24 files changed

+73
-15
lines changed

24 files changed

+73
-15
lines changed

docs/SetupGuide_PowerShell.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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,

samples/samples-powershell/AddProduct/run.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
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+
14
using 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.
710
Write-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

samples/samples-powershell/AddProductParams/run.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
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+
14
using 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.
710
Write-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

samples/samples-powershell/AddProductWithDefaultPK/run.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
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+
14
using 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.
710
Write-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

samples/samples-powershell/AddProductWithIdentityColumn/run.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
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+
14
using 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.
710
Write-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;

samples/samples-powershell/AddProductWithIdentityColumnIncluded/run.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
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+
14
using 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.
710
Write-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;

samples/samples-powershell/AddProductWithMultiplePrimaryColumnsAndIdentity/run.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
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+
14
using 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.
710
Write-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;

samples/samples-powershell/AddProductsArray/run.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
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+
14
using 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.
710
Write-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

samples/samples-powershell/AddProductsWithIdentityColumnArray/run.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
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+
14
using 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.
710
Write-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;

samples/samples-powershell/GetAndAddProducts/run.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
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+
14
using 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-
68
param($Request, $TriggerMetadata, $products)
79

810
Push-OutputBinding -Name productsWithIdentity -Value $products

0 commit comments

Comments
 (0)