You are deploying an Azure virtual machine named VM1 in the East US region. You plan to configure VM1 using the Custom Script Extension. The script is stored in a private container in an Azure storage account named `storage1`. The firewall for `storage1` is configured to restrict access to selected networks only. You need to ensure that the VM Agent on VM1 can download and execute the script. Which configuration should you implement?
- AEnable the 'Allow trusted Microsoft services to access this storage account' exception on `storage1`, and configure the Custom Script Extension to download the script.
- BAssign the Reader role to VM1's system-assigned managed identity on `storage1`, and configure the Custom Script Extension to use the managed identity.
- Configure a service endpoint for `Microsoft.Storage` on the subnet of VM1, and add a virtual network rule to the firewall settings of `storage1` to allow traffic from that subnet.Cevap
- DDeploy VM1 in an Availability Set to protect the deployment from datacenter-wide failures, and configure the storage firewall to allow access from the Availability Set.
Cevap
Configure a service endpoint for `Microsoft.Storage` on the subnet of VM1, and add a virtual network rule to the firewall settings of `storage1` to allow traffic from that subnet.
Configuring a service endpoint for `Microsoft.Storage` on the virtual machine's subnet allows the virtual machine to securely connect to Azure storage. Adding a virtual network rule to the storage account's firewall to permit traffic from that subnet allows the VM Agent to download the script directly over the Azure backbone network, successfully bypassing the restricted firewall.
Adım Adım Çözüm
Anahtar Kavram
Virtual Machine extension configuration and secure storage integration