• No results found

Using the Azure Cross-Platform Command-Line Interface tools for coniguration tasks

In document Oops, page not found. (Page 44-48)

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.

Objective 1.2: Conigure websites CHAPTER 1 25 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 speciic 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.

26 CHAPTER 1 Implement Websites

FIGURE 1-14 Creating a new website using the xplat-cli tools for Azure on Windows.

Thought experiment

Conigure SSL with a custom domain

In this thought experiment, apply what you've learned about this objective. You can ind 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 conigure 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 conigured 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 certiicate 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 conigure 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, conigure handler mappings, custom domains, and SSL.

Application settings and connection strings can be deined in site settings and re-trieved at application runtime using environment variables.

An Azure website can have multiple custom domains associated with it. To conigure a custom domain, you must irst add an A and/or CNAME record using your DNS registrar.

For A records, you must irst 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 conigured 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 1.2: Conigure websites CHAPTER 1 27

Objective review

Answer the following questions to test your knowledge of the information in this objective.

You can ind 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 deine 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 Trafic Manager pro-ile?

A. Enable-AzureTraficManagerProile B. Set-AzureTraficManagerEndpoint C. Set-AzureTraficManagerProile D. Add-AzureTraficManagerEndpoint

3. Which Azure Trafic 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

28 CHAPTER 1 Implement Websites

Objective 1.3: Conigure 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

Retrieve diagnostic logs

View streaming logs

Monitor website resources

Conigure endpoint monitoring and alerts

Monitor Azure services

Conigure analytics

Conigure backup

In document Oops, page not found. (Page 44-48)