- Azure Sentinel—A real-world example - Tue, Oct 12 2021
- Deploying Windows Hello for Business - Wed, Aug 4 2021
- Azure Purview: Data governance for on-premises, multicloud, and SaaS data - Wed, Feb 17 2021
Setting up a website using the GUI
The easiest way to set up a new website is to log on to the Azure console, go to Websites, click New in the lower left corner, and select Quick Create. Specify the URL (all Azure websites have to have a unique name in the .azurewebsites.net name space) and the hosting plan. That’s all there is to it.
First page of creating a custom website
If you’d like more control, you can select Custom Create, which allows you to add a database (either SQL or MySQL) and define the database connection string. There’s also an option for linking this new site to Visual Studio Online, CodePlex, GitHub, Bitbucket, or a local Git repository. If you elect to use a database, the next page allows you to define the database server and optional advanced settings such as collation and maximum database size.
Specifying database settings
Sometimes you don’t want the plain website that you get with the quick create or custom options. If you want a Content Management System (CMS) to handle your site, click From Gallery, which will let you pick Drupal, Joomla, Orchard, and WordPress, among many others. If you want a framework to run your code in, choose between ASP.NET, PHP, or Tomcat/Jetty for Java and several others. Depending on which app you pick, the next page or two will allow you to configure the framework and any associated databases.
Picking CMS or framework
If you don’t have a website editing tool handy, Microsoft offers the surprisingly capable (if you know HTML) WebMatrix as a free download.
Once your site is up, one of your first tasks will be to configure a vanity domain for your site. This is a two-step process involving specifying your current DNS registrar first and then setting it up in Azure.
Configuring a custom domain
Working with Azure websites through PowerShell
If you’re allergic to GUIs or you have a lot of websites to create, you can use cmdlets to work with Azure websites. To set up a new site, use New-AzureWebsite SiteName. To find out about an existing site, use Get-AzureWebsite –Name SiteName. To stop a running site, use Stop-AzureWebsite.
Azure Websites tiers
The Free tier offers 10 websites per subscription and 1 GB of storage, but not much else. The Shared tier (currently in preview) offers 100 sites and 1 GB of storage but comes with an integrated load balancer, can scale out to six instances, and offers custom domain support at around $10 per month per site. For more reliability, the Basic and Standard tiers come in small, medium, and large sizes and have SSL support as well as a financially backed 99.9% SLA. For more information and a comparison of the different tiers, see here. Switching is as easy as going to the Scale tab for your website and choosing a different tier.
Scaling to a different tier
The value proposition of Azure website hosting
With the description and how-to of this service out of the way, let’s look at what’s compelling; after all, many other hosting companies offers IIS website hosting. First, the range of CMSs and platforms offered make it easy to use the service the way you want to. Second, Azure website hosting offers a true global presence with the ability to host (and manage) multiple copies of a site in different regions and use Traffic manager to direct clients browsing your site to their closest datacenter.
The Standard tier offers multiple Deployment slots (there used to be only two), which let you publish your site to a separate URL and do testing and QA before swapping the web traffic over. Because both sites are “live” and ready, the swap is almost instantaneous. If there’s a hitch, you can quickly swap back to the previous production site. Different slots (you can name them whatever you like) can have different database connection strings.
There’s also a Backup and Restore feature, currently in preview, which lets you store zip file copies of your sites in an Azure storage account. These backups can be taken manually or on a scheduled basis. Another interesting feature, available in all tiers, is WebJobs, which lets you run tasks in the background on a site in the form of scripts (.cmd, PowerShell, bash, python, and node). These can be run manually, on a schedule, or continuously.
The Standard tier also offers AutoScaling (preview) based on website criteria (such as HTTP queue length) that can scale site instances both up and down. Currently, this feature has to be configured in the DevOps preview portal.
Developers working in Visual Studio (2012 and 2013) can do Live Remote debugging against your site. A hidden gem is the Kudu platform—a set of developer tools that can be reached by going to yoursite.scm.azurewebsites.net. SCM stands for Source Control Manager, which is what the first version offered. Now, however, Kudu provides a process explorer, a debugging console, several other tools, and a gallery of extensions to further fine-tune your site.
Kudu extension gallery
To extend the functionality of your site, Azure offers a host of third-party add-ons for things like OCR, IP identification, translation, and email automation.
Azure website add-ons
For Java developers, Azure websites run Java version 1.70_51 with Tomcat 7.0.50 or Jetty 9.10.20131115.
Microsoft is a company of developers, and it shows in the Azure Websites service. If all you’re interested in is a server to host a website, many other similar options are available in the market. But, if you’re looking for a developer-friendly platform to build web applications with, Azure offers a very compelling service with a broad range of extensions available.
Visual Studio Online
In a related move, Microsoft offers a web-based development site called Visual Studio Online (VSO). Although this is far from the full IDE application, it does provide a source control mechanism for up to five developers (in the free tier) and even some load testing minutes to play with. To get to VSO after you have enabled it for your site, simply go to https://sitename.scm.azurewebsites.net/dev or click the link on the Azure console dashboard.
Visual Studio Online
Azure Hybrid Connections
A fairly recent addition is Hybrid Connections, which is borrowed from the Azure BizTalk service. It’s not unique to websites but can be used whenever you need hybrid functionality. Imagine that your new site needs to be able to display data from an on-premises database that, for regulatory or security/compliance reasons, you can’t easily move to the cloud. But you still want to run your website on Azure. With Hybrid Connections, you can do so without having to expose your database server on the Internet and without having to configure clunky CNAME records just to let Azure find the database. It’s a secure, encrypted, site-to-site link for HTTP, HTTPS, and TCP traffic.
In fact, this single, seemingly simple service might be the “killer app” for Azure in general (and websites in particular) in getting IT to start using hybrid infrastructure. For step-by-step instructions specific to websites, see here.
Why Azure website hosting
The bottom line is that, if all you want is a basic, “company brochure” website, Azure website hosting has you covered with an easy-to-use platform. And, if you want to build a full-fledged web application that can scale to true cloud scale and be hosted in multiple locations around the globe, Azure can grow with your site.
Want to write for 4sysops? We are looking for new authors.