Skip to content

Commit 42b4c52

Browse files
committed
upgrade to Azure Functions v4
1 parent 047a533 commit 42b4c52

File tree

4 files changed

+55
-36
lines changed

4 files changed

+55
-36
lines changed

src/setup/integration-test/aliyun-integration-test-serverless.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ service: stellar-aliyun-itgr-test
33
frameworkVersion: "3"
44

55
provider:
6-
name: aliyun
7-
runtime: python3.9
8-
credentials: ~/.aliyuncli/credentials
9-
region: us-west-1
6+
name: aliyun
7+
runtime: python3.9
8+
credentials: ~/.aliyuncli/credentials
9+
region: us-west-1
1010

1111
plugins:
12-
- serverless-aliyun-function-compute
12+
- serverless-aliyun-function-compute
1313

1414
functions:
15-
hello:
16-
handler: main.main
17-
runtime: python3.9
18-
package:
19-
patterns:
20-
- "!**"
21-
- main.py
22-
events:
23-
- http:
24-
path: /foo
25-
method: get
15+
hello:
16+
handler: main.main
17+
runtime: python3.9
18+
package:
19+
patterns:
20+
- "!**"
21+
- main.py
22+
events:
23+
- http:
24+
path: /foo
25+
method: get

src/setup/integration-test/aws-integration-test-serverless.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
service: TestService
2+
23
frameworkVersion: "3"
4+
35
provider:
46
name: aws
57
runtime: python3.9
68
region: us-west-1
9+
710
package:
811
individually: true
12+
913
functions:
1014
testFunction1:
1115
handler: hellopy/lambda_function.lambda_handler

src/setup/integration-test/azure-integration-test-serverless.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@ service: stellar-azure-itgr-test
33
frameworkVersion: "3"
44

55
provider:
6-
name: azure
7-
region: West US
8-
runtime: python3.8
6+
name: azure
7+
region: West US
8+
runtime: python3.8
9+
functionApp:
10+
extensionVersion: '~4'
911

1012
plugins:
11-
- serverless-azure-functions
13+
- serverless-azure-functions
1214

1315
functions:
14-
stellar-azure-integration-test-0:
15-
package:
16-
patterns:
17-
- 'main.py'
18-
handler: main.main
19-
events:
20-
- http: true
21-
methods:
22-
- GET
23-
authLevel: anonymous
16+
stellar-azure-integration-test-0:
17+
package:
18+
patterns:
19+
- 'main.py'
20+
handler: main.main
21+
events:
22+
- http: true
23+
methods:
24+
- GET
25+
authLevel: anonymous

src/setup/serverless-config.go

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@ type Serverless struct {
2525
}
2626

2727
type Provider struct {
28-
Name string `yaml:"name"`
29-
Runtime string `yaml:"runtime"`
30-
Region string `yaml:"region"`
31-
Credentials string `yaml:"credentials,omitempty"`
28+
Name string `yaml:"name"`
29+
Runtime string `yaml:"runtime"`
30+
Region string `yaml:"region"`
31+
Credentials string `yaml:"credentials,omitempty"`
32+
FunctionApp FunctionApp `yaml:"functionApp,omitempty"`
33+
}
34+
35+
type FunctionApp struct {
36+
ExtensionVersion string `yaml:"extensionVersion"`
3237
}
3338

3439
type Package struct {
@@ -126,14 +131,22 @@ func (s *Serverless) CreateHeaderConfig(config *Configuration, serviceName strin
126131
s.Service = serviceName
127132
s.FrameworkVersion = "3"
128133

129-
if config.Provider == "aliyun" {
134+
switch config.Provider {
135+
case "azure":
136+
s.Provider = Provider{
137+
Name: config.Provider,
138+
Runtime: config.Runtime,
139+
Region: region,
140+
FunctionApp: FunctionApp{ExtensionVersion: "~4"},
141+
}
142+
case "aliyun":
130143
s.Provider = Provider{
131144
Name: config.Provider,
132145
Runtime: config.Runtime,
133146
Region: region,
134147
Credentials: "~/.aliyuncli/credentials",
135148
}
136-
} else {
149+
default:
137150
s.Provider = Provider{
138151
Name: config.Provider,
139152
Runtime: config.Runtime,

0 commit comments

Comments
 (0)