Question

Difficulty: MediumConfigure Virtual Machine Scale Sets (VMSS)

You need to deploy a Virtual Machine Scale Set (VMSS) named `vmss-app` that automatically installs an application during provisioning. The installation script is stored in a private Azure Storage account. Which sequence of steps should you perform to configure the VMSS to retrieve and run the script securely?

  1. 1Upload the installation script to a private blob container in the Azure Storage account.
  2. 2Generate a Shared Access Signature (SAS) token with Read permissions for the uploaded script blob.
  3. 3Configure the Custom Script Extension settings in the VMSS resource definition, referencing the script's SAS URL.
  4. 4Deploy the VMSS to provision the instances and run the script.

Answer

To securely run a script on a new VMSS from a private storage account, first upload the script to a private container, generate a SAS token with Read permissions, configure the Custom Script Extension in the VMSS template using the SAS URL, and then deploy the VMSS.
To deploy a VMSS that securely runs a custom installation script stored in a private Azure Storage account, you must first upload the script to the storage account. Once uploaded, you generate a Shared Access Signature (SAS) token to provide temporary, secure read access. Next, you reference this SAS URL in the VMSS Custom Script Extension configuration within your deployment template. Finally, you deploy the VMSS, which provisions the instances and executes the script.

Step-by-Step Solution

1
Upload the script to Azure Storage
The script is stored in a private container, preventing public access.
The file must exist in Azure before you can configure access to it.
2
Generate a SAS token
A secure SAS URL is created with Read-only access to the script.
The VMSS extension needs a secure way to access the script without using the storage account key.
3
Configure VMSS resource definition
The VMSS Custom Script Extension configuration includes the SAS URL.
This tells the VMSS where to find the script and how to authenticate to download it.
4
Deploy the VMSS
VMSS instances are deployed and automatically run the script during provisioning.
Initiates the deployment process to create the virtual machines with the specified extension configuration.

Key Concept

Configuring Custom Script Extensions on a VMSS using private storage with SAS authentication
Rate this question