Skip to content

Instantly share code, notes, and snippets.

@luu-at-pharm3r
luu-at-pharm3r / PowerBIEmbeddedScheduledAutoscaling.ps1
Last active February 4, 2021 02:30 — forked from DaveRuijter/PowerBIEmbeddedScheduledAutoscaling.ps1
PowerShell script to vertically scale up and down or pause/resume an Azure Power BI Embedded Capacity according to a schedule. You can use this in an Azure Automation Runbook. Upgraded version for 2021 because all versions of the AzureRM PowerShell module are outdated. The Az PowerShell module is now the recommended PowerShell module for interac…
<#
.SYNOPSIS
Vertically scale up and down or pause/resume an Azure Power BI Embedded Capacity according to a schedule using Azure Automation.
.DESCRIPTION
This Azure Automation runbook enables vertically scaling or pausing of an Azure Power BI Embedded Capacity according to a schedule. Autoscaling based on a schedule allows you to scale your solution according to predictable resource demand. For example you could require a high capacity (e.g. A5) on monday during peak hours, while the rest of the week the traffic is decreased, allowing you to scale down (e.g. A1). Outside business hours and during weekends you could then suspend the capacity so no charges will be applied. This runbook can be scheduled to run hourly. The code checks the scalingSchedule parameter to decide if scaling needs to be executed, or if the capacity is in the desired state already and no work needs to be done. The script is time zone aware.
.PARAMETER resourceGroupName
Name of the resource group to which the