Your organization has an Azure subscription that contains a resource group named rg-dev-apps. To control costs, you configure an Azure budget at the subscription scope with a monthly limit of . You configure a budget alert threshold at that triggers an Action Group. The Action Group is configured to run an Azure Automation runbook that automatically deallocates all virtual machines in rg-dev-apps. You need to ensure that the runbook can successfully deallocate the virtual machines when the budget threshold is met, while still preventing users from accidentally deleting any virtual machines in rg-dev-apps. Which lock configuration should you apply to rg-dev-apps?
- Apply a CanNotDelete lock to the rg-dev-apps resource group.Cevap
- BApply a ReadOnly lock to the rg-dev-apps resource group.
- CAssign the Reader role at the subscription level to the Azure Automation system-assigned managed identity.
- DConfigure the budget threshold action to use an email notification only, and configure a separate Azure Policy with the Deny effect to prevent virtual machine deletion.
Cevap
Apply a CanNotDelete lock to the rg-dev-apps resource group.
Applying a CanNotDelete lock to the resource group prevents the deletion of any resource within it, including virtual machines. However, it still allows authorized users or service principals (such as the Azure Automation managed identity running the runbook) to perform write operations, which includes modifying resource state such as starting, stopping, and deallocating virtual machines.
Adım Adım Çözüm
Anahtar Kavram
The difference between ReadOnly and CanNotDelete resource locks and their impact on automated cost control actions.
Tahmini Süre:1m 30s