How to install Wordpress server based on Azure Web App

From PUBLIC-WIKI
Revision as of 17:31, 14 February 2019 by Eyales (talk | contribs)
Jump to navigation Jump to search

How to install Azure CLI Tools

  • Login to the machine using privileged account.
  • Download the latest build of Azure CLI.
  • Windows download instruction and location:
https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latest
  • Linux download instruction and location:
https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?view=azure-cli-latest

How to login to an Azure subscription

  • Login to an Azure account, from command prompt:
az login
  • Run the command below to list the available subscriptions:
az account list --output table
  • Run the command below to change the context to a specific Azure subscription:
az account set --subscription "MySubscription"
Note: Replace “MySubscription” with the relevant subscription name
  • Run the command below to verify the currently selected Azure subscription:
az account show

Installation phase

  • Run the command below to create a new resource group:
az group create --name MyResourceGroup --location MyLocation
Note 1: Replace MyResourceGroup with your own relevant group name
Note 2: Replace MyLocation with the target location, from the list below:
https://azure.microsoft.com/en-us/global-infrastructure/locations/
  • Run the command below (as a single line) to create a new Azure App Service plan:
az appservice plan create -n wordpressappservice -g MyResourceGroup -l MyLocation --is-linux --sku S1
Note 1: Replace wordpressappservice with your own app service plan name (Alphanumeric, without space or special characters)
Note 2: Replace MyResourceGroup with the previously create resource group
Note 3: Replace MyLocation with the same region as the resource group
  • Run the command below (as a single line) to create a new MySQL database:
az mysql server create -g MyResourceGroup -n MyDBServerName --admin-user MyDBUserName --admin-password "MyDBPassword" -l MyLocation --ssl-enforcement Disabled --sku-name B_Gen5_1 --version 5.7
Note 1: Replace MyResourceGroup with the previously create resource group
Note 2: Replace MyDBServerName with your own MySQL server name
Note 3: Replace MyDBUserName with your own MySQL username
Note 4: Replace MyDBPassword with a complex password for the MySQL database account
Note 5: Replace MyLocation with the same region as the resource group
  • Run the command below (as a single line) to configure firewall rule for accessing the MySQL database:
az mysql server firewall-rule create -g MyResourceGroup --server MyDBServerName --name AllowAppService --start-ip-address 0.0.0.0 --end-ip-address 0.0.0.0
Note 1: Replace MyResourceGroup with the previously create resource group
Note 2: Replace MyDBServerName with your own MySQL server name