File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
samples/samples-powershell/AddProductWithDefaultPK Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,19 @@ Write-Host "PowerShell function with SQL Output Binding processed a request."
11
11
12
12
# Note that this expects the body to be a JSON object or array of objects
13
13
# which have a property matching each of the columns in the table to upsert to.
14
- $req_body = $Request.Body
14
+ # Output bindings require the [ordered] attribute. See https://github.com/Azure/azure-functions-sql-extension#output-bindings for more details.
15
+ $req_query = [ordered ]@ {
16
+ Name = $Request.QUERY.name ;
17
+ Cost = $Request.QUERY.cost ;
18
+ };
15
19
16
20
# Assign the value we want to pass to the SQL Output binding.
17
21
# The -Name value corresponds to the name property in the function.json for the binding
18
- Push-OutputBinding - Name products - Value $req_body
22
+ Push-OutputBinding - Name products - Value $req_query
19
23
20
24
# Assign the value to return as the HTTP response.
21
25
# The -Name value matches the name property in the function.json for the binding
22
26
Push-OutputBinding - Name Response - Value ([HttpResponseContext ]@ {
23
27
StatusCode = [HttpStatusCode ]::OK
24
- Body = $req_body
28
+ Body = $req_query
25
29
})
Original file line number Diff line number Diff line change @@ -355,9 +355,6 @@ public void AddProductWithIdentity_MissingPrimaryColumn(SupportedLanguages lang)
355
355
/// </summary>
356
356
[ Theory ]
357
357
[ SqlInlineData ( ) ]
358
- // Currently PowerShell gives an unknown error (when testing locally we get a missing primary key error)
359
- // Issue link: https://github.com/Azure/azure-functions-sql-extension/issues/448
360
- [ UnsupportedLanguages ( SupportedLanguages . PowerShell ) ]
361
358
public void AddProductWithDefaultPKTest ( SupportedLanguages lang )
362
359
{
363
360
this . StartFunctionHost ( nameof ( AddProductWithDefaultPK ) , lang ) ;
You can’t perform that action at this time.
0 commit comments