• No results found

As the example with Chef shows, not all virtual machine extensions have their own specific Azure PowerShell cmdlet. To view the extensions that are available, use the Get-AzureVMAvailableExtension cmdlet. Piping the results to the Out-GridView cmdlet makes it easy to read.

Get-AzureVMAvailableExtension | Out-GridView

Virtual machine extensions can be enabled directly using the Set-AzureVMExtension cmdlet.

This cmdlet accepts the extension name, the publisher name, the version of the extension, and the public and private configuration to be set. Extensions like the Chef extension, and the Linux custom script extension are both examples of extensions that currently can only be enabled through this technique. An example of how to implement the custom script extension for Linux can be found in the Azure blog at

http://azure.microsoft.com/blog/2014/08/20/automate-linux-vm-customization-tasks-using-customscript-extension/.

EXAM TIP

To use virtual machine extensions like DSC, Puppet, and Chef on Windows, the Azure virtual machine agent must be installed on the virtual machine. By default, the agent is installed on virtual machines created after February 2014 (when the feature was added). But, it’s also possible to not install the agent by using the management portal, or by using the DisableGuestAgent parameter of the Add-AzureProvisioningConfig and New-AzureQuickVM cmdlets. If the agent is not installed at provisioning time, or if you have migrated a virtual hard disk from on-premises, you can manually install the agent on these virtual machines by downloading and installing the agent from Microsoft at http://go.microsoft.com/fwlink/?LinkID=394789&clcid=0x409.

Thought experiment

Implementing configuration management

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 network administrator of Contoso. You are responsible for deploying applications through several environments, including the production environment.

You’re using Azure virtual machines as your deployment environment.

Management has given you the requirements that the configuration management solution you implement should avoid manual configuration of individual servers, which can cause configuration drift. In addition, the solution should provide the ability to track changes when modifying the configuration. The majority of your team is either familiar with, or has expertise with Windows PowerShell.

1. You have to come up with a configuration management solution to support your management’s requirements. What is the best solution?

2. What additional component should be involved with your solution to help track changes?

Objective summary

The Management portal or the Get-AzureVMAvailableExtension cmdlet can enumerate the available extensions for Azure virtual machines.

Azure Windows-based virtual machines support executing standard or DSC-based Windows PowerShell scripts using the Management portal or the Azure PowerShell cmdlets.

To apply a DSC script to a virtual machine using Windows PowerShell, publish it to an Azure Storage account using the Publish-AzureVMDscConfiguration cmdlet. The Azure Storage account can be specified using the CurrentStorageAccount setting of the sub-scription, or the cmdlet accepts a storage context object.

To apply the published configuration to an individual virtual machine, use the Set-AzureVMDscExtension cmdlet, or the Management portal. This configuration can be applied at provisioning time or later.

The Set-AzureVMAccessExtension cmdlet is used to execute the VM Access Extension.

This extension can enable Remote Desktop access on a virtual machine, change the local administrator password, and rename the local administrator account user name. This ex-tension does not work against Active Directory domain accounts or on domain controllers.

Windows-based Azure virtual machines natively support the Puppet extension by enabling it through the Management portal, or using the Set-AzureVMPuppetExtension cmdlet. You can enable the Chef extension on both platforms using the Management portal.

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 Azure PowerShell cmdlet can be used to enable Remote Desktop on an Azure virtual machine?

A. Set-AzureServiceRemoteDesktopExtension B. Set-AzureVMAccessExtension

C. Set-AzureServiceADDomainExtension D. Add-AzureEndpoint

2. When publishing a PowerShell DSC configuration using Windows PowerShell, how do you specify a Windows PowerShell data file (.psd1) that contains parameters for the configuration?

A. Specify the ConfigurationName parameter of the Set-AzureVMDscExtension cmdlet.

B. Specify the ConfigurationArchivePath of the parameter of the Publish-AzureVMDscConfiguration cmdlet.

C. Specify the ConfigurationDataPath parameter of the Set-AzureVMDscExtension cmdlet.

D. This is only possible through the Management portal.

3. How do you identify all of the available virtual machine extensions using Windows PowerShell?

A. Get-AzureVMExtension B. Get-AzureServiceExtension C. Get-AzureVMAvailableExtension D. Get-AzureVM

Objective 2.4: Configure VM networking

Configuring the network for Azure virtual machines is a broad topic. This objective covers network-related topics that do not require a virtual network, such as configuring the load balancer on the external VIP, access control lists, and reserved and instance level (public) IP address. It touches on configuring the guest operating system network settings for Azure.

This objective covers how to:

Understand cloud services

Configure endpoints

Configure access control lists

Configure reserved IP addresses

Configure public IP addresses

Configure the guest operating system network