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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
SamTrexler
Helper IV
Helper IV

Unable to scale an Azure node

I am attempting to use the Zero-Downtime-Capacity-Scale.ps1 script from the Power BI Powershell Samples repository, as described here. I have downloaded the script, obtained the Client ID, logged in to AzureRM, etc. as described in the script. And I am an owner of the resource to be scaled.

 

I had to change the RedirectUri because the new interface for app registritaions has changed how Redirect Uris are specified, and I got past that error.

 

Now when I run the script as instructed, it reports ">>> Capacity rivip01 is available and ready for scaling!" and then starts Step1. 

 

It successfully creates the temporary capacity and asks for my login, which I provide. Then it throws an error:

 

Invoke-RestMethod : The remote server returned an error: (401) Unauthorized.
At D:\RIVIP\BI-AdHoc\Refresh\ScaleNode\Zero-Downtime-Capacity-Scale_Opus.ps1:288 char:23
+ ... itiesList = Invoke-RestMethod -Method Get -Headers $auth_header -Uri  ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
 
GetCapacityObjectID : Capacity rivip01 object ID was not found!
At D:\RIVIP\BI-AdHoc\Refresh\ScaleNode\Zero-Downtime-Capacity-Scale_Opus.ps1:289 char:31
+ ... eCapacityObjectId = GetCapacityObjectID $capacitiesList $CapacityName
+                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:)  [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,GetCapacityObjectID

 

The statement causing the error is:

    $capacitiesList = Invoke-RestMethod -Method Get -Headers $auth_header -Uri $getCapacityUri

and $getCapacityUri looks correct: https://api.powerbi.com/v1.0/myorg/capacities

 

Can anyone show me how to run this script to scale the capacity? It does exactly what I need to accomplish, but I have not been able to get it to work yet.

 

Thanks,

 

Sam

1 REPLY 1
SamTrexler
Helper IV
Helper IV

Update: Since the script created the "temporary capacity" and then crashed before doing anything with it, the temporary capacity gets left out there in Azure with no workspaces assigned to it. So I manually deleted the capcities created during each of my tests.

 

However, that screwed up my refreshes - both the scheduled refreshes in one workspace, and the refreshes initiated from a PowerShell script in the other workspace began to fail either due to timeouts or due to the refresh taking more than 120 minutes. (Peviously they took just a few minutes.) This is really odd, because reading the code it sure looks like nothing was done yet to the contents of the workspaces.

 

So I have removed all of the workspaces from the A node capacity and paused the node, and am manually syncing the datasets in shared capacity to make sure the reports and datasets are okay. I'll use a different workspace for testing scaling, so it doesn't impact anyone else.

 

It looks like this isn't as simple as it sounds. 

 

Any help on getting the authentication correct? Why am I getting an "Unauthorized" error when I am the owner of the resource?

 

Thanks,

 

Sam

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.