Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade Azure Functions runtime version to 4.x #358

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions src/setup/integration-test/aliyun-integration-test-serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ service: stellar-aliyun-itgr-test
frameworkVersion: "3"

provider:
name: aliyun
runtime: python3.9
credentials: ~/.aliyuncli/credentials
region: us-west-1
name: aliyun
runtime: python3.9
credentials: ~/.aliyuncli/credentials
region: us-west-1

plugins:
- serverless-aliyun-function-compute
- serverless-aliyun-function-compute

functions:
hello:
handler: main.main
runtime: python3.9
package:
patterns:
- "!**"
- main.py
events:
- http:
path: /foo
method: get
hello:
handler: main.main
runtime: python3.9
package:
patterns:
- "!**"
- main.py
events:
- http:
path: /foo
method: get
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
service: TestService

frameworkVersion: "3"

provider:
name: aws
runtime: python3.9
region: us-west-1

package:
individually: true

functions:
testFunction1:
handler: hellopy/lambda_function.lambda_handler
Expand Down
30 changes: 16 additions & 14 deletions src/setup/integration-test/azure-integration-test-serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ service: stellar-azure-itgr-test
frameworkVersion: "3"

provider:
name: azure
region: West US
runtime: python3.8
name: azure
region: West US
runtime: python3.8
functionApp:
extensionVersion: '~4'

plugins:
- serverless-azure-functions
- serverless-azure-functions

functions:
stellar-azure-integration-test-0:
package:
patterns:
- 'main.py'
handler: main.main
events:
- http: true
methods:
- GET
authLevel: anonymous
stellar-azure-integration-test-0:
package:
patterns:
- 'main.py'
handler: main.main
events:
- http: true
methods:
- GET
authLevel: anonymous
25 changes: 19 additions & 6 deletions src/setup/serverless-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ type Serverless struct {
}

type Provider struct {
Name string `yaml:"name"`
Runtime string `yaml:"runtime"`
Region string `yaml:"region"`
Credentials string `yaml:"credentials,omitempty"`
Name string `yaml:"name"`
Runtime string `yaml:"runtime"`
Region string `yaml:"region"`
Credentials string `yaml:"credentials,omitempty"`
FunctionApp FunctionApp `yaml:"functionApp,omitempty"`
}

type FunctionApp struct {
ExtensionVersion string `yaml:"extensionVersion"`
}

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

if config.Provider == "aliyun" {
switch config.Provider {
case "azure":
s.Provider = Provider{
Name: config.Provider,
Runtime: config.Runtime,
Region: region,
FunctionApp: FunctionApp{ExtensionVersion: "~4"},
}
case "aliyun":
s.Provider = Provider{
Name: config.Provider,
Runtime: config.Runtime,
Region: region,
Credentials: "~/.aliyuncli/credentials",
}
} else {
default:
s.Provider = Provider{
Name: config.Provider,
Runtime: config.Runtime,
Expand Down