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.
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
Practice Tests in this course are