I'm deploying my application to Azure Functions using the pipeline below.
Deploying to Functions in the Consumption plan completes the deployment stage in less than a minute, but deploying to Functions in the App Service Plan takes more than 10 minutes to deploy.
Why is it taking so long to deploy to Functions in AppServicePlan from Azure Pipelines?
yml
trigger:
branches:
include:
- develop
resources:
- repo: self
variables:
pythonVersion: 3.6
serviceConnetion: 'subscription'
functionAppName: 'functionAppName'
vmImageName: 'ubuntu-latest'
workingDirectory: '$(System.DefaultWorkingDirectory)/'
pool:
vmImage: $(vmImageName)
stages:
- stage: Build
displayName: 'Build stage'
jobs:
- job: Build
displayName: Build
steps:
- bash: |
if [ -f extensions.csproj ]
then
dotnet build extensions.csproj --runtime ubuntu.16.04-x64 --output ./bin
fi
workingDirectory: $(workingDirectory)
displayName: 'Build extensions'
- task: UsePythonVersion@0
displayName: 'Use Python $(pythonVersion)'
inputs:
versionSpec: $(pythonVersion)
- bash: |
python -m venv worker_venv
source worker_venv/bin/activate
pip install -r requirements.txt
workingDirectory: $(workingDirectory)
displayName: 'Install application dependencies'
- task: ArchiveFiles@2
displayName: 'Archive files'
inputs:
rootFolderOrFile: '$(workingDirectory)'
includeRootFolder: false
archiveType: zip
archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
replaceExistingArchive: true
- publish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
artifact: drop
- stage: Deploy
displayName: 'Develop stage'
dependsOn: Build
condition: succeeded()
jobs:
- deployment: Deploy
displayName: Deploy
environment: 'development'
strategy:
runOnce:
deploy:
steps:
- task: AzureFunctionApp@1
displayName: 'Azure functions app deploy'
inputs:
azureSubscription: '$(serviceConnetion)'
appType:
appName: $(functionAppName)
package: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip'
deploymentMethod: 'runFromPackage'