How to Configure Web Sites
In the Windows Azure Management Portal you can change the configuration options for web sites and you can link web site to other Windows Azure resources. For example, you can link web sites to a SQL Database to provide additional functionality. You can also configure web sites to use a new or existing MySQL database.
Table of Contents
How to: Change configuration options for a web site
Follow these steps to change configuration options for a web site.
- In the Management Portal, open the web site's management pages.
- Click the Configure tab to open the Configure management page.
- Set the following configuration options for the web site as appropriate:
- .NET Framework Version - If your web application uses the .NET Framework, set the version of the framework that the web application requires.
- PHP Version - If your web application uses PHP, set the version of PHP that the web application requires.
- Managed Pipeline Mode - Of the two choices, Classic and Integrated, Integrated is the default. You should use the Classic option only if you have legacy web sites that run exclusively on older versions of IIS.
- Platform - For sites in Standard mode, you can choose whether you want your application to run in a 32-bit or 64-bit environment. Sites in the Free and Shared modes always run in a 32-bit environment.
- Web Sockets - Choose On to enable your web site to use real time request pattern applications such as chat.
- Always On - By default, web sites are unloaded if they have been idle for some period of time. This lets the system conserve resources. You can enable the Always On setting for a site in Standard mode if the site needs to be loaded all the time. Because continuous web jobs may not run reliably if Always On is disabled, you should enable Always On when you have continuous web jobs running on the site.
- Edit in Visual Studio Online - Select On to enable live code editing with Visual Studio Online. After you save this configuration change, the DASHBOARD tab's Quick Glance section will display a link called Edit in Visual Studio Online. Click the link to edit your web site directly online. If you need to authenticate, you can use your basic deployment credentials.
Note: If you have 'deployment from source control' enabled, it is possible for a deployment to overwrite changes the changes you make in the Visual Studio Online editor. It is therefore best not to use 'deployment from source control' if you want to edit the site contents directly with Visual Studio Online.
- certificates - In Standard mode only, you can click upload to upload an SSL certificate for a custom domain. The certificates you upload are listed here. Wildcard ("star") certificates (certificates with an asterisk) are supported. After you upload a certificate, you can assign it to any web site in your subscription and region. A star certificate only has to be uploaded once, but can be used for any site within the domain for which it is valid. A certificate can be deleted only if no bindings in any site are active for the given certificate.
Note: Custom domains are available only in Shared and Standard modes, and SSL support for custom domains is available in Standard mode only. For information about configuring SSL for a custom domain on Windows Azure, see Enable HTTPS for a Windows Azure web site.
- domain names - View or add additional domain names for the web site here. You can add custom domains by clicking Manage Domains. Custom domains are available only in Shared and Standard modes. You can change the web site mode on the Scale management page. Custom domains are not available in Free mode. For more information on configuring custom domains, see Configuring a custom domain name for a Windows Azure web site.
- SSL Bindings - SSL bindings to custom domains are available only in Standard mode. Choose an SSL mode (SNI, IP, or No SSL) for a particular domain name. If you choose SNI or IP, you can specify a certificate for the domain from the certificates you have uploaded. For information about configuring SSL for a custom domain on Windows Azure, see Enable HTTPS for a Windows Azure web site. For more information about SNI, see Server Name Indication.
- deployments - Use these settings to configure deployments.
- Git URL - If you have created a Git repository on your Windows Azure web site, this is its URL - the location to which you push your content.
- Deployment Trigger URL - This URL can be set on a GitHub, CodePlex, Bitbucket, or other repository to trigger the deployment when a commit is pushed to the repository.
- Branch to Deploy - This lets you specify the branch that will be deployed when you push content to it.
- application diagnostics - Set options for gathering diagnostic traces from a web application whose code has been instrumented with traces. The logging options for application diagnostics include:
- Application Logging (File System) - Choose On to have the application logs written to the web site's file system. When enabled, file system logging lasts for a period of 12 hours. You can access the logs from the FTP share for the web site. The link to the FTP share can be found on the Dashboard. Under Quick Glance, choose FTP Diagnostic Logs or FTPS Diagnostic Logs.
- Application Logging (Storage) - Choose On to have your application logs written to a Windows Azure storage account. Logging to a storage account has no time limit and stays enabled until you disable it. By default, the logs are stored in a table called WAWSAppLogTable.
- Logging Level - When logging is enabled, this option specifies the amount of information that will be recorded (Error, Warning, Information, or Verbose).
- Diagnostic Storage - Clicking Manage Connection opens the Manage diagnostic storage dialog with the following options for saving logs to your Azure storage account:
- Storage Account Name - Choose the storage account to which you would like to have the logs saved.
- Storage Access Key - Displays the key for the chosen storage account. If you have regenerated the key for the storage account, type the new key here manually, or use one of the Synchronize buttons. The synchronize buttons are available only if the currently logged on user has access to the selected storage account.
- Synchronize Primary Key - Retrieves the latest primary key of your Windows Azure Storage account.
- Synchronize Secondary Key - Retrieves the latest secondary key of your Windows Azure Storage account.
Note: For more information about Windows Azure Storage Access Keys, see How to: View, copy, and regenerate storage access keys.
- site diagnostics - Set options for gathering diagnostic information for your web site, including:
- Web Server Logging - Specify whether to enable web server logging for the web site. Web server logs are saved in the W3C extended log file format. You can save the logs to Windows Azure Storage or to the File System.
Tip: The maximum size of log storage in the file system is 100 megabytes. If you need to retain more history than that, use Windows Azure Storage, which has a much greater storage capacity.
- To save web server logs to a Windows Azure Storage Account, choose Storage, and then choose manage storage. In the Manage Storage for Site Diagnostics dialog box, use the Storage Account option to choose the Windows Azure Storage Account for the container that will hold the logs. Use the Azure Blob Container option to choose the container that will hold the logs, or select Create a new blob container to enable the Blob Name box where you can specify a name for the new container.
Note: If you do not yet have a storage account, go to the Storage section of the Windows Azure portal where you can click New to create an account.
- If you choose File System, the logs are saved to the FTP site listed under FTP Diagnostic Logs on the Dashboard management page. Enabling File System storage also enables the Quota box where you can set the maximum amount of disk space for the log files. The minimum is 25MB and the maximum is 100MB. The default is 35MB. When the quota is reached, the oldest files are successively overwritten by the newest ones.
- By default, web server logs in a Windows Azure Storage Account are never deleted. To specify a period of time after which the logs will be automatically deleted, select Set Retention and enter the number of days to keep the logs in the Retention Period box. You can also use the Set Retention option for File System storage.
- Detailed Error Messages - Specify whether to log detailed error messages for the web site. If enabled, detailed error messages are saved as .htm files to the FTP site listed under FTP Diagnostic Logs on the Dashboard management page. After connecting to the specified FTP site navigate to /LogFiles/DetailedErrors/ to retrieve the .htm files which contain detailed error messages.
- Failed Request Tracing - Specify whether to enable failed request tracing. If enabled, failed request tracing output is written to XML files and saved to the FTP site listed under FTP Diagnostic Logs on the Dashboard management page. After connecting to the specified FTP site navigate to /LogFiles/W3SVC######### (where ######### represent a unique identifier for the web site) to retrieve the XML files that contain the failed request tracing output.
The /LogFiles/W3SVC#########/ folder contains an XSL file and one or more XML files. Ensure that you download the XSL file into the same directory as the XML file(s) because the XSL file provides functionality for formatting and filtering the contents of the XML file(s) when viewed in Internet Explorer.
- Remote Debugging - Set this option to On to enable remote debugging in your choice of Visual Studio 2012 or Visual Studio 2013. When enabled, you can use the remote debugger in Visual Studio to connect directly to your Windows Azure web site.
Note: Remote debugging will be enabled only for 48 hours and will not work with a site name or user name that is longer than 20 characters.
- monitoring - For web sites in Standard mode, test the availability of HTTP or HTTPS endpoints. You can test an endpoint from up to three geo-distributed locations. A monitoring test fails if the HTTP response code is greater than or equal to 400 or if the response takes more than 30 seconds. An endpoint is considered available if its monitoring tests succeed from all the specified locations.
- developer analytics - Choose Add-on to select an analytics add-on from a list, or to go to the Windows Azure store to choose one. Choose Custom to select an analytics provider such as New Relic from a list. If you use a custom provider, you must enter the license key in the Provider Key box.
Note: For more information on using New Relic with Windows Azure Web Sites, see New Relic Application Performance Management on Windows Azure Web Sites.
- app settings - Specify name/value pairs that will be loaded by your web application on start up. For .NET sites, these settings will be injected into your .NET configuration AppSettings at runtime, overriding existing settings. For PHP and Node sites these settings will be available as environment variables at runtime.
- connection strings - View connection strings for linked resources. For .NET sites, these connection strings will be injected into your .NET configuration connectionStrings settings at runtime, overriding existing entries where the key equals the linked database name. For PHP and Node sites these settings will be available as environment variables at runtime, prefixed with the connection type. The environment variable prefixes are as follows:
For example, if a MySql connection string were named connectionstring1, it would be accessed through the environment variable
- SQL Server: SQLCONNSTR_
- MySQL: MYSQLCONNSTR_
- SQL Database: SQLAZURECONNSTR_
- Custom: CUSTOMCONNSTR_
Note: Connection strings are created when you link a database resource to a web site and are read only when viewed on the configuration management page.
- default documents - Add your web site's default document to this list if it is not already in the list. A web site's default document is the web page that is displayed when a user navigates to a web site and does not specify a particular page on the web site. So given the web site http://contoso.com, if the default document is set to default.htm, a user would be routed to http://www.contoso.com/default.htm when pointing their browser to http://www.contoso.com. If your web site contains more than one of the files in the list, then make sure your web site's default document is at the top of the list by changing the order of the files in the list.
- handler mappings - Add custom script processors to handle requests for specific file extensions. Specify the file extension to be handled in the Extension box (for example, *.php or handler.fcgi). Requests to files that match this pattern will be processed by the script processor specified in the Script Processor Path box. An absolute path is required for the script processor (the path D:\home\site\wwwroot can be used to refer to your site's root directory). Optional command-line arguments for the script processor may be specified in the Additional Arguments (Optional) box.
- virtual applications and directories - To configure virtual applications and directories associated with your web site, specify each virtual directory and its corresponding physical path relative to the site root. Optionally, you can select the Application checkbox to mark a virtual directory as an application in site configuration.
- Click Save at the bottom of the Configure management page to save configuration changes.
How to: Configure a web site to use a SQL database
Follow these steps to link a web site to a SQL Database:
In the Management Portal, select Web Sites to display the list of web sites created by the currently logged on account.
Select a web site from the list of web sites to open the web site's Management pages.
Click the Linked Resources tab and a message will be displayed on the Linked Resources page indicating You have no linked resources.
Click Link a Resource to open the Link a Resource wizard.
Click Create a new resource to display a list of resources types that can be linked to your web site.
Click SQL Database to display the Link Database wizard.
Complete required fields on pages 3 and 4 of the Link Database wizard and then click the Finish checkmark on page 4.
Windows Azure will create a SQL database with the specified parameters and link the database to the web site.
How to: Configure a web site to use a MySQL database
To configure a web site to use a MySQL database, follow the same steps to use a SQL database, but in the Link a Resource wizard, choose MySQL Database instead of SQL Database.
Alternatively, you can create the web site with the Custom Create option. In the Database dropdown, choose either Create a new MySQL database or Use an existing MySQL database.
How to: Configure a custom domain name
For information about configuring your web site to use a custom domain name, see Configuring a custom domain name for a Windows Azure Web Site.
How to: Configure a web site to use SSL
For information about configuring SSL for a custom domain on Windows Azure, see Enable HTTPS for a Windows Azure web site.