At a Glance
Goals
- You are able to create a budget with an action that shuts down virtual machines.
Prerequisites
- Access to a Subscription is available.
- The
Unibe-Subscription-Owner (mg-unibe)role for the Subscription is available.
Create an Automation Account
- Log in to the Portal.
- Create a new Automation Account. Click in the global search field, enter
Automation Accounts, and select theAutomation Accountsservice. - Click
Create. - Select the Subscription and create a new Resource Group for the Automation Account.
- In the
Advancedtab, check the boxSystem assigned. - Click
Review + Createand thenCreate. - After the Automation Account is created, navigate to it by clicking
Go to resourcein the popup.
Create a Runbook
- Under
Process Automation, clickRunbooks. - Click
Browse Gallery. - Select
Stop Azure V2 VMsfrom the list. - Click
Select. - Give the Runbook a name and click
Import. - Navigate to the overview of the new Runbook.
- On first import, the Runbook must be published. Click
EditandIn portal. - Validate the logic of the Runbook and click
Publish.
Create a Budget
- Navigate to the Subscription.
- Under
Cost Management, clickBudgets. - Click
Add. - Enter a name and value for the Budget and click
Next. - Under
Alert condition, enter a condition for the alert. - Click
Manage action group. - Click
Create. - Select a Subscription and Resource Group and give the Action Group a name.
- Select the
Actionstab. UnderAction type, selectAutomation Runbook. - In the new popup, select
Useras theResource type. Select the Subscription and the created Automation Account. Then select the created Runbook. If parameters are required for the Runbook, clickConfigure parameters, enter the parameters, and clickOk. - Give the Action Group a name, click
Review + Create, and thenCreate.