For most of this book, the Azure PowerShell cmdlets are referenced for automating tasks using the script and that is a natural experience for users on the Windows platform. However, for users who are not running Windows or prefer an experience other than Azure PowerShell, Microsoft Azure offers the Azure Cross-Platform Command-Line Interface tools (xplat-cli).
The xplat-cli tools can be downloaded for free from the same download page the Azure PowerShell cmdlets are available at, which is http://azure.microsoft.com/en-us/downloads/.
Scroll down to the Command-line tools section to locate the download links.
The xplat-cli tools are available for the following operating systems:
■
■ Windows
■
■ Mac
■
■ Linux
To use the xplat-cli tools on Windows, open a command prompt and type Azure to list the version of the tools installed and the help for some of the commands, as shown in Figure 1-13.
FIGURE 1-13 The xplat-cli tools for Azure on Windows
Much of what you can do with the management portal and Azure PowerShell cmdlets you can also do with the xplat-cli tools. The Azure platform, features, and tools evolve at a very rapid pace, so it is important to make sure you update your tools regularly.
The xplat-cli tools are easy to use and offer help simply by typing the commands as shown in Figure 1-13. Since this chapter is about Azure Websites, type the following command to list all the commands specific to Azure Websites.
Azure site
One of the commands available is the command to list the sites in your subscription. To do this, type the following command.
Azure site list
As part of the list command, you can specify the name parameter to list only the site indicated. For example, to list the contoso-web website, type the following command.
Azure site list contoso-web
You can also create and edit websites. For example, Figure 1-14 shows how to create a new website in East US named contoso-web-01.
FIGURE 1-14 Creating a new website using the xplat-cli tools for Azure on Windows.
Thought experiment
Configure SSL with a custom domain
In this thought experiment, apply what you've learned about this objective. You can find answers to these questions in the ”Answers” section at the end of this chapter.
You are the IT Administrator for Contoso. You have been asked to configure the Contoso website to use SSL for the root domain and all sub-domains (one level deep). The Contoso website already has a custom domain configured under the name www.contoso.com using CNAME records (no A records). During your require-ments gathering you learned that your solution needs to work with recent browsers, such as Internet Explorer 7 (and newer), Safari 3.0 (and newer), and Google Chrome for Windows 6 (and newer).
1. What kind of SSL certificate will you need?
2. What are the steps required for you to deliver a solution?
Objective summary
■
■ An Azure Website site setting is where you can configure language versions for .NET Framework, PHP, Java, and Python. This is also where you can set the site to run in 32-bit or 64-32-bit mode, enable web sockets and the Always-On feature, configure handler mappings, custom domains, and SSL.
■
■ Application settings and connection strings can be defined in site settings and re-trieved at application runtime using environment variables.
■
■ An Azure website can have multiple custom domains associated with it. To configure a custom domain, you must first add an A and/or CNAME record using your DNS registrar.
For A records, you must first add the awverify CNAME record.
■
■ Azure Websites support Server Name Indication (SNI) SSL and IP-based SSL for websites with a custom domain.
■
■ Azure Websites can be configured using the management portal, Azure PowerShell cmdlets, and the Cross-Platform Command-Line tools.
■
■ The Cross-Platform Command-Line tools for Azure can be run on Windows, Mac, and Linux.
Objective review
Answer the following questions to test your knowledge of the information in this objective.
You can find the answers to these questions and explanations of why each answer choice is correct or incorrect in the ”Answers” section at the end of this chapter.
1. Which site settings can you define that can be read at application runtime using envi-ronment variables? (Choose all that apply.)
A. Connection strings B. Handler mappings C. Application settings D. .NET Framework Version
2. Which Azure PowerShell cmdlet is used to add an endpoint to a Traffic Manager pro-file?
A. Enable-AzureTrafficManagerProfile B. Set-AzureTrafficManagerEndpoint C. Set-AzureTrafficManagerProfile D. Add-AzureTrafficManagerEndpoint
3. Which Azure Traffic Manager load balancing method should be used to improve per-formance for users?
A. Round Robin B. Failover C. Performance D. CDN
4. 4. Which operating system platforms are supported by the Azure Cross-Platform Command-Line tools? (Choose all that apply.)
A. Windows B. Mac C. Azure D. Linux
Objective 1.3: Configure diagnostics, monitoring, and analytics
Monitoring websites to identify failures, potential performance issues, or metrics used to de-termine application health is a necessary function for IT. Azure Websites provides a rich set of monitoring and diagnostic features that you can use to easily monitor the website and quickly retrieve diagnostic data when you need to probe deeper into how the site is performing.
This objective covers how to:
■
■ Enable application and site diagnostics
■
■ Configure endpoint monitoring and alerts
■
Diagnostic logging is not enabled by default. It is up to you to enable and configure log-ging in a way that provides the information you need to troubleshoot issues. There are two categories of Azure Website log files:
■
■ Application diagnostic logs
■
■ Site diagnostic logs
Application diagnostic logs contain information produced by the application code. This can be tracing that the developers instrumented when writing the code, or exceptions that were raised by the application. When you enable application logs, you must specify the logging level, which can be one of the following:
■
Site diagnostic logs contain information produced by the web server that the web applica-tion is running on. Three types of site diagnostic logs can be enabled:
■
■ Web Server Logging Contains all HTTP events on a website and is formatted using the W3C extended log file format.