Skip to content

Instantly share code, notes, and snippets.

@gagarine
Created July 30, 2021 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gagarine/250be8548aa5785fe45061cfb702b72c to your computer and use it in GitHub Desktop.
Save gagarine/250be8548aa5785fe45061cfb702b72c to your computer and use it in GitHub Desktop.
Deploy local nodejs project on Azure App Service using Azure CLI and zip package
#!/bin/sh
echo 'Cleanup...'
rm MyProject-package.zip
rm -r node_modules
echo 'Build...'
npm install
npm run build
zip -r MyProject-package.zip . -x '.git/*' -x 'src/*' -x '.idea/*' -x '.env'
echo 'Deploy...'
az webapp deployment source config-zip --resource-group MyGroup --name MyProject --src MyProject-package.zip
echo 'Warmup Request'
curl --head https://MyProject.azurewebsites.net/
echo 'Get Log Tail'
az webapp log tail --resource-group MyGroup --name MyProject
@gagarine
Copy link
Author

This build locally a zip and push it to Azure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment