AZ-104: Configure Virtual Machine Extensions

¡Supera tus tareas y exámenes ahora con Quizwiz!

2. Custom script extensions time out after which of the following?

90 minutes Custom script extensions will time out and that should be considered when deciding on the scope of the script.

Failure events.

Be sure to account for any errors that might occur when running your script. For example, running out of disk space, or security and access restrictions. What will the script do if there is an error?

Implement virtual machines extensions

Creating and maintaining virtual machines can be a lot of work, and much of it is repetitive, requiring the same steps each time. Fortunately, there are several ways to automate the tasks of creating, maintaining, and removing virtual machines. One way is to use a virtual machine extension. Azure virtual machine extensions are small applications that provide post-deployment configuration and automation tasks on Azure VMs. For example, if a virtual machine requires software installation, anti-virus protection, or a configuration script inside, a VM extension can be used. Extensions are all about managing your virtual machines.

Implement custom script extensions

Custom Script Extension(CSE) can be used to automatically launch and execute virtual machine customization tasks post configuration. Your script extension may perform simple tasks such as stopping the virtual machine or installing a software component. However, the script could be more complex and perform a series of tasks. You can install the CSE from the Azure portal by accessing the virtual machines Extensions blade. Once the CSE resource is created, you will provide a PowerShell script file. Your script file will include the PowerShell commands you want to execute on the virtual machine. Optionally, you can pass in arguments, such as param1, param2. After the file is uploaded, it executes immediately. Scripts can be downloaded from Azure storage or GitHub, or provided to the Azure portal at extension run time.

Timeout.

Custom Script extensions have 90 minutes to run. If your deployment exceeds this time, it is marked as a timeout. Keep this in mind when designing your script. Your virtual machine must be running to perform the tasks.

Implement desired state configuration

Desired State Configuration (DSC) is a management platform in Windows PowerShell. DSC enables deploying and managing configuration data for software services and managing the environment in which these services run. DSC provides a set of Windows PowerShell language extensions, Windows PowerShell cmdlets, and resources that you can use to declaratively specify how you want your software environment to be configured. DSC also provides a means to maintain and manage existing configurations. DSC centers around creating configurations. A configuration is an easy-to-read script that describes an environment made up of computers (nodes) with specific characteristics. These characteristics can be as simple as ensuring a specific Windows feature is enabled or as complex as deploying SharePoint. Use DSC when the CSE will not work for your application.

3. The infrastructure team needs to install IIS on the localhost. They do not want to use a Custom Script Extension. Which of the following could be used instead?

Desired state configuration DSC is a good choice for installing virtual machine features.

Dependencies.

If your extension requires networking or storage access, make sure that content is available.

Azure VM extensions can be:

Managed with Azure CLI, PowerShell, Azure Resource Manager templates, and the Azure portal. Bundled with a new VM deployment or run against any existing system. For example, they can be part of a larger deployment, configuring applications on VM provision, or run against any supported extension operated systems post deployment.

One or more Node blocks.

Node blocks define the computers or VMs that you are configuring. In the example, there is one Node block that targets a computer named "localhost".

One or more resource blocks.

Resource blocks configure the resource properties. In the example, there is one resource block that uses WindowsFeature. WindowsFeature indicates the name (Web-Server) of the role or feature that you want to ensure is added or removed. Ensure indicates if the role or feature is added. Your choices are Present and Absent.

You could also use the PowerShell Set-AzVmCustomScriptExtension command. This command requires the URI for the script in the blob container.

Set-AzVmCustomScriptExtension -FileUri https://scriptstore.blob.core.windows.net/scripts/Install_IIS.ps1 -Run "PowerShell.exe" -VmName vmName -ResourceGroupName resourceGroup -Location "location"

The DSC script consists of a Configuration block, Node block, and one or more resource blocks.

The Configuration block. One or more Node blocks. One or more resource blocks.

Note

The Windows PowerShell DSC comes with a set of built-in configuration resources. For example, File Resource, Log Resource, and User Resource.

The Configuration block.

This is the outermost script block. You define it by using the Configuration keyword and providing a name. In the example, the name of the configuration is IISInstall.

Considerations

Timeout. Dependencies. Failure events. Sensitive data.

1. Which of the following is a small application that provides post-deployment configuration and automation tasks on Azure virtual machines?

Virtual machine extensions. Virtual machine extensions automate the tasks of creating, maintaining, and removing virtual machines

Sensitive data

Your extension may need sensitive information such as credentials, storage account names, and storage account access keys. How will you protect/encrypt this information?

In this example, we are installing IIS on the localhost. The configuration is saved as a PS1 file.

configuration IISInstall { Node "localhost" { WindowsFeature IIS { Ensure = "Present" Name = "Web-Server" } } }


Conjuntos de estudio relacionados

Units 6 and 9 Thermodynamics MCQ

View Set

Ch. 28 - Assessment of Hematologic Function and Treatment Modalities Questions

View Set

Unit 8. Vocab. D. Choose the correct word or phrase.

View Set

Primerica - Life Insurance Policies (AZ)

View Set

Inflation, Hyperinflation and Deflation

View Set