Latest posts by Robert Pearman (see all)
- VisualCron: Automating with a GUI - Tue, Apr 2 2019
- Find BitLocker recovery passwords in Active Directory with PowerShell - Thu, Feb 28 2019
- Configure Azure for use as a Veeam Cloud Service Provider - Tue, Feb 12 2019
It will create We recently decided to move all of our on-premises web hosting to Azure. I believe our web hosting is now more secure than our on-premises solution, which was a basic Windows Server 2008 machine running IIS. Our new cloud-based solution scales better and deploys each site inside its own little bubble, rather than sharing a common server OS and storage.
We were hosting basic HTML sites in that environment, which involved no databases or CMS Systems, thus we only had to upload the files to the new location.
Azure can host all kinds of applications, CMS and even WordPress but for this guide I am concentrating on a traditional HTML based website.
I'll assume you already have an Azure account. If not, you can sign up for a free trial here.
Once you log in, it is important to note you are logged in as what I will call the global administrator.
Creating a new Web App ^
After logging in, you first have to add a new Web App.
From the Azure Portal Dashboard, on the left-hand side, click on the green plus sign marked New.
In the search box, enter Web App and press enter. In the search results, you should see "Web App."
Click Web App, and then click on Create.
We need to enter an App name for our Azure Web App; this is the base URL your app is available at. We also need to enter a Resource Group name and choose an App Service plan. I'm using "customer01" for both the name and the resource group. This will help keep things organized when you start adding multiple Apps.
Under App Service plan, choose Create New.
Here you can define the location your app service will run in and the pricing tier.
You have to choose a data center location and set the pricing tier. In my example I am using "D1 Shared".
This is the most basic pricing tier that allows the use of a custom domain name.
It is very easy to scale this up to a new tier at a later time if you find it is not performing well.
Certainly during migration, I would not scale it up beyond D1.
Once you are happy with your selections and names, click on Create.
It will take a few seconds to build your new Web App.
Creating a new user account ^
As I mentioned earlier, you should be currently logged in as the global administrator.
This is fine for your own use, but if you want to provide clients with their own FTP details, you should set up their own user accounts.
On the menu bar on the left-hand side, find Users and Groups. You may have to click the right arrow and search under "More Services." Click All Users, and then click New User.
You need to enter a Name and a User name.
The username must end with "@<your-azure-tenant>.onmicrosoft.com," for example, email@example.com.
It will create a default password, which you can reveal by clicking on Show Password. We will be logging into this account shortly.
Click All Resources and you should see your Web App listed.
Inside the Web App you'll find a large number of options and settings. Go to Access Control IAM.
Click Add, select the Contributor Role, and then click the new user we added in the previous step.
Open a private browser window and log in to the Azure Portal with the new user account.
You will need to update the password as part of the sign-in process. Once signed in, you will see the Customer01 Web App.
Go into customer01 and select Deployment credentials. These will be the FTP details you send to your client.
Scroll down the menu to find Properties. Inside here you will find your FTP username and address.
Migrating on-premises sites to Azure ^
In your FTP client software, you can now download your existing website and upload it to your new Azure Web App.
You connect to Azure via FTP, browse through site and wwwroot. You will see the default document "hostingstart.htm", which you can delete and replace with your own files.
Adding tags ^
Back in our global administrator window, we can perform a few final steps to ease client administration.
First, we add tags. Tags are useful when it comes to billing so you can identify which services belong to whom.
I keep the tag name consistent across resources, and update the Value to represent the client. Add tags to everything connected to this Web App, which includes the Resource Group and the App Service plan.
Adding domains ^
Next, you can add multiple domains to your Web App.
If you go into Custom Domains, you have the option to buy a domain or use an existing domain.
For a domain you already own, you will need to verify ownership by creating some DNS Records.
Click Add Hostname.
Next, enter the Domain Name and click Validate. You will then see instructions on how to validate the name, usually by CNAME or TXT record, you will need to add these via your DNS provider.
Once you have successfully validated the ownership of the domain, you can click Add Hostname.
All that is left is to update your DNS to point web traffic to your new Azure Web App.
This guide has covered the basics of setting up a website in Azure, but this does not scratch the surface of additional things you can do, and you should.
Scaling up the App Service introduces new features like the ability to use SSL with support for Let's Encrypt, automated backups, and higher performance.