Skip to content

Commit

Permalink
[#IOCIT-176] Update function runtime v4 and deploy pipeline (#206)
Browse files Browse the repository at this point in the history
* [#IOCIT-176] Update function runtime v4 and deploy pipeline

* [IOCIT-176] Fix comment
  • Loading branch information
BurnedMarshal authored Dec 28, 2022
1 parent 65e81dd commit b42be2a
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 101 deletions.
80 changes: 0 additions & 80 deletions .circleci/config.yml

This file was deleted.

34 changes: 17 additions & 17 deletions .devops/deploy-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Azure DevOps pipeline to release a new version and deploy to production.

variables:
HEALTHCHECK_PATH: '/info'
HEALTHCHECK_PATH: '/info'

parameters:
- name: 'RELEASE_SEMVER'
Expand All @@ -19,11 +19,11 @@ pr: none

# This pipeline has been implemented to be run on hosted agent pools based both
# on 'windows' and 'ubuntu' virtual machine images and using the scripts defined
# in the package.json file. Since we are deploying on Azure functions on Windows
# runtime, the pipeline is currently configured to use a Windows hosted image for
# in the package.json file. Since we are deploying on Azure functions on Linux
# runtime, the pipeline is currently configured to use an ubuntu hosted image for
# the build and deploy.
pool:
vmImage: 'windows-2019'
vmImage: 'ubuntu-latest'

resources:
repositories:
Expand Down Expand Up @@ -95,8 +95,8 @@ stages:
- task: DotNetCoreCLI@2
inputs:
command: "build"
arguments: "-o bin"
# Copy application to
arguments: "-o bin"
# Copy application to
- task: CopyFiles@2
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)'
Expand All @@ -118,12 +118,12 @@ stages:
!tsconfig.json
displayName: 'Copy deploy files'

- task: AzureFunctionApp@1
- task: AzureFunctionApp@1
inputs:
azureSubscription: '$(PRODUCTION_AZURE_SUBSCRIPTION)'
resourceGroupName: '$(PRODUCTION_RESOURCE_GROUP_NAME)'
resourceGroupName: 'io-p-admin-rg'
appType: 'functionApp'
appName: '$(PRODUCTION_APP_NAME)'
appName: 'io-p-admin-fn'
package: '$(Build.ArtifactStagingDirectory)/'
deploymentMethod: 'auto'
deployToSlotOrASE: true
Expand All @@ -137,12 +137,12 @@ stages:
dependsOn:
- Deploy_staging
jobs:
- job: 'do_healthcheck'
steps:
- job: 'do_healthcheck'
steps:
- checkout: none
- script: |
# fails if response status is not 2xx
curl -f 'https://$(PRODUCTION_APP_NAME)-staging.azurewebsites.net/$(HEALTHCHECK_PATH)'
curl -f 'https://io-p-admin-fn-staging.azurewebsites.net/$(HEALTHCHECK_PATH)'
displayName: 'Healthcheck'
# Promote the staging instance to production
Expand All @@ -151,13 +151,13 @@ stages:
- Healthcheck
- Deploy_staging
jobs:
- job: 'do_deploy'
- job: 'do_deploy'
steps:
- task: AzureAppServiceManage@0
- task: AzureAppServiceManage@0
inputs:
azureSubscription: '$(PRODUCTION_AZURE_SUBSCRIPTION)'
resourceGroupName: '$(PRODUCTION_RESOURCE_GROUP_NAME)'
webAppName: '$(PRODUCTION_APP_NAME)'
resourceGroupName: 'io-p-admin-rg'
webAppName: 'io-p-admin-fn'
sourceSlot: staging
swapWithProduction: true
displayName: Swap with production slot
Expand All @@ -169,7 +169,7 @@ stages:
pool:
vmImage: 'ubuntu-latest'
jobs:
- job: publish_SDK
- job: publish_SDK
steps:
# Template for generating and deploying client SDk to NPM
- template: templates/client-sdk-publish/template.yaml@pagopaCommons
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"azureFunctions.deploySubpath": ".",
"azureFunctions.projectLanguage": "TypeScript",
"azureFunctions.projectRuntime": "~2",
"azureFunctions.projectRuntime": "~4",
"debug.internalConsoleOptions": "neverOpen",
"azureFunctions.preDeployTask": "npm prune",
"editor.formatOnSave": true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# IO Functions for administration of the platform

This project implements the APIs to enable the administration functionalities required by the the IO platform. The APIs are called by the Azure API Management developer portal and other IO related projects.
The implementation is based on the Azure Functions v2 runtime.
The implementation is based on the Azure Functions v4 runtime.

#### Required environment variables

Expand Down
4 changes: 4 additions & 0 deletions host.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@
"traceReplayEvents": false
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[3.*, 4.0.0)"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"description": "",
"devDependencies": {
"@azure/functions": "^1.0.3",
"@azure/functions": "^3.5.0",
"@pagopa/eslint-config": "^1.3.1",
"@pagopa/openapi-codegen-ts": "^10.0.5",
"@types/documentdb": "^1.10.8",
Expand Down
11 changes: 10 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,20 @@
universal-user-agent "^6.0.0"
uuid "^8.3.0"

"@azure/functions@^1.0.3", "@azure/functions@^1.2.3":
"@azure/functions@^1.2.3":
version "1.2.3"
resolved "https://registry.yarnpkg.com/@azure/functions/-/functions-1.2.3.tgz#65765837e7319eedffbf8a971cb2f78d4e043d54"
integrity sha512-dZITbYPNg6ay6ngcCOjRUh1wDhlFITS0zIkqplyH5KfKEAVPooaoaye5mUFnR+WP9WdGRjlNXyl/y2tgWKHcRg==

"@azure/functions@^3.5.0":
version "3.5.0"
resolved "https://registry.yarnpkg.com/@azure/functions/-/functions-3.5.0.tgz#64df210c676637ea720e9896d135046491f20d9b"
integrity sha512-RBYGdZIPYT17UPGBcXI9DPlpaEOO5D8r7pDpJsm/2N5eVrpqIRO8VZuoIiZiEQWV0LO3BZNzlvdS87pzBUBJzQ==
dependencies:
iconv-lite "^0.6.3"
long "^4.0.0"
uuid "^8.3.0"

"@azure/graph@^4.0.1":
version "4.3.0"
resolved "https://registry.yarnpkg.com/@azure/graph/-/graph-4.3.0.tgz#1d7d475468aab3c62d46f9afead04ef8d99a9490"
Expand Down

0 comments on commit b42be2a

Please sign in to comment.