az-104 Practice Question 1721
Exam: az-104
Domain: Deploy and manage Azure compute resources
Topic: Automate deployment of resources by using templates
Difficulty: medium
During the deployment of a new Azure environment for a client, you notice that the custom script extension fails to run on the target virtual machine. The client suspects that the issue might be related to the permissions assigned to the service principal used for deployment. What action should you take to troubleshoot this issue and ensure the custom script extension runs successfully?
Answer Options
A
Change the virtual machine's operating system type to a different version.
B
Verify the role assignments for the service principal and ensure it has the appropriate permissions.
C
Modify the virtual machine's network configuration to use a different subnet.
D
Update the virtual machine's storage account settings to increase the disk size.
Correct Answer
B: Verify the role assignments for the service principal and ensure it has the appropriate permissions.
Explanation
The correct answer is B. You should check the role assignments for the service principal to ensure it has the necessary permissions to execute custom scripts on the virtual machine. Specifically, the service principal should be assigned the 'Contributor' or 'Virtual Machine Contributor' role in the subscription or resource group where the virtual machine resides. Option A is incorrect because changing the virtual machine's operating system type will not affect the custom script execution. Option C is incorrect because modifying the virtual machine's network configuration will not resolve the permission issue. Option D is incorrect because adjusting the virtual machine's storage account settings will not impact the custom script extension's ability to run.