Soru

Zorluk: ZorAzure Subscription Management and Cost Control

An organization uses an Azure subscription named `Contoso-Dev-Sub` for testing new applications. Inside `Contoso-Dev-Sub`, a resource group named `rg-sandbox-vms` contains several virtual machines.

You want to implement cost controls and governance policies that satisfy the following requirements:
- Automatically deallocate all virtual machines in `rg-sandbox-vms` when the actual monthly consumption reaches 85%85\% of the designated 10,00010,000 USD budget.
- Prevent administrators and developers from accidentally deleting the `rg-sandbox-vms` resource group or its contents.
- Allow developers to continue starting, stopping, and resizing the virtual machines as needed, provided the budget threshold has not been exceeded.

Which administrative actions should you perform to meet these requirements?

  1. A
    Create a budget at the `Contoso-Dev-Sub` scope with an alert threshold set to 85%85\% of actual cost, link the alert to an Action Group that triggers an Azure Automation runbook to stop the virtual machines, and apply a ReadOnly resource lock to the `rg-sandbox-vms` resource group.
  2. B
    Apply a ReadOnly resource lock at the `Contoso-Dev-Sub` subscription level, configure a budget alert threshold at 85%85\% at the subscription scope, and configure the alert to send an email notification to the subscription owners.
  3. Create a budget at the `Contoso-Dev-Sub` scope with an alert threshold set to 85%85\% of actual cost, link the alert to an Action Group that triggers an Azure Automation runbook to stop the virtual machines, and apply a Delete (`CanNotDelete`) resource lock to the `rg-sandbox-vms` resource group.Cevap
  4. D
    Create a budget at the `rg-sandbox-vms` resource group scope with an alert threshold set to 85%85\%, assign a Delete (`CanNotDelete`) resource lock to the resource group, and configure an Azure Policy definition assigned at the subscription scope to deny write actions when the budget is exceeded.

Cevap

Create a budget at the subscription scope with an alert threshold set to 85%85\% of actual cost, link the alert to an Action Group that triggers an Azure Automation runbook to stop the virtual machines, and apply a Delete lock to the resource group.
The correct option satisfies all constraints by using a Delete (CanNotDelete) resource lock, which prevents deletion of the resource group and its virtual machines due to lock inheritance, but allows developers and the Azure Automation runbook to continue starting, stopping, and resizing the virtual machines. It also configures a budget at the subscription level with an alert threshold set to 85%85\% of actual cost, which executes the required runbook via an Action Group.

Adım Adım Çözüm

1
Determine the resource lock type that prevents deletion while allowing operations.
A Delete (CanNotDelete) resource lock must be used.
A ReadOnly lock blocks POST operations, which includes starting, stopping (deallocating), and resizing virtual machines. A Delete lock allows these actions but prevents deletion of the resource group or its child resources.
2
Determine the method to automate VM deallocation when the budget threshold is reached.
Create a budget and link its threshold alert to an Action Group that triggers an Azure Automation runbook.
Azure budgets do not natively stop VMs. Budget alerts can trigger Action Groups, which can then execute runbooks or webhooks to perform administrative actions such as VM deallocation.

Anahtar Kavram

Resource locks and automated budget alerts interact to govern resource lifecycle and billing controls without blocking operational workflows.
Bu soruyu puanla