Microsoft Certified: Azure Administrator AssociateDeploy and manage Azure compute resourcesMedium

You are deploying an Azure Virtual Machine (VM) that will run a Linux-based web server. After the VM is provisioned, you need to automatically install Nginx, configure its default index page, and start the Nginx service. This automation should happen as part of the VM creation process. Which Azure feature should you use?

  1. AAzure Desired State Configuration (DSC)
  2. BAzure Automation Runbook
  3. CAzure DevOps Pipelines
  4. DAzure Custom Script Extension
Show answer & explanation

Correct answer: D. Azure Custom Script Extension

The Azure Custom Script Extension allows you to download and execute scripts on Azure VMs, making it ideal for post-deployment configuration like installing software and configuring services as part of the VM creation process.

Why the other options are wrong

  • A. Azure Desired State Configuration (DSC) is for configuration management, ensuring a consistent state, but the Custom Script Extension is more straightforward for a one-time, initial setup during provisioning.
  • B. Azure Automation Runbooks are for general automation tasks and can be used to configure VMs, but the Custom Script Extension is specifically designed for executing scripts as part of the VM deployment.
  • C. Azure DevOps Pipelines orchestrate CI/CD, but the Custom Script Extension is the specific Azure VM feature for post-deployment script execution.

Azure Custom Script Extension

An Azure VM extension that downloads and executes scripts on Azure virtual machines. It is commonly used for post-deployment configuration, software installation, or running bootstrap tasks.

  • Executes scripts on VM after provisioning
  • Supports Windows (PowerShell) and Linux (Bash)
  • Ideal for one-time setup tasks
  • Can be integrated with ARM templates or Azure CLI/PowerShell commands

Memory trick: Custom Scripts Customize VM Start-up.

More Deploy and manage Azure compute resources questions