Last active
June 30, 2017 04:32
-
-
Save sjwaight/8a530aff0e5f3991484176825b49a563 to your computer and use it in GitHub Desktop.
bash script that enables the phpMyAdmin Site Extension on an Azure Web App
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/sh | |
azuresub=$1 | |
demoresourcegroup=$2 | |
webappname=$3 | |
deployuser=$4 | |
deploypass=$5 | |
# CAUTION! RESTS CREDS for *all* Web Apps | |
# az webapp deployment user set --user-name $deployuser --password $deploypass | |
# read the phpmyadmin extension configuration (required to create it) | |
wget --user $deployuser --password $deploypass https://${webappname}.scm.azurewebsites.net/api/siteextensions/phpmyadmin --output-document phpmyadmin.ext.json | |
# enable the phpmyadmin extension - sends the extension definition in the body | |
curl -u $deployuser:$deploypass -i -X PUT -H "Content-Type:application/json" https://${webappname}.scm.azurewebsites.net/api/siteextensions/phpmyadmin -d @phpmyadmin.ext.json | |
# restart our Web App to ensure the route is registered to phpMyAdmin | |
az webapp restart --name ${webappname} --resource-group $demoresourcegroup | |
echo | |
echo "Open a web browser at https://"$webappname".scm.azurewebsites.net/phpMyAdmin/ to access the MySQL web manager." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment