| 1 |
variables: |
| 2 |
azureSubscription: '{ARM ACCESS TOKEN NAME}' |
| 3 |
functionappName: '{NAME OF FUNCTIONAPP}' |
| 4 |
|
| 5 |
pool: |
| 6 |
vmImage: ubuntu-16.04 |
| 7 |
steps: |
| 8 |
- task: UsePythonVersion@0 |
| 9 |
displayName: "Setting python version to 3.6 as required by functions" |
| 10 |
inputs: |
| 11 |
versionSpec: '3.6' |
| 12 |
architecture: 'x64' |
| 13 |
- script: | |
| 14 |
dotnet restore # COMMENT OUT IF NOT USING FUNCTION EXTENSIONS |
| 15 |
dotnet build --runtime ubuntu.16.04-x64 --output './bin/' # COMMENT OUT IF NOT USING FUNCTION EXTENSIONS |
| 16 |
python3.6 -m venv worker_venv |
| 17 |
source worker_venv/bin/activate |
| 18 |
pip3.6 install setuptools |
| 19 |
pip3.6 install -r requirements.txt |
| 20 |
- task: ArchiveFiles@2 |
| 21 |
displayName: "Archive files" |
| 22 |
inputs: |
| 23 |
rootFolderOrFile: "$(System.DefaultWorkingDirectory)" |
| 24 |
includeRootFolder: false |
| 25 |
archiveFile: "$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip" |
| 26 |
- task: PublishBuildArtifacts@1 |
| 27 |
inputs: |
| 28 |
PathtoPublish: '$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip' |
| 29 |
name: 'drop' |
| 30 |
- task: AzureRmWebAppDeployment@4 |
| 31 |
inputs: |
| 32 |
connectionType: 'AzureRM' |
| 33 |
azureSubscription: "$(azureSubscription)" |
| 34 |
appType: 'functionAppLinux' |
| 35 |
webAppName: "$(functionappName)" |