How to enable a Site Extension in Azure Websites

Site Extensions are an amazing part of Azure Websites, they have the ability to (surprise, surprise) extend the functionality of a Website by providing new language support or some new functionality to the site. This can be seen from my last post where I added WordPress Command Line Interface support to Azure Websites.

In that post, I showed how you can use the new preview portal to add the site extension, but in this post I wanted to talk about both the Current Management Portal as well as the Preview Portal so there is single place to find both instruction sets.

Site Extensions (Management Portal)

There is no integration within the management portal to enable Site Extensions, but all isn’t lost. You can still add site extensions from your Kudu Console (SCM Site), one of the easiest ways to get to your website is the portal (provided you’re already there). You can click Browse to launch your website.

image

Once our website loads, we can change the URL, slightly, to enter into the Kudu Console. You’ll notice I’ve added the https:// protocol to the beginning of the URL and .scm after the name of the website.

image

In the navigation bar, you will see Site Extensions.

image

There are two tabs on the Site Extensions page, Installed and Gallery. There might not be anything listed under installed at first. Click on gallery to get the list of Site Extensions you can install.

image

Clicking on a plus sign on a gallery item will install the Site Extension. After the Site Extension is install, you must hit the “Restart Site” button in the upper right hand corner of the Site Extensions page. Clicking on the circled letter ‘i’ will display the detailed information for the Site Extension.

Site Extensions (Preview Portal)

There is direct Site Extension integration in the Preview Portal. We’ll start from the default blade for our Website.

image

Click on Settings in the Command Bar. This opens the settings list in which we will find an option for Extensions.

image

This opens a blade which lists previously installed Site Extensions, and has an add button to add new Extensions to our website.

image

Click Add. This opens the Site Extension gallery, where we can select a new Site Extension to enable.

image

The next step is to accept the legal terms for the Site Extension.

image

Then finish the installation process by clicking OK.

image

You can Browse, Update or Delete the Site Extension by right-clicking on the entry in this list.

image

Important: Update to Default PHP Runtime on Windows Azure Web Sites

In upcoming weeks Windows Azure Web Sites will update the default PHP version from PHP 5.3 to PHP 5.4. PHP 5.3 will continue to be available as a non-default option. Customers who have not explicitly selected a PHP version for their site and wish the site to continue to run using PHP 5.3 can select this version at any time from the Windows Azure Management Portal, Windows Azure Cross Platform Command Line Tools, or Windows Azure PowerShell Cmdlets. The Windows Azure Web Sites team will also start onboarding PHP 5.5 as an option in the near future.

Explicitly Selecting a PHP version in Windows Azure Web Sites

If you wish to continue to run PHP 5.3 in your Windows Azure Web Site, follow one of the options below to explicitly set the PHP runtime of your site.

Selecting the PHP version from the Windows Azure Management Portal

After logging into the Windows Azure Management Portal, click on the Web Sites navigation item from the left hand menu.

image

Select the Web Site you wish to set the PHP Version for, then Click the arrow to navigate to the details screen.

image

Click on the CONFIGURE tab.

image

Ensure the value selected beside the PHP Version label is 5.3.

image

Perform any action which will require a save that will indicate the PHP 5.3 selection is intentional and not a reflection of the current platform default:

  • Add an App Setting
  • Temporarily toggle to PHP 5.4 or OFF
  • Enable Application or Site Diagnostics
  • Add/Change the Default documents

Click on the Save button in the command bar at the bottom of the portal.

image

Selecting the PHP version from the Windows Azure Cross Platform Command Line Tools

Run the following command from your terminal of choice, be sure that the Windows Azure Cross-Platform CLI Tools are installed and the appropriate subscription is selected.


Selecting the PHP version from the Windows Azure PowerShell Cmdlets

Run the following command from a PowerShell console, be sure that the Windows Azure PowerShell Cmdlets are installed and the appropriate subscription is selected.

Installing CakePHP from the Windows Azure App Gallery

In my previous post Application Frameworks now part of the Windows Azure Web Sites Gallery I introduced the concept of ready to install application frameworks which can be provisioned as part of a new Windows Azure Web Site. The benefits include having a ready to go starting point for building out your application with a tested and fully capable package which includes common Application Settings as well as the proper configuration for IIS.

Today, I’m happy to announce a new addition to the App Frameworks section of the Windows Azure App Gallery, CakePHP. Let’s take a look at the steps to get CakePHP running in Windows Azure Web Sites using the new Gallery item.

Setup CakePHP on Windows Azure Web Sites

To follow along with the example below, sign up for a Windows Azure Free Trial.

In order to provision a Web Site from the Windows Azure App Gallery we must first sign into the Windows Azure Management Portal. Once you’ve logged into the portal you will see the command bar at the bottom of the browse, click New.

drawer-waws-new

This will open the drawer and enable you to select from a variety of different services which you can provision, for this example we’re interested in Web Sites. Select ComputeWeb Sites > Gallery.

drawer-waws-fromgallery

The gallery modal will pop up and allow you to select from a number of well-known open source CMS, Frameworks and other tools.  Select App Frameworks > CakePHP or scroll through the list to find CakePHP.

At the time of writing this article the CakePHP version in the Gallery was 2.3.6.

windowsazure-websites-gallery-appframework

Once CakePHP is selected, click the next arrow at the bottom of the screen to advance to the Configuration page in the wizard.

websites-configure-cakephp

In order to configure a secure deployment of CakePHP, the Cake Foundation suggests including a Security Salt and Cipher Seed. The Web Sites team has conveniently surfaced those settings to the Configuration page, which will get injected into the proper configuration setting in the app/Config/core.php file.

During the configuration, you can select an existing MySQL Database or create a new MySQL Database with your new site. If you needed to create a new MySQL Database, you will receive this screen which will ask for the database name, a region to deploy the database in [Note: It’s a good practice to deploy your database in the same region as your application to reduce latency], you will also need to accept the terms from our partner ClearDB who supplies the MySQL Databases in Windows Azure.

websites-mysql-cakephp-database

That’s it! After clicking the checkmark to complete the wizard your new Web Site will start to provision which includes a configured version of CakePHP which is a great starter point to your next CakePHP Application.

windowsazure-website-site-listing

Once the Status changes to Running, you’re ready to view your new site. You can do this as simply as clicking the BROWSE icon in the Command Bar.

drawer-waws-browse

Congratulations, you have yourself a brand new CakePHP Installation in Windows Azure Web Sites.

WindowsAzure-WebSites-CakePHP

CakePHP is setup, Now what do I do?

Now that the CakePHP Framework is in place it’s time to start building an application. To do so, you’re going to need the source on your local machine.

Download your Web Site files with Git

With Windows Azure Web Sites you can deploy using many source control repositories, this includes Git. However, Git isn’t enabled by default when you create a site from the gallery, so lets find out how to enable Git Deployment (and in our case, a remote repository to clone from).

If you click into the details of your new Web Site in the Windows Azure Portal, you will see a Quick Glance section on the DASHBOARD. Click on Set up deployment from source control to create a new repository in your Windows Azure Web Site.

 

websites-set-up-source-control

Like I said above, there are many options for source control systems, select Local Git Repository then the next arrow to continue.

websites-setup-source-control-git

It may take a few seconds for your repository to be created, so this notification will keep you amused in the meantime.

websites-create-git-repo

Once the repository is created, the portal should redirect to the DEPLOYMENTS tab. Copy the Git URL, you’ll need this to clone your repository on your local machine.

websites-copy-git-url

On your local machine, open Git Bash or your favourite Git command line utility, type the following pasting the git url you copied above in place of <git-url> below, then hit enter.

git clone <git-url>

local-clone-website-repo

You now have a local git repository of your CakePHP Application.

You may have noticed both the Vendor and Plugins directories are missing, this is because they are empty and Git does not track empty folders. Simply create the folder locally and place a file in the directories in order to upload third party code or plugins, respectively.

Download your Web Site files with FTP

To download your Web Site files with FTP you will need your favourite FTP tool, this could be a number of different tools including the command line. Here are the steps you will need to take to configure FTP downloads from your site, I’ll leave the actual downloading up to you.

On the DASHBOARD screen in the portal under the Quick Glance section, you will need to set (or reset, incase you forgot) your deployment credentials. Click on the link which allows you to set the deployment credentials.

websites-setup-deployment-credentials

Fill out the form providing your username, password and confirm password.

websites-set-deployment-credentials

Once you’ve set your credentials, scroll a down the Quick Glance section until you find your FTP or FTPS Host Name.

websites-ftp-links

Notice that your FTP User is a combination of the web site name and the user name provided above, the password is the password which was created when you set your deployment credentials.

Enjoy developing with CakePHP!

Released: Windows Azure Training Kit – April 2013

Scott Guthrie announced the General Availability of Windows Azure IaaS features which includes both Windows Azure Virtual Machines and Windows Azure Virtual Network. This was paired nicely by a post by Bill Hilf highlighting some customer experiences using Windows Azure Infrastructure Services.

It is my pleasure to announce the April 2013 release of the Windows Azure Training Kit.

Windows Azure Training Kit Home

In this release

There have been a number of improvements in this release alongside the refresh to the Infrastructure Services content including:

  • New Presentation: Windows Azure Mobile Services and Android
  • New Lab: Windows Azure Mobile Services and Android
  • New Lab: Windows Azure Mobile Services and Windows Phone
  • New Presentation: Introduction to Windows Azure HDInsight Service
  • New Lab: Introduction to Windows Azure HDInsight
  • Updated ITPro Content + Agenda
  • Updated Presentations for new feature support Windows Azure Overview, Windows Azure Web Sites, Windows Azure Virtual Machines & Windows Azure Mobile Services.

Release Notes