Skip to content

Commit d6b652a

Browse files
committed
add/edit comments
1 parent ed045f3 commit d6b652a

File tree

6 files changed

+11
-17
lines changed

6 files changed

+11
-17
lines changed

samples/samples-powershell/AddProductParams/run.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ param($Request)
66
# Write to the Azure Functions log stream.
77
Write-Host "PowerShell function with SQL Output Binding processed a request."
88

9+
# Update req_query with the query of the request
910
$req_query = @{
1011
"productId"= $Request.QUERY.productId;
1112
"name"= $Request.QUERY.name;
@@ -20,5 +21,5 @@ Push-OutputBinding -Name product -Value $req_query
2021
# The -Name value matches the name property in the function.json for the binding
2122
Push-OutputBinding -Name response -Value ([HttpResponseContext]@{
2223
StatusCode = [HttpStatusCode]::OK
23-
Body = $req_body
24+
Body = $req_query
2425
})

samples/samples-powershell/AddProductWithDefaultPK/function.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"direction": "in",
77
"type": "httpTrigger",
88
"methods": [
9-
"get",
109
"post"
1110
],
1211
"route": "addproductwithdefaultpk"

samples/samples-powershell/AddProductWithIdentityColumn/run.ps1

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,19 @@ param($Request)
66
# Write to the Azure Functions log stream.
77
Write-Host "PowerShell function with SQL Output Binding processed a request."
88

9-
# Update req_body with the body of the request
10-
# Note that this expects the body to be a JSON object or array of objects
11-
# which have a property matching each of the columns in the table to upsert to.
12-
$req_body = @{
9+
# Update req_query with the query of the request
10+
$req_query = @{
1311
name=$Request.QUERY.name;
1412
cost=$Request.QUERY.cost;
1513
};
1614

1715
# Assign the value we want to pass to the SQL Output binding.
1816
# The -Name value corresponds to the name property in the function.json for the binding
19-
Push-OutputBinding -Name product -Value $req_body
17+
Push-OutputBinding -Name product -Value $req_query
2018

2119
# Assign the value to return as the HTTP response.
2220
# The -Name value matches the name property in the function.json for the binding
2321
Push-OutputBinding -Name response -Value ([HttpResponseContext]@{
2422
StatusCode = [HttpStatusCode]::OK
25-
Body = $req_body
23+
Body = $req_query
2624
})

samples/samples-powershell/AddProductWithIdentityColumnIncluded/run.ps1

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,20 @@ param($Request)
66
# Write to the Azure Functions log stream.
77
Write-Host "PowerShell function with SQL Output Binding processed a request."
88

9-
# Update req_body with the body of the request
10-
# Note that this expects the body to be a JSON object or array of objects
11-
# which have a property matching each of the columns in the table to upsert to.
12-
$req_body = @{
9+
# Update req_query with the body of the request
10+
$req_query = @{
1311
productId= if($Request.QUERY.productId) { $Request.QUERY.productId } else { $null };
1412
name=$Request.QUERY.name;
1513
cost=$Request.QUERY.cost;
1614
};
1715

1816
# Assign the value we want to pass to the SQL Output binding.
1917
# The -Name value corresponds to the name property in the function.json for the binding
20-
Push-OutputBinding -Name product -Value $req_body
18+
Push-OutputBinding -Name product -Value $req_query
2119

2220
# Assign the value to return as the HTTP response.
2321
# The -Name value matches the name property in the function.json for the binding
2422
Push-OutputBinding -Name response -Value ([HttpResponseContext]@{
2523
StatusCode = [HttpStatusCode]::OK
26-
Body = $req_body
24+
Body = $req_query
2725
})

samples/samples-powershell/AddProductWithMultiplePrimaryColumnsAndIdentity/run.ps1

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ param($Request)
77
Write-Host "PowerShell function with SQL Output Binding processed a request."
88

99
# Update req_query with the body of the request
10-
# Note that this expects the body to be a JSON object or array of objects
11-
# which have a property matching each of the columns in the table to upsert to.
1210
$req_query = @{
1311
externalId=$Request.QUERY.externalId;
1412
name=$Request.QUERY.name;

test/Integration/SqlOutputBindingIntegrationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void AddProductTest(int id, string name, int cost, SupportedLanguages lan
4545
[SqlInlineData(1, "Test", 5)]
4646
[SqlInlineData(0, "", 0)]
4747
[SqlInlineData(-500, "ABCD", 580)]
48-
// Currently PowerShell returns null if the output
48+
// Currently PowerShell returns null when the parameter for name is an empty string
4949
// Issue link: https://github.com/Azure/azure-functions-sql-extension/issues/443
5050
[UnsupportedLanguages(SupportedLanguages.PowerShell)]
5151
public void AddProductParamsTest(int id, string name, int cost, SupportedLanguages lang)

0 commit comments

Comments
 (0)