question

29998411 avatar image
0 Votes"
29998411 asked azure-cxp-api edited

Deploying to AppServicePlan Functions from Azure Pipelines takes a long time

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'
not-supported
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
1 Vote"
MayankBargali-MSFT answered

Hi @29998411

DevOps is currently not supported in the Q&A forums, the supported products are listed over here https://docs.microsoft.com/en-us/answers/products (more to be added later on).

You can ask the experts in the dedicated forum over here: https://stackoverflow.com/questions/tagged/devops
https://developercommunity.visualstudio.com/spaces/21/index.html

Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.