Question

Difficulty: HardConfigure Virtual Machine Scale Sets (VMSS)

An administrator is managing an Azure Virtual Machine Scale Set (VMSS) named `vmss-web` that uses Uniform orchestration and has its upgrade policy set to Manual. The administrator needs to deploy a custom configuration script to all existing and future VM instances in `vmss-web` using the Custom Script Extension. The script is stored locally.

Which sequence of actions should the administrator perform to achieve this goal?

  1. 1Upload the configuration script to a private container in an Azure Storage account.
  2. 2Generate a Shared Access Signature (SAS) token with read permissions for the script blob.
  3. 3Add the Custom Script Extension to the scale set model, referencing the script URI and the SAS token.
  4. 4Trigger a manual upgrade on the existing VM instances in the scale set.

Answer

First, upload the configuration script to a private Azure Storage account. Second, generate a SAS token with read permissions for the script blob. Third, add the Custom Script Extension to the scale set model referencing the script URI and SAS token. Fourth, trigger a manual upgrade on the existing VM instances.
The correct order requires first securing the script in Azure Storage, generating a SAS token for secure access, updating the VMSS model definition, and finally triggering a manual upgrade of the existing VM instances since the upgrade policy is set to Manual.

Step-by-Step Solution

1
Upload the configuration script to an Azure Storage account.
The script is hosted in a private Azure Storage blob container.
Before the scale set instances can execute the script, it must be accessible from an Azure storage service.
2
Generate a SAS token for the script blob.
A secure access token is created that grants read access to the script.
Since the storage account container is private for security, a SAS token provides a secure way for the scale set to download the script without public access.
3
Add the Custom Script Extension to the VMSS model.
The VMSS configuration model is updated with the extension definition containing the script URI and SAS token.
Updating the VMSS model ensures that the extension configuration is saved in the scale set template, making it active for all future scale-out instances.
4
Trigger a manual upgrade on existing instances.
Existing VM instances are updated to the latest VMSS model configuration.
Since the upgrade policy of the scale set is Manual, existing instances will not automatically apply the new model. A manual upgrade triggers the Custom Script Extension execution on these running instances.

Key Concept

Configuring Custom Script Extensions and applying model updates under a Manual upgrade policy in a Virtual Machine Scale Set.
Rate this question