Azure Website Hosting · IT Consulting & Development | Custom Software, SAP, Microsoft

Azure Website Hosting

Home / Service Offerings / Services-Microsoft / Azure / Azure Website Hosting

Introduction: Choosing the right hosting provider

Which hosting should you choose existing Web hosting Provider or migrate to a cloud hosting provider like Azure/AWS/GCP ?

We know there are more than compelling reasons in market to choose Azure or a similar cloud hosting provider like AWS or Google and is also the buzz word that you would keep hearing more often where someone would ask you to  shift from your existing  web hosting provider to a cloud hosting provider.

But wait…. though there are leading cloud service providers in the market but here are some reasons we are trying to explain why you should/should not make a move and factors that you should consider and base your decision on that. We are going to base our discussion on Azure for now and you can follow up as we add more articles at a later stage to compare other hosting provider. However, similar path may be chosen if you select GCP or AWS as your hosting provider for web pages.

There is a difference in being a web hosting provider and a cloud hosting provider. Where the web hosting ends, cloud hosting just starts and has a breadth of services which can be explored.

  • IAAS example virtual machines which spans from .5 GB RAM to Few TBs and hundreds of processors.
  • PAAS example webapp. Azure SQL,
  • SAAS example Application insights, Azure Active Directory etc.

So, It’s unfair to compare the two but let’s anyways see how they are different for which we prepared a checklist.

Download our checklist here which could explain to you which service you could opt for and see if it helps you decide on your migration path.

NOTE: We offer 2 months free of Cloud Hosting service as a partner to AWS, Microsoft and Google up to 200$ credits.

  • Hosting migration charges may vary from site to site would start from 400$
  • Talk to us to know more.

In this blog we include some steps to migrate your existing WordPress website from your hosting provider to Azure:

  1. Creation of website content’s package
  2. Installation of website’s content package in Azure Website
  3. Installation of Website’s database in Azure website

1.    Create WordPress Azure

There are 2 options for running WordPress website in Azure:

  1. Running WordPress on Linux: This runs WordPress in a docker container which is hosted on Linux server. Database runs on a separate server and connection is established from WordPress running in container to the database server.
  2. Standard WordPress installation: This runs a common WordPress installation hosted on Windows. Like option 1 database runs on a separate database server.

This section covers setting up WordPress using both the methods:

1.1 WordPress on Linux

Step 1: In Azure portal search for “WordPress on Linux”

Step 2: Select “Wordpress on Linux” option from the search results

Step 3: Click on ‘Create’, it will then prompt for below details:

Step 4: Click on App Service plan/location to select where you want to run the website and on what configuration. Please note, location of the website also affects database server options:

Step 5: Next is selecting database server, here you would need to enter the database server name, login name & password and also select the pricing tier

Once done click ‘Create’ and it will start provisioning the website and the database.

Step 6: After website is created, if you browse the website directly it will show below error: “Error establishing a database connection”

To resolve this you would need to update database firewall rules. Set ‘Allow access to Azure service’ to ‘Yes’ & click save.

Now your website should be able to access the database and will start running.

1.2 Standard WordPress

In this option, Azure run WordPress as a standard web app on Windows server. Please note, this could be an expensive option compare to running ‘WordPress on Linux’

Step 1: To start, search WordPress and select the ‘WordPress’ from search results and click ‘Create’

Step 2: Enter the required details like name, subscription, resource group and App Service plan

Select the Pricing Tier

Step 3: Based on the location in the App Service plan, some of the database options might not be available:

To resolve this, you would need to select the location where you get the most optimum database option:

Step 4: Once all details are in, click ‘Create’ to create the new website.

2.     Setting up Custom Domain & DNS entries

After you get the website running in Azure, next step is to configure DNS entry to point your website to your domain. This is done by adding CNAME entry in you DNS provider, below are the steps:

  1. Go to Azure App services and find Custom App Domain and click on “Add Custom Domain”

