File tree Expand file tree Collapse file tree 5 files changed +45
-5
lines changed
TestBasicHttpTriggerWithProfile Expand file tree Collapse file tree 5 files changed +45
-5
lines changed Original file line number Diff line number Diff line change @@ -24,11 +24,15 @@ Describe 'HttpTrigger Tests' {
24
24
@ {
25
25
FunctionName = ' TestBasicHttpTriggerWithTriggerMetadata'
26
26
ExpectedContent = ' Hello Atlas'
27
+ },
28
+ @ {
29
+ FunctionName = ' TestBasicHttpTriggerWithProfile'
30
+ ExpectedContent = ' PROFILE'
27
31
}
28
32
) {
29
- param ($ExpectedContent )
33
+ param ($FunctionName , $ ExpectedContent )
30
34
31
- $res = Invoke-WebRequest " $FUNCTIONS_BASE_URL /api/TestBasicHttpTrigger ?Name=Atlas"
35
+ $res = Invoke-WebRequest " $FUNCTIONS_BASE_URL /api/$ ( $FunctionName ) ?Name=Atlas"
32
36
33
37
$res.StatusCode | Should - Be ([HttpStatusCode ]::Accepted)
34
38
$res.Content | Should - Be $ExpectedContent
@@ -50,12 +54,12 @@ Describe 'HttpTrigger Tests' {
50
54
FunctionName = ' TestBasicHttpTriggerWithTriggerMetadata'
51
55
}
52
56
) {
53
- param ($InputNameData )
57
+ param ($FunctionName , $ InputNameData )
54
58
55
59
if (Test-Path ' variable:InputNameData' ) {
56
- $url = " $FUNCTIONS_BASE_URL /api/TestBasicHttpTrigger ?Name=$InputNameData "
60
+ $url = " $FUNCTIONS_BASE_URL /api/$ ( $FunctionName ) ?Name=$InputNameData "
57
61
} else {
58
- $url = " $FUNCTIONS_BASE_URL /api/TestBasicHttpTrigger "
62
+ $url = " $FUNCTIONS_BASE_URL /api/$ ( $FunctionName ) "
59
63
}
60
64
61
65
$res = { invoke-webrequest $url } |
Original file line number Diff line number Diff line change
1
+ function Get-ProfileString {
2
+ " PROFILE"
3
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "disabled" : false ,
3
+ "bindings" : [
4
+ {
5
+ "authLevel" : " function" ,
6
+ "type" : " httpTrigger" ,
7
+ "direction" : " in" ,
8
+ "name" : " req" ,
9
+ "methods" : [
10
+ " get" ,
11
+ " post"
12
+ ]
13
+ },
14
+ {
15
+ "type" : " http" ,
16
+ "direction" : " out" ,
17
+ "name" : " res"
18
+ }
19
+ ]
20
+ }
Original file line number Diff line number Diff line change
1
+ #
2
+ # Copyright (c) Microsoft. All rights reserved.
3
+ # Licensed under the MIT license. See LICENSE file in the project root for full license information.
4
+ #
5
+
6
+ # Input bindings are passed in via param block.
7
+ param ($req )
8
+
9
+ Push-OutputBinding - Name res - Value ([HttpResponseContext ]@ {
10
+ StatusCode = 202
11
+ Body = (Get-ProfileString )
12
+ })
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ Expand-Archive $output -DestinationPath $FUNC_CLI_DIRECTORY
35
35
Write-Host " Copying azure-functions-powershell-worker to Functions Host workers directory..."
36
36
37
37
$configuration = if ($env: CONFIGURATION ) { $env: CONFIGURATION } else { ' Debug' }
38
+ Remove-Item - Recurse - Force - Path " $FUNC_CLI_DIRECTORY /workers/powershell"
38
39
Copy-Item - Recurse - Force " $PSScriptRoot /../../src/bin/$configuration /netcoreapp2.1/publish/" " $FUNC_CLI_DIRECTORY /workers/powershell"
39
40
40
41
Write-Host " Staring Functions Host..."
You can’t perform that action at this time.
0 commit comments