Hi, I managed to deploy from a zip file to an Azure Flex Consumption Plan with an Azure DevOps pipeline based on a yaml file. Therefore I used the yaml code below for the deployment stage, which uses Azure CLI. During the build stage I archived the package in the directory below and published it in the following way. Note, that if you are using a private Python package location, you have to specify PIP_EXTRA_INDEX_URL in the correct way in the app setting of your Azure Function.
#Publish package
- publish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
artifact: drop
$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip #Archive directory
- stage: Deploy
displayName: Deploy stage
dependsOn: Build
condition: succeeded()
jobs:
- deployment: Deploy
displayName: Deploy
environment: 'development'
pool:
vmImage: $(vmImageName)
strategy:
runOnce:
deploy:
steps:
- task: AzureCLI@2
displayName: 'Deploy using az cli'
inputs:
azureSubscription: $(azureSubscription)
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
echo "Deploying using OneDeploy"
az functionapp deployment source config-zip \
--resource-group $(resourceGroupName) \
--name $(functionAppName) \
--src $(Pipeline.Workspace)/drop/$(Build.BuildId).zip