After you click on Add custom Domain above it opens up a pane on the right side where you follow below steps:

  1. Enter Custom Domain
  2. Click on Validate
  3. Use Cname as hostname
  4. Use the TXT and CNAME records value and copy them to update in your existing Domain provider.

Now use the above records and create new entry for TXT and CNAME and do the same for A record entry as well

once done click on validate and you would see both checkboxes turn green after the entries are maintained

  1. Here we have to setup DNS settings for our website. We will first configure the main website to point to Azure traffic manager and then we will configure the other region-specific website to the respective app services created above.
  2. Before we go ahead, we need to understand that below we would be adding CNAME records. Refer below link to understand what is CNAME record.

https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-custom-domain-name-portal#understand-cname-and-a-records

3.    Creation of Website’s content Package.

  1. Login into your existing WordPress website.
  2. Initiate the Package creation process. For this we need “Duplicator” Plugin by which we can easily create the Package which contains website content.
  3. Click on Duplicator link on the left-hand side below after installing “Duplicator” plugin & click on “Next” button.
  1. Once we click on next button it will scan and check is it ok to create package.
  2. If Scan is successful without any issues, then click on “Build” Button.
  1. Once Build process is done, package creation process is completed. Download both “Installer” and “Archive” files of the package.

4.     Installation of Website’s content Package in Azure website.

  1. Login into new “Client’s” Azure website Instance.
  2. To Install the website Package, we need Kudu. Hence the URL has “.scm.” in it.
  1. Go to Debug Console and click on CMD and then on Site.
  1. Click on “wwwroot” and here we have to install our WordPress website.
  2. Make sure you empty the entire content of the folder first.
  3. Then Drag and drop both files which were downloaded as a part of Package creation & package installation process will start.
  • Once done, you might have to create a new file here (web.config) if it is deleted before and update it with following content.
  • This content would change based on the App Service in which Installation is done.
<?xml version=”1.0″ encoding=”UTF-8″?>
<!– This new IIS config file was created by Duplicator Installer on 2019-06-08 07:30:20.
The original can be found in archived file with the name web.config.orig –>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name=”WordPress: https://{app-name}.azurewebsites.net” patternSyntax=”Wildcard”>
                    <match url=”*” />
                    <conditions>
                        <add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” />
                        <add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true” />
                    </conditions>
                    <action type=”Rewrite” url=”index.php” />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

5.     Migration of Website’s Database in Azure website.

  1. After Installation, browser “Installer.php” file which will launch the DB installation process.
  2. Click on “Next” button on Step 1.
  1. Once Step 1 is done and before moving ahead to Step 2, we have to change the SQL script “dup-database.sql”. 
  2. In SQL script replace: “ENGINE=MyISAM” with “ENGINE=InnoDB”.
  1. Provide Host, Database, User and password details and click on “Next” & then click on “OK” on Step 2.

  1. Click on “Next” on Step 3.
  1. Now Installation is complete,
  1. Once done, activate the plugins which are deactivated.

Conclusion:

To summarize the discussion in this blog we talked about

Using duplicator plugin get the content and move to the Client’s Azure instance with those details. Then to Install WordPress site and update the web.config file. Update the installer.php file and provide host DB user and password details

Setting up Azure components to set up Resource group, App service and adding Traffic manager to manage routing to Country specific or regional sites based on the rules configured in the system

In next blog we take up some additional topics which you could plan to include in your current scope of migrating your website: 

  1. Setting up Azure components
  2. Setting up DNS entries
  3. Creating SSL certificate and securing websites

For any business enquiry please drop us a message on our website

Article was written to help users migrate to Azure pl read the disclaimer below:

Disclaimer: This article contains information for Microsoft Azure product and steps on how to host your site on Azure. We are Microsoft partner and we may receive a commission if you choose to procure the license from us. We are not paid to write this post. With this post we intend to help our readers get some technical idea of migration and to promote our services in conjunction with  Microsoft products.

Leave a Reply

Your email address will not be published. Required fields are marked *

× How can I help you?