Skip to content

Instantly share code, notes, and snippets.

@wendelnascimento
Created August 11, 2021 20:49
Show Gist options
  • Save wendelnascimento/1839a9f3df9e163759669012a737434b to your computer and use it in GitHub Desktop.
Save wendelnascimento/1839a9f3df9e163759669012a737434b to your computer and use it in GitHub Desktop.
Azure Functions remote build on Azure Pipelines
# Node.js Function App to Linux on Azure
# Build a Node.js function app and deploy it to Azure as a Linux function app.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- main
variables:
# Azure Resource Manager connection created during pipeline creation
azureSubscription: 'AZURE_SUBSCRIPTION'
# Function app name
functionAppName: 'FUNCTION_NAME'
# Environment name
environmentName: 'ENVINRONMENT'
# Agent VM image name
vmImageName: 'ubuntu-20.04'
stages:
- stage: Publish
displayName: Publish stage
jobs:
- job: Publish
displayName: Publish
pool:
vmImage: $(vmImageName)
steps:
- task: AzureCLI@2
inputs:
azureSubscription: 'AZURE SUBSCRIPTION'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install azure-functions-core-tools-3
func azure functionapp publish FUNCTION_NAME --build remote --javascript
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment