Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
70 lines (67 sloc) 2.29 KB
# Configure the details of the functionapp
variables:
azureSubscription: '{ARM ACCESS TOKEN NAME}'
storageName: '{STORAGE NAME OF FUNCTIONAPP}'
functionappName: '{NAME OF FUNCTIONAPP}'
resourceGroupName: '{RESOURCE GROUP NAME OF FUNCTIONAPP}'
jobs:
# Build the python packages in a virtual env
- job: Build
pool:
vmImage: ubuntu-16.04
steps:
- script: |
dotnet restore
dotnet build --configuration Release
- task: DotNetCoreCLI@2
inputs:
command: publish
arguments: '--configuration Release --output publish_output'
projects: '*.csproj'
publishWebProjects: false
modifyOutputPath: true
zipAfterPublish: false
- task: ArchiveFiles@2
displayName: "Archive files"
inputs:
rootFolderOrFile: "$(System.DefaultWorkingDirectory)/publish_output/s"
includeRootFolder: false
archiveFile: "$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip"
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip'
name: 'drop'
# Download the build artifacts from
- job: Deploy
pool:
vmImage: 'VS2017-Win2016'
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'drop'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: AzureFileCopy@2
inputs:
sourcePath: "drop/build$(Build.BuildId).zip"
azureConnectionType: 'ConnectedServiceNameARM'
azureSubscription: "$(azureSubscription)"
destination: azureBlob
storage: "$(storageName)"
containerName: 'azure-build'
- task: createsastoken@1
inputs:
ConnectedServiceName: "$(azureSubscription)"
StorageAccountRM: "$(storageName)"
SasTokenTimeOutInHours: 10000
Permission: 'r'
StorageContainerName: 'azure-build'
- task: AzureAppServiceSetAppSettings@2
inputs:
ConnectedServiceName: "$(azureSubscription)"
WebAppName: "$(functionappName)"
ResourceGroupName: "$(resourceGroupName)"
AppSettings: "WEBSITE_RUN_FROM_PACKAGE='$(storageUri)/build$(Build.BuildId).zip$(storageToken)'"
dependsOn: Build
condition: succeeded()
You can’t perform that action at this time.