Administering Windows Server Hybrid Core Infrastructure (AZ-800) Practice

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the AZ-800 exam with our comprehensive study resources. Utilize flashcards and multiple-choice questions with hints and explanations. Gain confidence and excel in your certification journey!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What is the best solution for running a script on an Azure Arc-managed VM at Contoso?

  1. Use a policy to configure the script

  2. Use a CustomScriptExtension VM extension

  3. Create a scheduled task for the script

  4. Use a Runbook in Azure Automation

The correct answer is: Use a CustomScriptExtension VM extension

Using a CustomScriptExtension VM extension is the best solution for running a script on an Azure Arc-managed VM for several reasons. This extension allows you to execute scripts on your VMs quickly and effectively, making it particularly useful for automation and configuration tasks. With the Custom Script Extension, you can add or modify scripts directly on the Azure Arc-managed VM, and it comes with the advantage of being able to pass parameters, execute scripts securely, and manage dependencies. The Custom Script Extension is designed to download and execute scripts from Azure Storage or GitHub, which helps in maintaining version control and improving deployment efficiency. It also supports both PowerShell and shell scripts, making it versatile for different scripting needs, depending on the operating system of the VM. While other methods are available, they may not provide the same level of convenience or efficiency. For instance, policies typically work on a broader scope and are not as direct for running individual scripts. Scheduled tasks can be useful but require additional setup, checks, and maintenance to ensure that scripts trigger as expected. Runbooks in Azure Automation are powerful for managing complex workflows and automated tasks but may be more involved than necessary for executing a straightforward script on a specific VM. Thus, the CustomScriptExtension offers a straightforward, efficient