Last active
July 9, 2020 08:06
-
-
Save atrauzzi/187e38127634bb97a77cc71dcc1ef1b0 to your computer and use it in GitHub Desktop.
π Azure App Service deployment using bash and CURL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NAME="some-convention-driven-name-usually-a-resource-group" | |
APP="your-app-name-ideally-another-convention" | |
DEPLOYMENT_PASSWORD=`az appservice web deployment list-site-credentials \ | |
--resource-group ${NAME} \ | |
--name ${APP} \ | |
--query publishingPassword \ | |
--output tsv` | |
DEPLOYMENT_USERNAME=`az appservice web deployment list-site-credentials \ | |
--resource-group ${NAME} \ | |
--name ${APP} \ | |
--query publishingUserName \ | |
--output tsv` | |
DEPLOYMENT_HOST=`az appservice web deployment list-site-credentials \ | |
--resource-group ${NAME} \ | |
--name ${APP} \ | |
--query name \ | |
--output tsv` | |
PAIR="${DEPLOYMENT_USERNAME}:${DEPLOYMENT_PASSWORD}" | |
PAIR=$(echo $PAIR|tr -d '\n') | |
AUTHORIZATION_TOKEN=`echo -ne "$PAIR" | base64 -w 0` | |
AUTHORIZATION_HEADER="Authorization: Basic ${AUTHORIZATION_TOKEN}" | |
zip -r -v apps.zip apps/ | |
curl -v -X PUT https://${DEPLOYMENT_HOST}.scm.azurewebsites.net/api/zip/site/wwwroot --header "${AUTHORIZATION_HEADER}" --upload-file apps.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment