Configuring handler mappings

It is essential to configure the added handlers or interpreters to assist the website code in accordance with the tools and language used in building a website code. You will need the following settings to configure handler mappings for an Azure website.

  • Extension: The script processor handles the file extensions which can be a wildcard or a certain file such as *, *.php, and Handler.fcgi..  The script mainframe incorporated in the script processor path processes requests matching this pattern
  • Script Processor Path This is an absolute path to the script processor which operates to process requests for files. It corresponds to the configuration in the extension property
  • Optional Arguments This can be another path to a script for the script processor to proceed with any arguments that you would like to define when enabling the script processor.

Configuring handler mappings using the management portal

By means of the management portal, you can easily incorporate handler mappings. For this purpose, open the site settings blade for your website and scroll down towards the bottom most of the blade. Here you will find the handler mappings section as illustrated in Figure 1.

handler mappings 1

FIGURE 1 Handler mappings in the Site Settings blade of the management portal

Configuring handler mappings using Azure PowerShell

You can add handler mappings by the Azure PowerShell cmdlets. The very first step you need to follow is to create a new HandlerMapping object and configure it using the settings bar. Once done, you can use the Set-AzureWebsite cmdlet and pass the handler mapping for *.php files by using HandlerMappings parameter.

$wsName = "contoso-web"
$handlerMapping = New-Object Microsoft.WindowsAzure.Commands.Utilities.Websites.
Services.WebEntities.HandlerMapping
$handlerMapping.Extension = "*.php"
$handlerMapping.ScriptProcessor = "d:\home\site\wwwroot\bin\php54\php-cgi.exe"
Set-AzureWebsite -Name $wsName -HandlerMappings $handlerMapping

This article is a part of 70-533 Implementing Microsoft Azure Infrastructure Solutions Prep course.

More Articles included in this course are

article

Creating an Azure website

Creating an Azure website using  Portal, Powershell and CLI Creating an Azure website on Microsoft Azure Cloud starts with creating ...
Read More
article

Deployment slots in Azure website

Defining deployment slots in Azure website Deployment slots in Azure website are collection of individual Azure website linked to your ...
Read More
article

Publishing an Azure website

Publishing an Azure website using various methods For publishing an Azure website, the web application or code needs to be ...
Read More
article

WebJobs in Azure website

Introduction to WebJobs in Azure website and Deployment using Portal and Powershell Web Jobs in Azure websites are exclusive applications ...
Read More
article

Azure website settings

Introduction to Configuring the azure website settings The first step you will need to follow for an Azure website is to ...
Read More

Practice Tests in this course are

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 1

Instructions for Exam 70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 1 This page shows the instructions for Exam 70-533 ...
Read More

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 2

Instructions for Exam 70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 2 This page shows the instructions for Exam 70-533 ...
Read More

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 3

Instructions for Exam 70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 3 This page shows the instructions for Exam 70-533 ...
Read More

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 4

Instructions for Exam 70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 4 This page shows the instructions for Exam 70-533 ...
Read More

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 5

Instructions for Exam 70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 5 This page shows the instructions for Exam 70-533 ...
Read More