Microsoft Certified: Azure Administrator AssociateDeploy and manage Azure compute resourcesMedium

You are tasked with deploying an Azure virtual machine (VM) that runs a custom application. The application requires specific network security group (NSG) rules and the installation of a custom agent after the VM is provisioned. You need to automate the VM deployment and post-deployment configuration efficiently.

  1. ADeploy the VM using Azure CLI commands and then use PowerShell Desired State Configuration (DSC) for the agent installation.
  2. BManually create the VM in the Azure portal and then manually configure the NSG and install the agent.
  3. CCreate a managed image of the VM with the agent pre-installed, then deploy new VMs from that image.
  4. DUse an Azure Resource Manager (ARM) template to define the VM and NSG rules, and a Custom Script Extension for the agent installation.
Show answer & explanation

Correct answer: D. Use an Azure Resource Manager (ARM) template to define the VM and NSG rules, and a Custom Script Extension for the agent installation.

ARM templates allow for declarative deployment of Azure resources, including VMs and NSGs. The Custom Script Extension is ideal for automating post-deployment tasks like installing agents or configuring software on a VM.

Why the other options are wrong

  • A. While feasible, ARM templates offer a more robust and repeatable declarative approach for the entire deployment compared to separate CLI commands.
  • B. Manual processes are inefficient and prone to errors, not suitable for automation.
  • C. Creating a managed image is good for deploying identical VMs but doesn't automate NSG configuration and requires continuous image updates for agent changes.

Azure Custom Script Extension

A feature of Azure VMs that allows you to download and execute scripts on Azure virtual machines, providing post-deployment configuration, software installation, or any other setup/management task.

  • Runs scripts on VM after provisioning.
  • Supports PowerShell scripts on Windows and Bash scripts on Linux.
  • Can be used with ARM templates, Azure CLI, or PowerShell.

Memory trick: Templates Build, Scripts Configure.

More Deploy and manage Azure compute resources questions