Tuesday, October 4, 2016

Configuring handler mappings

Depending on the tools and language used to build a website, it may be necessary for you to conigure additional handlers (or interpreters) to support the website code. To configure a handler mapping for an Azure website requires the following settings:

Extension : The file extension that you want to be handled by the script processor.
This can be a wildcard, a specific file extension, or even a specific file. For example, *,*.php, and Handler.fcgi. The script processor defined in the script processor path will process requests that match this pattern.

Script :Processor Path The absolute path to the script processor that will process requests for files matching the pattern in the extension property.

Optional Arguments This can be a path to a script for the script processor to process or any other argument that you may need to define when invoking the script processor.

Configuring handler mappings using the management portal ::
In the management portal, you can add handler mappings by opening the Site Settings blade for your website. Scroll down towards the bottom of the blade until you ind the Handler



Configuring handler mappings using Azure PowerShell ::

Handler mappings can also be added using the Azure PowerShell cmdlets. The irst task is to create a new HandlerMapping object and initialize it with your settings. Then, use the Set-AzureWebsite cmdlet and pass the handler mapping in using the HandlerMappings parameter. The script below demonstrates adding a handler mapping for *.php files.

$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




Featured Posts

Adding Accesspolicy to KeyVault for Service Principal Using Portal and Powershell

  Scripts path : https://drive.google.com/drive/folders/1sbBpnVFgXhUIXLdf2E9heyWDeU2f9427?usp=sharing  Adding Accesspolicy to KeyVault for S...