Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
bash script that enables the phpMyAdmin Site Extension on an Azure Web App
#!/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
You can’t perform that action at this time.