Skip to the main content.

ScriptRunner Blog

Azure-billings with ScriptRunner

Table of contents

 

 

Post Featured Image

Virtual machines (VMs), storage, network or others are you also hyperscaling your resources using cloud solution providers? In the article, we show how ScriptRunner can help you keep an eye on costs at all times. The article is aimed at IT staff who support Azure, and may be of interest to both technical and business administration staff.

For simple scaling of your own IT resources, you can easily purchase resources from hyperscalers, providers such as Microsoft Azure, Google GCP, Amazon AWS or IBM. Thanks to the pay-as-you-grow principle, you pay for what you use. There are various ways to keep an eye on expenses and, if necessary, build in limits so that a certain monthly budget is not exceeded. In the following article, we will explain in a nutshell how this can be easily implemented in Microsoft Azure with ScriptRunner and how there will be no rude awakening when it comes to the monthly statement.

 

Costs at a glance

In the Azure portal, various settings can be made in the Cost Management area. This is where you define the budget:

 

01_Screenshot Unter Budget kann ein Limit hinterlegt werden-1

Here, you link your budget to certain actions that you chose. For example, you can set up a hard limit or an e-mail notification at certain thresholds.

02_Screenshot eines Billing-Alerts bei dem alert conditions zu sehen sind-1

There are two different types of budget alerts:

  • Forecast Cost: This type is a forecast that shows how costs will develop if the consumption remains as it currently is.
  • Actual Cost: This type indicates the actual consumption and thus represents the current accumulated value.

Based on the two types, different rules can be defined. In order to be warned as early as possible in case of exploding costs, the forecast should be used. If the costs should be stopped hard at a certain value, the actual value is used.

Under Cost Analysis, the costs can be viewed in more detail. They are broken down by service name (e.g. virtual machines, security center, storage, virtual network), locally or by resource group name. Left and in full color is the actual cost, the costs that have already been accrued. The forecast is in the lighter shade on the right:

03_Screenshot Cost Analysis

At this point, we can see how costs are evolving and which items – storage, computing or networks – are driving the costs.

Customized reports with ScriptRunner

ScriptRunner allows you to monitor costs more granularly and generate appropriate reports on demand or when specific events occur.

Before you get started running Azure scripts, make sure the ScriptRunner server is properly set up to perform actions in Azure. The appropriate Azure modules must be present on the server. Our Trial Guide describes how to perform the integration. ("Registering ScriptRunner with Azure AD"

We have prepared several scripts in our GitHub ActionPacks so that you can start with a few clicks, you may use this one for example: Get-AzConsumptionUsageDetails.ps1.

04_Screenshot ActionPacks on GitHub Get-AzConsumptionUsageDetails

This action allows ScriptRunner to create a detailed report that breaks down the costs to the individual resource, providing more accurate information about usage. Thus, the billing period, other information and the various settings can be retrieved in the parameters.

05_Assign Parameter Values in ScriptRunner

Depending on the number of resources, we recommend expanding the size of the report in the PowerShell options.

05_PowerShell Options in ScriptRunner

The report can also be created automatically at specific points in time. If you have an e-mail server on your ScriptRunner server, you can also send the report.

06_Set Result Options and Notifications in ScriptRunner

 

Conclusion 

ScriptRunner helps to keep the overview by customizing alarms and reports according to the company's requirements. Our ActionPacks contain more than 1,500 predefined scripts, which can be used one-to-one or extended and modified.  

 

Good2know

Webinar: Automate your Azure administration It's easy!

Would you like to simplify and speed up the management of your Azure services? PowerShell offers a lot of possibilities to achieve that.

In this webinar, we will show you how you can use the Azure Az PowerShell module and ScriptRunner to easily and securely automate and delegate many recurring tasks (e.g., managing virtual machines and Resource Groups).

The webinar is aimed at all administrators, solution architects and IT team leaders.

SR-Azure-Webinar-Website-EN

Learn how to simplify your Azure administration:


  • Use cases for the current Azure Az Modul and the Azure CloudShell
  • Azure VM and resource group administration with PowerShell
  • Safe and easy delegation of Azure management tasks
  • Central administration of Powershell scripts, modules and credentials



This way to our webinar!

 


 

Related links

Related posts

5 min read

How to use Azure templates for IT automation

This blog article is intended for technical staff who deploy resources in Microsoft Azure. The starting point when...

5 min read

Azure Arc & integration in VMware vSphere

In today's world, IT operations requirements are changing. Systems are no longer installed and operated only in the...

3 min read

ScriptRunner now available in the Microsoft Azure Marketplace

Microsoft Azure customers worldwide now gain access to ScriptRunner to take advantage of the scalability, reliability,...

About the author: