Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dd8zc
Helper I
Helper I

Autoscaling Power BI Embedded Gen 2

Power BI Premium Gen 2 has an autoscale feature, unfortunatly Power BI Embedded Gen 2 don't have this feature. 
What is best practice for an autoscale on Power BI Embedded Gen 2? 

2 ACCEPTED SOLUTIONS
dd8zc
Helper I
Helper I

Sadly there is no very good advice or best practices. We thought a lot about how to solve this best. Our Solution are two alert rules on the Power BI Embedded Capacity:

Rule 1: "Whenever the maximum overload (gen2) is greater than or equal to 1000m" and "Whenever the maximum cpu (gen2) is greater than 85%"

Rule 2: "Whenever the maximum cpu (gen2) is lower than 40%"

Depending on the rule which gets activated we fire a PowerShell Runbook with parameter "up" or "down"which scales our embedded instance. 

I'm a bit disappointed that a very nice feature like "autoscale" is activated and promoted on Power BI Premium but not Power BI Embedded. 

View solution in original post

We had some issues with alert rules: sometimes they didn't resolve (we couldn't figure out why) and therefore didn't fire again. 

 

Sadly our script disappered while we moved to a new repro. I tried to recap it from my mind, please try it in testing enviroment.

 

 

# Enable Managed Identity
Enable-AzContextAutosave -Scope Process
Connect-AzAccount -Identity

# Set the resource group and the name of the Power BI Embedded resource
$resourceGroupName = "<YourResourceGroupName>"
$resourceName = "<YourResourceName>"
$maxSKU = "A7"

# Read the current SKU of the Power BI Embedded resource
$pbiResource = Get-AzResource -ResourceGroupName $resourceGroupName -ResourceName $resourceName

# Extract the current SKU and increment it by 1 if it's below the maximum allowed SKU
$currentSku = $pbiResource.Sku.Name
$skuNumber = [regex]::Match($currentSku, "\d+").Value
$newSkuNumber = [int]$skuNumber + 1
$maxSkuNumber = [int][regex]::Match($maxSKU, "\d+").Value

# Ensure the new SKU does not exceed the maximum SKU
if ($newSkuNumber -le $maxSkuNumber) {
    $newSku = $currentSku -replace "\d+", $newSkuNumber.ToString()

    # Update the SKU of the Power BI Embedded resource
    $updatedConfig = @{
        "sku" = @{
            "name" = $newSku
            "tier" = "PBIE_Azure"
        }
    }
    Set-AzResource -ResourceGroupName $resourceGroupName -ResourceName $resourceName -ResourceType "Microsoft.PowerBIDedicated/capacities" -Sku $updatedConfig.sku -Force

    # Output the new SKU
    Write-Host "Power BI Embedded resource has been updated to SKU $newSku."
} else {
    Write-Host "The current SKU is already at or above the maximum permissible SKU ($maxSKU). No action taken."
}

 

 

Update: I'm sorry, I can't choose "powershell" as language, therefore the script looks like this.

View solution in original post

12 REPLIES 12
dd8zc
Helper I
Helper I

Sadly there is no very good advice or best practices. We thought a lot about how to solve this best. Our Solution are two alert rules on the Power BI Embedded Capacity:

Rule 1: "Whenever the maximum overload (gen2) is greater than or equal to 1000m" and "Whenever the maximum cpu (gen2) is greater than 85%"

Rule 2: "Whenever the maximum cpu (gen2) is lower than 40%"

Depending on the rule which gets activated we fire a PowerShell Runbook with parameter "up" or "down"which scales our embedded instance. 

I'm a bit disappointed that a very nice feature like "autoscale" is activated and promoted on Power BI Premium but not Power BI Embedded. 

Hi there, I know that this is an old one but, I'm not getting the UP and Down parameter 😞

 

Can you please clarify this step?

 

Many thanks

Please take a note to the script I pasted previously. There is no "Up" oder "Down" Parameter.

For "Up" you collect the actual SKU with a  Get-AzResource command, add 1 to a parameter and set the new tier with Set-AzResource and the parameter.

 

Hi @dd8zc ,

I'm looking to implement something like what you have described to scale our embedded capacity both up and down, but am not too confident in my PS skills.  Are you able to share the scripts that you used for both up and down?  Another question that I'm having a hard time getting my head around: how often do you poll the capacity in order to decide when to trigger in either direction?  I have read https://learn.microsoft.com/en-us/power-bi/developer/embedded/azure-pbie-scale-capacity but I don't quite get it.

 

Thanks for any pointers.

We had some issues with alert rules: sometimes they didn't resolve (we couldn't figure out why) and therefore didn't fire again. 

 

Sadly our script disappered while we moved to a new repro. I tried to recap it from my mind, please try it in testing enviroment.

 

 

# Enable Managed Identity
Enable-AzContextAutosave -Scope Process
Connect-AzAccount -Identity

# Set the resource group and the name of the Power BI Embedded resource
$resourceGroupName = "<YourResourceGroupName>"
$resourceName = "<YourResourceName>"
$maxSKU = "A7"

# Read the current SKU of the Power BI Embedded resource
$pbiResource = Get-AzResource -ResourceGroupName $resourceGroupName -ResourceName $resourceName

# Extract the current SKU and increment it by 1 if it's below the maximum allowed SKU
$currentSku = $pbiResource.Sku.Name
$skuNumber = [regex]::Match($currentSku, "\d+").Value
$newSkuNumber = [int]$skuNumber + 1
$maxSkuNumber = [int][regex]::Match($maxSKU, "\d+").Value

# Ensure the new SKU does not exceed the maximum SKU
if ($newSkuNumber -le $maxSkuNumber) {
    $newSku = $currentSku -replace "\d+", $newSkuNumber.ToString()

    # Update the SKU of the Power BI Embedded resource
    $updatedConfig = @{
        "sku" = @{
            "name" = $newSku
            "tier" = "PBIE_Azure"
        }
    }
    Set-AzResource -ResourceGroupName $resourceGroupName -ResourceName $resourceName -ResourceType "Microsoft.PowerBIDedicated/capacities" -Sku $updatedConfig.sku -Force

    # Output the new SKU
    Write-Host "Power BI Embedded resource has been updated to SKU $newSku."
} else {
    Write-Host "The current SKU is already at or above the maximum permissible SKU ($maxSKU). No action taken."
}

 

 

Update: I'm sorry, I can't choose "powershell" as language, therefore the script looks like this.

@dd8zc thank you so much!!

 

Over the holidays, I fought with the docs and powershell and runbooks, until I realized that the example script that MS has linked to is so outdated that it is unusable:

 

References in that script to:

Set-AzureRmContext
Get-AzureRmPowerBIEmbeddedCapacity
Update-AzureRmPowerBIEmbeddedCapacity

need to be replaced with

Set-AzContext
Get-AzPowerBIEmbeddedCapacity
Update-AzPowerBIEmbeddedCapacity

 

I logged this GitHub issue hoping that someone will update the documentation. https://github.com/MicrosoftDocs/powerbi-docs/issues/4935

 

Question: though my alert rule for scale-down is simple, "if MAX(CPU) < 25%" check every 30 mins, lookback 30 mins, and though the rule condition UI shows that we are in that state, the scale-down rule never fires.  Did you run into this? Our scale-up rule seems to fire immediately, as expected.

Have you tried as well with avg(CPU)? On our side this did the trick.

Thanks for this feedback!

Out-of-the-box autoscale similar to Premium's is planned for embedded as well. It is planned to include the same features:

 - 24 hours commitment (i.e. following a scale-up customers the system will scale-down based on utilization, but not before 24 hours had passed (as I explained above, currently you can configure autoscale in Azure with no commitment)

 - Autoscale v-core price of $85 as in Premium (currently the v-core price in Embedded is only $24)

 - No scaling down below the current SKU (i.e. just like in Premium autoscale, the system will scale-up using $85 v-cores, but it will never auto scale down below the SKU. This is unlike the current option in Azure which is much more flexible)

 

Bottom lines: stay tune, as it will come in few months. We thought the current options are much more attractive in terms of cost, but as you say customers are willing to pay more for an out-of-the-box solution

this message was from 2021.... no updates on this? It was "planned", but for when?

Alonba
Employee
Employee

Embedded Gen2 does not provide an out-of-the-box vertical autoscale feature. Instead, customers can configure autoscale using the following methods in conjunction:

  • Power BI Embedded Azure Resource Manager REST APIs , for example Capacities - Update .

  • Power BI Embedded Gen2 capacity metrics  such as CPU and Overload.

  • Azure alerts . 

This option is cheeper than Premium autoscale (flexible, no 24 hours commitment, cheeper v-core price)

See also Autoscaling in Embedded Gen2 

v-luwang-msft
Community Support
Community Support

Hi @dd8zc ,

Premium Gen2 enables customers to automatically add compute capacity to avoid slowdowns under heavy use, using Autoscale.

 

Autoscale requires Power BI Premium per capacity (Gen2) and Azure subscriptions.

Price: $85 Per vCore/24 hours

 

To enable Autoscale, the following steps need to be completed:

  • Select and configure an Azure subscription to use with Autoscale
  • Configure Power BI Premium to use the selected Azure subscription for Autoscale

 

Please refer to these related documents for more details

Using Autoscale with Power BI Premium 

Power BI pricing     Autoscale (preview) 

And I think the following article will be helpful for you!

Auto scale the Power BI Embedded capacity using Job Scheduler in Azure

 

 

Best Regards

Lucien

Hej @v-luwang-msft ,

 

sadly autoscale is not yet implemented in Embedded, only in Premium.

 

We're using something similar described in your article "Auto scale the Power BI Embedded capacity using Job Scheduler in Azure" and wanted to switch from time-based scaling to utilization based scaling.

 

Best regards,

Steffen 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors